diff options
author | Roland Scheidegger <[email protected]> | 2013-01-28 06:50:36 -0800 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-01-28 06:50:36 -0800 |
commit | c789b981b244333cfc903bcd1e2fefc010500013 (patch) | |
tree | 0f0c5375916677240e11a1046af81bb2d5443030 /src/gallium/auxiliary/draw/draw_context.c | |
parent | 87592cff57feef29565150b9203e220b50623f30 (diff) |
gallivm: split sampler and texture state
Split the sampler interface to use separate sampler and texture (sampler_view)
state. This is needed to support dx10-style sampling instructions.
This is not quite complete since both draw/llvmpipe don't really track
textures/samplers independently yet, as well as the gallivm code not quite
using the right sampler or texture index respectively (but it should work
for the sampling codes used by opengl).
We are however losing some optimizations in the process, apply_max_lod will
no longer work, and we potentially could end up with more (unnecessary)
recompiles (if switching textures with/without mipmaps only so it shouldn't
be too bad).
v2: don't use different callback structs for sampler/sampler view functions
(which just complicates things), fix up sampling code to actually use the
right texture or sampler index, and similar for llvmpipe/draw actually
distinguish between samplers and sampler views.
v3: fix more of PIPE_MAX_SAMPLER / PIPE_MAX_SHADER_SAMPLER_VIEWS mismatches
(both in draw and llvmpipe), based on feedback from José get rid of unneeded
static sampler derived state.(which also fixes the only 2 piglit regressions
due to a forgotten assignment), fix comments based on Brian's feedback.
v4: remove some accidental unrelated whitespace changes
Reviewed-by: José Fonseca <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index bc2f0e1d03f..dfa8927bc08 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -762,11 +762,11 @@ draw_set_sampler_views(struct draw_context *draw, unsigned i; debug_assert(shader_stage < PIPE_SHADER_TYPES); - debug_assert(num <= PIPE_MAX_SAMPLERS); + debug_assert(num <= PIPE_MAX_SHADER_SAMPLER_VIEWS); for (i = 0; i < num; ++i) draw->sampler_views[shader_stage][i] = views[i]; - for (i = num; i < PIPE_MAX_SAMPLERS; ++i) + for (i = num; i < PIPE_MAX_SHADER_SAMPLER_VIEWS; ++i) draw->sampler_views[shader_stage][i] = NULL; draw->num_sampler_views[shader_stage] = num; |