GPU: Print shader source on compilation error #116470
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#116470
Loading…
Reference in New Issue
No description provided.
Delete Branch "pragma37/blender:pull-gpu-better-shader-log"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add a define (DEBUG_LOG_SHADER_SRC_ON_ERROR ) in
gpu_shader_private.h
to print the full source code of shaders that fail to compile.
I did this when looking into #115226.
Not sure if you guys think it's a good idea or if you would prefer to enable the option in some other way.
Printing the whole source code can be slow, but at the same time, if you're debugging and there's a shader compilation error, that's probably what you are looking for in the first place.
I wouldn't do this. This is uneeded 95% of the time.
But you have a point that it is useful if you want to diff two shaders.
Usually you want to compare two part of the code not the whole shader.
This is not readable (and slow) in the console so I would suggest to write the shader code to a file instead. About keeping it behing
G_DEBUG_GPU
, I'm not sure. I would say it is preferable to have a#define
option instead.+1 for using a define. I normally just add a print statement in the logger..
Yes, but that 95% of the time it's not going to print anything, that's why I thought just enabling it in GPU debug mode might be ok.
But a define would be ok too.
I think, ideally, you want to see only the generated code, and keep the
require
statements as-is without inlining them. That would probably be the best solution, but it's not trivial to implement.Sounds good to me. Something like a
shader_compiler_error.log
in the Blender root directory?The issue is this doesn't work for linking errors, because the source is no longer available.
If you mean the shader logger is not working on some platform we should improve and fix it.
I'm not sure what you mean by that. Do you mean you want the name of the required files + the generated code?
I would use current working directory. It's easier to find.
That unfortunate yes. I'm not sure what we can do about this.
Just requesting review for updating the state of the PR. We decided to hide this option behind a preprocessor define option.