radeonsi: Fix double compilation of shader variants.
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 27 Sep 2012 14:39:26 +0000 (16:39 +0200)
committerMichel Dänzer <michel@daenzer.net>
Tue, 2 Oct 2012 15:53:47 +0000 (17:53 +0200)
Fixes crash in piglit glsl-max-varyings.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/radeonsi/radeonsi_shader.c
src/gallium/drivers/radeonsi/si_state_draw.c

index a48234a17ca6126b96c6a07a51a03ed0826e55a2..f65e69210cff09519b86775345d1c9d73b55bc32 100644 (file)
@@ -698,6 +698,10 @@ int si_pipe_shader_create(
 
        dump = debug_get_bool_option("RADEON_DUMP_SHADERS", FALSE);
 
+       assert(shader->shader.noutput == 0);
+       assert(shader->shader.ninterp == 0);
+       assert(shader->shader.ninput == 0);
+
        memset(&si_shader_ctx, 0, sizeof(si_shader_ctx));
        radeon_llvm_context_init(&si_shader_ctx.radeon_bld);
        bld_base = &si_shader_ctx.radeon_bld.soa.bld_base;
index e62ef71e8546c74f473c6c64d6a9e727f7720e39..629ec03e2fb0cc2003a9045e119f83516a1dc41e 100644 (file)
@@ -45,9 +45,6 @@ static void si_pipe_shader_vs(struct pipe_context *ctx, struct si_pipe_shader *s
        unsigned nparams, i;
        uint64_t va;
 
-       if (si_pipe_shader_create(ctx, shader))
-               return;
-
        si_pm4_delete_state(rctx, vs, shader->pm4);
        pm4 = shader->pm4 = CALLOC_STRUCT(si_pm4_state);
 
@@ -106,9 +103,6 @@ static void si_pipe_shader_ps(struct pipe_context *ctx, struct si_pipe_shader *s
        unsigned spi_baryc_cntl, spi_ps_input_ena;
        uint64_t va;
 
-       if (si_pipe_shader_create(ctx, shader))
-               return;
-
        si_pm4_delete_state(rctx, ps, shader->pm4);
        pm4 = shader->pm4 = CALLOC_STRUCT(si_pm4_state);