You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note this issue has only popped up with Mesa drivers so far but it's not a Mesa drivers bug/problem, it's a Blender limitation / consequence of a f64render hack. See Explanation below for more details
Compiling shader
ERROR (gpu.shader): pyGPU_Shader FragShader:
|
538 | #extension GL_ARB_fragment_shader_interlock : enable
| ^
| Error: #extension directive is not allowed in the middle of a shader
Traceback (most recent call last):
[...]
self.shader = gpu.shader.create_from_info(shader_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Exception: Shader Compile Error, see console for more details
The Blender gpu Python module prepends some stuff to the shader source, causing the #extension directive from f64render to not be at the start of the final shader source that's sent to the driver.
However per spec the #extension directives should be at the start of the shader.
Some drivers are lax enough to allow #extension anywhere, which is not the case of Mesa drivers by default. This can be overriden with the allow_glsl_extension_directive_midshader environment variable as indicated in the Workaround 1 above.
The Blender gpu Python module does not support enabling extensions like this in the shader source, because shaders should be platform agnostic. And using #extension only works with OpenGL, not Metal nor Vulkan apparently. (source: https://projects.blender.org/blender/blender/issues/126071 )
The text was updated successfully, but these errors were encountered:
Environment: Mesa driver
Note this issue has only popped up with Mesa drivers so far but it's not a Mesa drivers bug/problem, it's a Blender limitation / consequence of a f64render hack. See Explanation below for more details
Workarounds
Workaround 1: Allow mid-shader extension directives
Set environment variable
allow_glsl_extension_directive_midshader=true
(source: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7850 )For example,
allow_glsl_extension_directive_midshader=true blender
Workaround 2: Make f64render not use the extension
Change
shader_interlock_support
to Falsef64render/renderer.py
Line 75 in 6a5a4b1
->
Explanation
The Blender gpu Python module prepends some stuff to the shader source, causing the #extension directive from f64render to not be at the start of the final shader source that's sent to the driver.
However per spec the #extension directives should be at the start of the shader.
Some drivers are lax enough to allow #extension anywhere, which is not the case of Mesa drivers by default. This can be overriden with the
allow_glsl_extension_directive_midshader
environment variable as indicated in the Workaround 1 above.The Blender gpu Python module does not support enabling extensions like this in the shader source, because shaders should be platform agnostic. And using #extension only works with OpenGL, not Metal nor Vulkan apparently. (source: https://projects.blender.org/blender/blender/issues/126071 )
The text was updated successfully, but these errors were encountered: