summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_context.h2
-rw-r--r--src/gallium/drivers/svga/svga_pipe_sampler.c28
-rw-r--r--src/gallium/drivers/svga/svga_state_constants.c6
3 files changed, 16 insertions, 20 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h
index bc881c943d6..484fd55d5ed 100644
--- a/src/gallium/drivers/svga/svga_context.h
+++ b/src/gallium/drivers/svga/svga_context.h
@@ -300,8 +300,6 @@ struct svga_state
struct {
unsigned flag_1d;
unsigned flag_srgb;
- unsigned flag_rect; /* sampler views with rectangular texture target */
- unsigned flag_buf; /* sampler views with texture buffer target */
} tex_flags;
unsigned sample_mask;
diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c
index 4c38092078c..b32bb098f7f 100644
--- a/src/gallium/drivers/svga/svga_pipe_sampler.c
+++ b/src/gallium/drivers/svga/svga_pipe_sampler.c
@@ -446,8 +446,6 @@ svga_set_sampler_views(struct pipe_context *pipe,
struct svga_context *svga = svga_context(pipe);
unsigned flag_1d = 0;
unsigned flag_srgb = 0;
- unsigned flag_rect = 0;
- unsigned flag_buf = 0;
uint i;
boolean any_change = FALSE;
@@ -493,12 +491,19 @@ svga_set_sampler_views(struct pipe_context *pipe,
flag_srgb |= 1 << (start + i);
target = views[i]->target;
- if (target == PIPE_TEXTURE_1D)
+ if (target == PIPE_TEXTURE_1D) {
flag_1d |= 1 << (start + i);
- else if (target == PIPE_TEXTURE_RECT)
- flag_rect |= 1 << (start + i);
- else if (target == PIPE_BUFFER)
- flag_buf |= 1 << (start + i);
+ } else if (target == PIPE_TEXTURE_RECT) {
+ /* If the size of the bound texture changes, we need to emit new
+ * const buffer values.
+ */
+ svga->dirty |= SVGA_NEW_TEXTURE_CONSTS;
+ } else if (target == PIPE_BUFFER) {
+ /* If the size of the bound buffer changes, we need to emit new
+ * const buffer values.
+ */
+ svga->dirty |= SVGA_NEW_TEXTURE_CONSTS;
+ }
}
if (!any_change) {
@@ -522,15 +527,6 @@ svga_set_sampler_views(struct pipe_context *pipe,
svga->curr.tex_flags.flag_srgb = flag_srgb;
}
- if (flag_rect != svga->curr.tex_flags.flag_rect ||
- flag_buf != svga->curr.tex_flags.flag_buf)
- {
- /* Need to re-emit texture constants */
- svga->dirty |= SVGA_NEW_TEXTURE_CONSTS;
- svga->curr.tex_flags.flag_rect = flag_rect;
- svga->curr.tex_flags.flag_buf = flag_buf;
- }
-
/* Check if any of the sampler view resources collide with the framebuffer
* color buffers or depth stencil resource. If so, set the NEW_FRAME_BUFFER
* dirty bit so that emit_framebuffer can be invoked to create backed view
diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c
index 9af91fedaef..2c1b7048673 100644
--- a/src/gallium/drivers/svga/svga_state_constants.c
+++ b/src/gallium/drivers/svga/svga_state_constants.c
@@ -769,7 +769,8 @@ struct svga_tracked_state svga_hw_vs_constants =
"hw vs params",
(SVGA_NEW_PRESCALE |
SVGA_NEW_VS_CONST_BUFFER |
- SVGA_NEW_VS_VARIANT),
+ SVGA_NEW_VS_VARIANT |
+ SVGA_NEW_TEXTURE_CONSTS),
emit_vs_consts
};
@@ -809,6 +810,7 @@ struct svga_tracked_state svga_hw_gs_constants =
(SVGA_NEW_PRESCALE |
SVGA_NEW_GS_CONST_BUFFER |
SVGA_NEW_RAST |
- SVGA_NEW_GS_VARIANT),
+ SVGA_NEW_GS_VARIANT |
+ SVGA_NEW_TEXTURE_CONSTS),
emit_gs_consts
};