radeonsi: Also export clip distances with geometry shader
authorMichel Dänzer <michel.daenzer@amd.com>
Thu, 9 Jan 2014 09:18:26 +0000 (18:18 +0900)
committerMichel Dänzer <michel@daenzer.net>
Wed, 29 Jan 2014 02:07:48 +0000 (11:07 +0900)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_state.c

index 227d682992654ffdceae7efa782073d41fc18f17..7718e919555abafbf67d79a770ac64d814805201 100644 (file)
@@ -2541,6 +2541,7 @@ int si_pipe_shader_create(
        if (si_shader_ctx.type == TGSI_PROCESSOR_GEOMETRY) {
                shader->gs_copy_shader = CALLOC_STRUCT(si_pipe_shader);
                shader->gs_copy_shader->selector = shader->selector;
+               shader->gs_copy_shader->key = shader->key;
                si_shader_ctx.shader = shader->gs_copy_shader;
                if ((r = si_generate_gs_copy_shader(sctx, &si_shader_ctx, dump))) {
                        free(shader->gs_copy_shader);
index ceeba26c48aff1ef555c51465ee7d6b151e1b1d3..d089fdd230aa676e4d2299b2e473f4ceeb368441 100644 (file)
@@ -2171,6 +2171,14 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
        struct si_context *sctx = (struct si_context *)ctx;
        memset(key, 0, sizeof(*key));
 
+       if ((sel->type == PIPE_SHADER_VERTEX || sel->type == PIPE_SHADER_GEOMETRY) &&
+           sctx->queued.named.rasterizer) {
+               if (sctx->queued.named.rasterizer->clip_plane_enable & 0xf0)
+                       key->vs.ucps_enabled |= 0x2;
+               if (sctx->queued.named.rasterizer->clip_plane_enable & 0xf)
+                       key->vs.ucps_enabled |= 0x1;
+       }
+
        if (sel->type == PIPE_SHADER_VERTEX) {
                unsigned i;
                if (!sctx->vertex_elements)
@@ -2179,11 +2187,6 @@ static INLINE void si_shader_selector_key(struct pipe_context *ctx,
                for (i = 0; i < sctx->vertex_elements->count; ++i)
                        key->vs.instance_divisors[i] = sctx->vertex_elements->elements[i].instance_divisor;
 
-               if (sctx->queued.named.rasterizer->clip_plane_enable & 0xf0)
-                       key->vs.ucps_enabled |= 0x2;
-               if (sctx->queued.named.rasterizer->clip_plane_enable & 0xf)
-                       key->vs.ucps_enabled |= 0x1;
-
                key->vs.as_es = sctx->gs_shader != NULL;
        } else if (sel->type == PIPE_SHADER_FRAGMENT) {
                if (sel->fs_write_all)