SVGA3dSurfaceFormat ib_format;
unsigned ib_offset;
+ unsigned num_samplers[PIPE_SHADER_TYPES];
+ SVGA3dSamplerId samplers[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
+
/* used for rebinding */
unsigned num_sampler_views[PIPE_SHADER_TYPES];
unsigned default_constbuf_size[PIPE_SHADER_TYPES];
}
if (count > 0) {
- ret = SVGA3D_vgpu10_SetSamplers(svga->swc,
- count,
- 0, /* start */
- svga_shader_type(shader), /* type */
- ids);
- if (ret != PIPE_OK)
- return ret;
+ if (count != svga->state.hw_draw.num_samplers[shader] ||
+ memcmp(ids, svga->state.hw_draw.samplers[shader],
+ count * sizeof(ids[0])) != 0) {
+ /* HW state is really changing */
+ ret = SVGA3D_vgpu10_SetSamplers(svga->swc,
+ count,
+ 0, /* start */
+ svga_shader_type(shader), /* type */
+ ids);
+ if (ret != PIPE_OK)
+ return ret;
+ memcpy(svga->state.hw_draw.samplers[shader], ids,
+ count * sizeof(ids[0]));
+ svga->state.hw_draw.num_samplers[shader] = count;
+ }
}
}