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
Present in the latest version, which is 38a08d9 as of this writing.
In pbr.wgsl, a reference to screen_space_dither is made conditionally on #ifdef DEBAND_DITHER (line 113), but screen_space_dither is brought into scope in pbr_functions.wgsl, by importing bevy_core_pipeline::tonemapping conditionally on #ifdef TONEMAP_IN_SHADER (line 4).
If TONEMAP_IN_SHADER is not defined, but DEBAND_DITHER is, then the reference to screen_space_dither is present, but not defined, and the shader creation fails with this error:
ERROR bevy_render::render_resource::pipeline_cache: failed to create shader module: Validation Error
Caused by:
In Device::create_shader_module
Shader '' parsing error: no definition in scope for identifier: 'screen_space_dither'
┌─ wgsl:830:34
│
830 │ return vec4<f32>(color.rgb + screen_space_dither(pos.xy), color.a);
│ ^^^^^^^^^^^^^^^^^^^ unknown identifier
no definition in scope for identifier: 'screen_space_dither'
Either the reference to screen_space_dither in pbr.wgsl should be conditional on #ifdef TONEMAP_IN_SHADER, or the importing of bevy_core_pipeline::tonemapping in pbr_functions.wgsl should be conditional on (#ifdef TONEMAP_IN_SHADER OR #ifdef DEBAND_DITHER). I do not know if such a preprocessor operator exists to be able to do something like: #ifdef TONEMAP_IN_SHADER || DEBAND_DITHER, but such a change would seem to me to be the most correct fix for this issue.
I'm new to this interface and do not know how to add labels. My suggested labels are:
A-Rendering
C-Code-Quality
The text was updated successfully, but these errors were encountered:
The error shown actually comes from a reference to screen_space_dither in pbr_functions.wgsl on line 275. This reference is also conditional on #ifdef DEBAND_DITHER, and has the same issue as the reference in pbr.wgsl.
The dither function in pbr_functions.wgsl (line 274), which contains a reference to screen_space_dither is never actually called anywhere. This function could be deleted. This may be a separate issue.
- Fixes#7965
- Code quality improvements.
- Removes the unreferenced function `dither` in pbr_functions.wgsl
introduced in 72fbcc7, but made obsolete in c069c54.
- Makes the reference to `screen_space_dither` in pbr.wgsl conditional
on `#ifdef TONEMAP_IN_SHADER`, as the required import is conditional on
the same, as deband dithering can only occur if tonemapping is also
occurring.
---------
Co-authored-by: Carter Anderson <mcanders1@gmail.com>
Present in the latest version, which is 38a08d9 as of this writing.
In pbr.wgsl, a reference to
screen_space_dither
is made conditionally on#ifdef DEBAND_DITHER
(line 113), butscreen_space_dither
is brought into scope in pbr_functions.wgsl, by importingbevy_core_pipeline::tonemapping
conditionally on#ifdef TONEMAP_IN_SHADER
(line 4).If
TONEMAP_IN_SHADER
is not defined, butDEBAND_DITHER
is, then the reference toscreen_space_dither
is present, but not defined, and the shader creation fails with this error:Either the reference to
screen_space_dither
in pbr.wgsl should be conditional on#ifdef TONEMAP_IN_SHADER
, or the importing ofbevy_core_pipeline::tonemapping
in pbr_functions.wgsl should be conditional on (#ifdef TONEMAP_IN_SHADER
OR#ifdef DEBAND_DITHER
). I do not know if such a preprocessor operator exists to be able to do something like:#ifdef TONEMAP_IN_SHADER || DEBAND_DITHER
, but such a change would seem to me to be the most correct fix for this issue.I'm new to this interface and do not know how to add labels. My suggested labels are:
A-Rendering
C-Code-Quality
The text was updated successfully, but these errors were encountered: