swr: add sprite coord enable mask to fs key
authorIlia Mirkin <imirkin@alum.mit.edu>
Mon, 21 Nov 2016 17:45:08 +0000 (12:45 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Wed, 23 Nov 2016 01:27:20 +0000 (20:27 -0500)
This fixes gl-coord-replace-doesnt-eliminate-frag-tex-coords

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tim Rowley <timothy.o.rowley@intel.com>
src/gallium/drivers/swr/swr_shader.cpp
src/gallium/drivers/swr/swr_shader.h

index d29f635144348503f4829ba48afc9e8440700a15..428c9b3265dc2d355f317e2f5afa082e59ef70bd 100644 (file)
@@ -131,6 +131,7 @@ swr_generate_fs_key(struct swr_jit_fs_key &key,
 
    key.nr_cbufs = ctx->framebuffer.nr_cbufs;
    key.light_twoside = ctx->rasterizer->light_twoside;
+   key.sprite_coord_enable = ctx->rasterizer->sprite_coord_enable;
    memcpy(&key.vs_output_semantic_name,
           &ctx->vs->info.base.output_semantic_name,
           sizeof(key.vs_output_semantic_name));
@@ -515,7 +516,7 @@ BuilderSWR::CompileFS(struct swr_context *ctx, swr_jit_fs_key &key)
       unsigned linkedAttrib =
          locate_linkage(semantic_name, semantic_idx, &ctx->vs->info.base);
       if (semantic_name == TGSI_SEMANTIC_GENERIC &&
-          ctx->rasterizer->sprite_coord_enable & (1 << semantic_idx)) {
+          key.sprite_coord_enable & (1 << semantic_idx)) {
          /* we add an extra attrib to the backendState in swr_update_derived. */
          linkedAttrib = ctx->vs->info.base.num_outputs - 1;
          swr_fs->pointSpriteMask |= (1 << linkedAttrib);
index ccdda445119f0b3733d0c470953577dd36e1c491..7e3399ccd87e712e1ea38b9572a3df4b1042452e 100644 (file)
@@ -51,6 +51,7 @@ struct swr_jit_sampler_key {
 struct swr_jit_fs_key : swr_jit_sampler_key {
    unsigned nr_cbufs;
    unsigned light_twoside;
+   unsigned sprite_coord_enable;
    ubyte vs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS];
    ubyte vs_output_semantic_idx[PIPE_MAX_SHADER_OUTPUTS];
 };