From ea1d818b58d6ff9e4cd0c40eb865beabde8f268c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 11 Oct 2010 11:58:27 +1000 Subject: r600g: enable vertex samplers. We need to move the texture sampler resources out of the range of the vertex attribs. We could probably improve this using an allocator but this is the simple answer for now. makes mesa-demos/src/glsl/vert-tex work. --- src/gallium/drivers/r600/evergreen_state.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/r600/evergreen_state.c') diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c index bdd54811fb..323509f640 100644 --- a/src/gallium/drivers/r600/evergreen_state.c +++ b/src/gallium/drivers/r600/evergreen_state.c @@ -480,8 +480,14 @@ static struct pipe_sampler_view *evergreen_create_sampler_view(struct pipe_conte static void evergreen_set_vs_sampler_view(struct pipe_context *ctx, unsigned count, struct pipe_sampler_view **views) { - /* TODO */ - assert(1); + struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; + struct r600_pipe_sampler_view **resource = (struct r600_pipe_sampler_view **)views; + + 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); + } + } } static void evergreen_set_ps_sampler_view(struct pipe_context *ctx, unsigned count, @@ -523,7 +529,6 @@ static void evergreen_bind_vs_sampler(struct pipe_context *ctx, unsigned count, struct r600_pipe_context *rctx = (struct r600_pipe_context *)ctx; struct r600_pipe_state **rstates = (struct r600_pipe_state **)states; - /* TODO implement */ for (int i = 0; i < count; i++) { evergreen_context_pipe_state_set_vs_sampler(&rctx->ctx, rstates[i], i); } -- cgit v1.2.3