GPU: Ensure usage of gpu_Layer is specified
Some shaders using gl_Layer/gpu_Layer were missing the correct usage bit in the shader create info. Shaders also need to inherit feature usage bits from included additional_info. Authored by Apple: Michael Parkin-White Pull Request: https://projects.blender.org/blender/blender/pulls/111751
This commit is contained in:
committed by
Clément Foucault
parent
5fb952a1a6
commit
5cf7089e43
@@ -27,6 +27,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_vert)
|
||||
|
||||
#ifdef WITH_METAL_BACKEND
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_vert_no_geom)
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.vertex_in(0, Type::VEC3, "pos")
|
||||
.push_constant(Type::INT, "Layer")
|
||||
.vertex_source("lightprobe_vert_no_geom.glsl")
|
||||
@@ -96,6 +97,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_effect_downsample_cube_no_geom)
|
||||
.sampler(0, ImageType::FLOAT_CUBE, "source")
|
||||
.push_constant(Type::FLOAT, "texelSize")
|
||||
.fragment_out(0, Type::VEC4, "FragColor")
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.metal_backend_only(true)
|
||||
.do_static_compilation(true)
|
||||
.auto_resource_location(true);
|
||||
@@ -225,6 +227,7 @@ GPU_SHADER_INTERFACE_INFO(eevee_legacy_probe_planar_downsample_geom_frag_iface,
|
||||
GPU_SHADER_CREATE_INFO(eevee_legacy_lightprobe_planar_downsample_common)
|
||||
.vertex_source("lightprobe_planar_downsample_vert.glsl")
|
||||
.fragment_source("lightprobe_planar_downsample_frag.glsl")
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.vertex_out(eevee_legacy_probe_planar_downsample_vert_geom_iface)
|
||||
.vertex_out(eevee_legacy_probe_planar_downsample_vert_geom_flat_iface)
|
||||
.sampler(0, ImageType::FLOAT_2D_ARRAY, "source")
|
||||
|
||||
@@ -18,6 +18,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_volumes_clear)
|
||||
.define("STANDALONE")
|
||||
.define("VOLUMETRICS")
|
||||
.define("CLEAR")
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.additional_info("eevee_legacy_common_lib")
|
||||
.additional_info("draw_view")
|
||||
.additional_info("draw_resource_id_varying")
|
||||
@@ -44,6 +45,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_volumes_clear_no_geom)
|
||||
.define("STANDALONE")
|
||||
.define("VOLUMETRICS")
|
||||
.define("CLEAR")
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.additional_info("eevee_legacy_common_lib")
|
||||
.additional_info("draw_view")
|
||||
.additional_info("draw_resource_id_varying")
|
||||
@@ -66,6 +68,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_volumes_scatter_common)
|
||||
.define("STANDALONE")
|
||||
.define("VOLUMETRICS")
|
||||
.define("VOLUME_SHADOW")
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.additional_info("eevee_legacy_common_lib")
|
||||
.additional_info("draw_view")
|
||||
.additional_info("draw_resource_id_varying")
|
||||
@@ -130,6 +133,7 @@ GPU_SHADER_CREATE_INFO(eevee_legacy_volumes_integration_common)
|
||||
.additional_info("draw_view")
|
||||
.additional_info("eevee_legacy_volumetric_lib")
|
||||
.additional_info("draw_resource_id_varying")
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
/* NOTE: Unique sampler IDs assigned for consistency between library includes,
|
||||
* and to avoid unique assignment collision validation error.
|
||||
* However, resources will be auto assigned locations within shader usage. */
|
||||
|
||||
@@ -190,6 +190,8 @@ GPU_SHADER_CREATE_INFO(eevee_surf_shadow)
|
||||
.define("DRW_VIEW_LEN", "64")
|
||||
.define("MAT_SHADOW")
|
||||
.define("USE_ATOMIC")
|
||||
.builtins(BuiltinBits::VIEWPORT_INDEX)
|
||||
.builtins(BuiltinBits::LAYER)
|
||||
.vertex_out(eevee_surf_iface)
|
||||
.vertex_out(eevee_surf_flat_iface)
|
||||
.storage_buf(SHADOW_RENDER_MAP_BUF_SLOT,
|
||||
|
||||
@@ -178,6 +178,9 @@ void ShaderCreateInfo::finalize()
|
||||
assert_no_overlap(compute_source_.is_empty(), "Compute source already existing");
|
||||
compute_source_ = info.compute_source_;
|
||||
}
|
||||
|
||||
/* Inherit builtin bits from additional info. */
|
||||
builtins_ |= info.builtins_;
|
||||
}
|
||||
|
||||
if (auto_resource_location_) {
|
||||
|
||||
Reference in New Issue
Block a user