radeonsi: fix gl_PatchVerticesIn for tessellation evaluation shader
authorMarek Olšák <marek.olsak@amd.com>
Fri, 19 Aug 2016 23:42:09 +0000 (01:42 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 5 Sep 2016 16:01:15 +0000 (18:01 +0200)
This fixes:
GL45-CTS.tessellation_shader.tessellation_control_to_tessellation_evaluation
.gl_PatchVerticesIn

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index d19111c455b6313be22c4c166440bdf4c4c49642..42fed7dc0293e6e1e8dc895ec426af945042cb81 100644 (file)
@@ -1730,7 +1730,12 @@ static void declare_system_value(
        }
 
        case TGSI_SEMANTIC_VERTICESIN:
-               value = unpack_param(ctx, SI_PARAM_TCS_OUT_LAYOUT, 26, 6);
+               if (ctx->type == PIPE_SHADER_TESS_CTRL)
+                       value = unpack_param(ctx, SI_PARAM_TCS_OUT_LAYOUT, 26, 6);
+               else if (ctx->type == PIPE_SHADER_TESS_EVAL)
+                       value = unpack_param(ctx, SI_PARAM_TCS_OFFCHIP_LAYOUT, 9, 7);
+               else
+                       assert(!"invalid shader stage for TGSI_SEMANTIC_VERTICESIN");
                break;
 
        case TGSI_SEMANTIC_TESSINNER: