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;
#define SVGA_NEW_GS 0x10000000
#define SVGA_NEW_GS_CONST_BUFFER 0x20000000
#define SVGA_NEW_GS_VARIANT 0x40000000
+#define SVGA_NEW_TEXTURE_CONSTS 0x80000000
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;
return;
for (i = 0; i < num; i++) {
+ enum pipe_texture_target target;
+
if (svga->curr.sampler_views[shader][start + i] != views[i]) {
/* Note: we're using pipe_sampler_view_release() here to work around
* a possible crash when the old view belongs to another context that
if (util_format_is_srgb(views[i]->format))
flag_srgb |= 1 << (start + i);
- if (views[i]->texture->target == PIPE_TEXTURE_1D)
+ target = views[i]->texture->target;
+ 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);
}
if (!any_change) {
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, enable the NEW_FRAME_BUFFER
* dirty bit so that emit_framebuffer can be invoked to create backed view