turnip: Emit geometry shader descriptor consts
authorBrian Ho <brian@brkho.com>
Mon, 13 Apr 2020 22:04:33 +0000 (15:04 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 15 Apr 2020 16:19:34 +0000 (16:19 +0000)
Without these consts, the geometry shader is unable to read from
textures or uniforms.

Fixes dEQP-VK.geometry.layered.*.readback

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4541>

src/freedreno/vulkan/tu_cmd_buffer.c

index 633ca11324c6e741a27612f54738f3c9afb7d2b4..557fc857e2791d565a5096ddb4927a69711b3362 100644 (file)
@@ -2526,6 +2526,7 @@ enum tu_draw_state_group_id
    TU_DRAW_STATE_DS,
    TU_DRAW_STATE_BLEND,
    TU_DRAW_STATE_VS_CONST,
+   TU_DRAW_STATE_GS_CONST,
    TU_DRAW_STATE_FS_CONST,
    TU_DRAW_STATE_DESC_SETS,
    TU_DRAW_STATE_DESC_SETS_GMEM,
@@ -2566,6 +2567,8 @@ tu6_stage2shadersb(gl_shader_stage type)
    switch (type) {
    case MESA_SHADER_VERTEX:
       return SB6_VS_SHADER;
+   case MESA_SHADER_GEOMETRY:
+      return SB6_GS_SHADER;
    case MESA_SHADER_FRAGMENT:
       return SB6_FS_SHADER;
    case MESA_SHADER_COMPUTE:
@@ -3033,6 +3036,12 @@ tu6_bind_draw_states(struct tu_cmd_buffer *cmd,
             .enable_mask = ENABLE_ALL,
             .ib = tu6_emit_consts(cmd, pipeline, descriptors_state, MESA_SHADER_VERTEX)
          };
+      draw_state_groups[draw_state_group_count++] =
+         (struct tu_draw_state_group) {
+            .id = TU_DRAW_STATE_GS_CONST,
+            .enable_mask = ENABLE_ALL,
+            .ib = tu6_emit_consts(cmd, pipeline, descriptors_state, MESA_SHADER_GEOMETRY)
+         };
       draw_state_groups[draw_state_group_count++] =
          (struct tu_draw_state_group) {
             .id = TU_DRAW_STATE_FS_CONST,