aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2015-12-17 05:58:58 +0100
committerRoland Scheidegger <[email protected]>2015-12-18 00:55:35 +0100
commit44e87b7b7b49669d10b6d60500885e51b42d05c3 (patch)
treedd29a003d39db6a642c08bad62d3490411c13c25 /src/gallium/auxiliary/draw/draw_pipe_pstipple.c
parent6723b61753102aae46833810ecedf2213cd714b4 (diff)
draw: fix pstipple and aaline stages wrt sampler_views/samplers
Those stages only really work for OGL-style texturing (so number of samplers and views mostly the same, certainly for the max values). These get often set up all at once, thus there might be max number of both even if all of them are just NULL. We must not set the max number of samplers and views to the same value since that will lead to terrible things if a driver supports more views than samplers (and the state tracker set up all the views). (This will not make these stages magically work if a shader uses dx10-style texturing, they might still replace an actually used sview in that case.) Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_pstipple.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_pstipple.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
index b58d7530783..cf52ca48b26 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c
@@ -477,6 +477,7 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header)
struct pipe_context *pipe = pstip->pipe;
struct draw_context *draw = stage->draw;
uint num_samplers;
+ uint num_sampler_views;
assert(stage->draw->rasterizer->poly_stipple_enable);
@@ -490,8 +491,8 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header)
/* how many samplers? */
/* we'll use sampler/texture[pstip->sampler_unit] for the stipple */
- num_samplers = MAX2(pstip->num_sampler_views, pstip->num_samplers);
- num_samplers = MAX2(num_samplers, pstip->fs->sampler_unit + 1);
+ num_samplers = MAX2(pstip->num_samplers, pstip->fs->sampler_unit + 1);
+ num_sampler_views = MAX2(pstip->num_sampler_views, num_samplers);
/* plug in our sampler, texture */
pstip->state.samplers[pstip->fs->sampler_unit] = pstip->sampler_cso;
@@ -506,7 +507,7 @@ pstip_first_tri(struct draw_stage *stage, struct prim_header *header)
num_samplers, pstip->state.samplers);
pstip->driver_set_sampler_views(pipe, PIPE_SHADER_FRAGMENT, 0,
- num_samplers, pstip->state.sampler_views);
+ num_sampler_views, pstip->state.sampler_views);
draw->suspend_flushing = FALSE;