summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/shaders
diff options
context:
space:
mode:
authorjfons <joan.fonssanchez@gmail.com>2021-10-30 02:53:09 +0200
committerjfons <joan.fonssanchez@gmail.com>2021-10-30 02:53:09 +0200
commit6db13d323160b59e1c4b532c2e09bed9139c5f82 (patch)
tree446344737aa27b29ec60c253f03b00662c768903 /servers/rendering/renderer_rd/shaders
parentdae626ad64b83bd05ccf7bc18306bc91585997e2 (diff)
Fix instance index in forward clustered shader
Diffstat (limited to 'servers/rendering/renderer_rd/shaders')
-rw-r--r--servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl9
1 files changed, 3 insertions, 6 deletions
diff --git a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl
index a83f87d23a..4119e98d15 100644
--- a/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl
+++ b/servers/rendering/renderer_rd/shaders/scene_forward_clustered.glsl
@@ -108,13 +108,14 @@ void main() {
#endif
uint instance_index = draw_call.instance_index;
- instance_index_interp = instance_index;
bool is_multimesh = bool(instances.data[instance_index].flags & INSTANCE_FLAGS_MULTIMESH);
if (!is_multimesh) {
instance_index += gl_InstanceIndex;
}
+ instance_index_interp = instance_index;
+
mat4 world_matrix = instances.data[instance_index].transform;
mat3 world_normal_matrix;
@@ -565,12 +566,8 @@ void main() {
discard;
#endif
-#ifdef USE_SUBGROUPS
- //ensures instance_index is in sgpr
- uint instance_index = subgroupBroadcastFirst(instance_index_interp);
-#else
uint instance_index = instance_index_interp;
-#endif
+
//lay out everything, whathever is unused is optimized away anyway
vec3 vertex = vertex_interp;
vec3 view = -normalize(vertex_interp);