r600g: use full range of VS resources for vertex samplers
authorAlex Deucher <alexdeucher@gmail.com>
Fri, 19 Nov 2010 20:51:24 +0000 (15:51 -0500)
committerAlex Deucher <alexdeucher@gmail.com>
Fri, 19 Nov 2010 20:51:24 +0000 (15:51 -0500)
Now that we have fetch shaders, the full range of VS resources
can be used for sampling.

src/gallium/drivers/r600/evergreen_state.c
src/gallium/drivers/r600/r600_shader.c
src/gallium/drivers/r600/r600_state.c

index 669eef4598d404bc283853e7e60cfef09f928255..8558e3b559a6d27b31818fd545ab6cd0e528cdc9 100644 (file)
@@ -431,7 +431,7 @@ static void evergreen_set_vs_sampler_view(struct pipe_context *ctx, unsigned cou
 
        for (int i = 0; i < count; i++) {
                if (resource[i]) {
-                       evergreen_context_pipe_state_set_vs_resource(&rctx->ctx, &resource[i]->state, i + PIPE_MAX_ATTRIBS);
+                       evergreen_context_pipe_state_set_vs_resource(&rctx->ctx, &resource[i]->state, i);
                }
        }
 }
index a2b516f185ba935835785ae97b25cc3f49d8645f..3e42309bde0cf88abbf1600d06e619367b373435 100644 (file)
@@ -2028,8 +2028,6 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
        tex.inst = opcode;
        tex.sampler_id = ctx->file_offset[inst->Src[1].Register.File] + inst->Src[1].Register.Index;
        tex.resource_id = tex.sampler_id;
-       if (ctx->shader->processor_type == TGSI_PROCESSOR_VERTEX)
-               tex.resource_id += PIPE_MAX_ATTRIBS;
        tex.src_gpr = src_gpr;
        tex.dst_gpr = ctx->file_offset[inst->Dst[0].Register.File] + inst->Dst[0].Register.Index;
        tex.dst_sel_x = (inst->Dst[0].Register.WriteMask & 1) ? 0 : 7;
index 3d876e775ea48cf9dd91325cc2d766e64fc9f8e1..6fd46ae7e69f14b79397d1fb48ca369169548a5a 100644 (file)
@@ -622,7 +622,7 @@ static void r600_set_vs_sampler_view(struct pipe_context *ctx, unsigned count,
 
        for (int i = 0; i < count; i++) {
                if (resource[i]) {
-                       r600_context_pipe_state_set_vs_resource(&rctx->ctx, &resource[i]->state, i + PIPE_MAX_ATTRIBS);
+                       r600_context_pipe_state_set_vs_resource(&rctx->ctx, &resource[i]->state, i);
                }
        }
 }