radeonsi: fix VertexID for OpenGL
authorMarek Olšák <marek.olsak@amd.com>
Sun, 4 Jan 2015 13:41:49 +0000 (14:41 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jan 2015 11:06:43 +0000 (12:06 +0100)
This fixes all failing piglit VertexID tests.

Cc: 10.4 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/radeonsi/si_shader.c

index 169449054add6e7aa4f6bedcc5c1229212e89d61..e93708bf96438ddab475624d2a001676cb978551 100644 (file)
@@ -591,8 +591,11 @@ static void declare_system_value(
                break;
 
        case TGSI_SEMANTIC_VERTEXID:
-               value = LLVMGetParam(radeon_bld->main_fn,
-                                    si_shader_ctx->param_vertex_id);
+               value = LLVMBuildAdd(gallivm->builder,
+                                    LLVMGetParam(radeon_bld->main_fn,
+                                                 si_shader_ctx->param_vertex_id),
+                                    LLVMGetParam(radeon_bld->main_fn,
+                                                 SI_PARAM_BASE_VERTEX), "");
                break;
 
        case TGSI_SEMANTIC_SAMPLEID: