Mesa (master): r600g: use full range of VS resources for vertex samplers

Alex Deucher agd5f at kemper.freedesktop.org
Fri Nov 19 20:52:38 UTC 2010


Module: Mesa
Branch: master
Commit: 04ffbe1ac6a82ac5cce843afa15ffdfa4ef78103
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=04ffbe1ac6a82ac5cce843afa15ffdfa4ef78103

Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Fri Nov 19 15:51:24 2010 -0500

r600g: use full range of VS resources for vertex samplers

Now that we have fetch shaders, the full range of VS resources
can be used for sampling.

---

 src/gallium/drivers/r600/evergreen_state.c |    2 +-
 src/gallium/drivers/r600/r600_shader.c     |    2 --
 src/gallium/drivers/r600/r600_state.c      |    2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index 669eef4..8558e3b 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -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);
 		}
 	}
 }
diff --git a/src/gallium/drivers/r600/r600_shader.c b/src/gallium/drivers/r600/r600_shader.c
index a2b516f..3e42309 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -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;
diff --git a/src/gallium/drivers/r600/r600_state.c b/src/gallium/drivers/r600/r600_state.c
index 3d876e7..6fd46ae 100644
--- a/src/gallium/drivers/r600/r600_state.c
+++ b/src/gallium/drivers/r600/r600_state.c
@@ -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);
 		}
 	}
 }




More information about the mesa-commit mailing list