memset(&svga->state.hw_clear, 0xcd, sizeof(svga->state.hw_clear));
memset(&svga->state.hw_clear.framebuffer, 0x0,
sizeof(svga->state.hw_clear.framebuffer));
+ svga->state.hw_clear.num_rendertargets = 0;
+ svga->state.hw_clear.dsv = NULL;
memset(&svga->state.hw_draw, 0xcd, sizeof(svga->state.hw_draw));
memset(&svga->state.hw_draw.views, 0x0, sizeof(svga->state.hw_draw.views));
memset(svga->state.hw_draw.sampler_views, 0,
sizeof(svga->state.hw_draw.sampler_views));
svga->state.hw_draw.num_views = 0;
- svga->state.hw_draw.num_rendertargets = 0;
- svga->state.hw_draw.dsv = NULL;
svga->state.hw_draw.rasterizer_discard = FALSE;
/* Initialize the shader pointers */
struct pipe_framebuffer_state framebuffer;
struct svga_prescale prescale;
+
+ /* VGPU10 state */
+ unsigned num_rendertargets;
+ struct pipe_surface *rtv[SVGA3D_MAX_RENDER_TARGETS];
+ struct pipe_surface *dsv;
};
struct svga_hw_view_state
struct pipe_sampler_view
*sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS];
- unsigned num_rendertargets;
- struct pipe_surface *rtv[SVGA3D_MAX_RENDER_TARGETS];
- struct pipe_surface *dsv;
-
/* used for rebinding */
unsigned default_constbuf_size[PIPE_SHADER_TYPES];
}
/* avoid emitting redundant SetRenderTargets command */
- if ((num_color != svga->state.hw_draw.num_rendertargets) ||
- (dsv != svga->state.hw_draw.dsv) ||
- memcmp(rtv, svga->state.hw_draw.rtv, num_color * sizeof(rtv[0]))) {
+ if ((num_color != svga->state.hw_clear.num_rendertargets) ||
+ (dsv != svga->state.hw_clear.dsv) ||
+ memcmp(rtv, svga->state.hw_clear.rtv, num_color * sizeof(rtv[0]))) {
ret = SVGA3D_vgpu10_SetRenderTargets(svga->swc, num_color, rtv, dsv);
if (ret != PIPE_OK)
/* number of render targets sent to the device, not including trailing
* unbound render targets.
*/
- svga->state.hw_draw.num_rendertargets = last_rtv + 1;
- svga->state.hw_draw.dsv = dsv;
- memcpy(svga->state.hw_draw.rtv, rtv, num_color * sizeof(rtv[0]));
+ svga->state.hw_clear.num_rendertargets = last_rtv + 1;
+ svga->state.hw_clear.dsv = dsv;
+ memcpy(svga->state.hw_clear.rtv, rtv, num_color * sizeof(rtv[0]));
for (i = 0; i < ss->max_color_buffers; i++) {
if (hw->cbufs[i] != curr->cbufs[i]) {
enum pipe_error
svga_rebind_framebuffer_bindings(struct svga_context *svga)
{
- struct svga_hw_draw_state *hw = &svga->state.hw_draw;
+ struct svga_hw_clear_state *hw = &svga->state.hw_clear;
unsigned i;
enum pipe_error ret;
* not the svga->curr.framebuffer surfaces, because it's the former
* surfaces which may be backing surface views (the actual render targets).
*/
- for (i = 0; i < svga->state.hw_draw.num_rendertargets; i++) {
- struct pipe_surface *s = svga->state.hw_draw.rtv[i];
+ for (i = 0; i < svga->state.hw_clear.num_rendertargets; i++) {
+ struct pipe_surface *s = svga->state.hw_clear.rtv[i];
if (s) {
svga_propagate_surface(svga, s, FALSE);
}
}
- if (svga->state.hw_draw.dsv) {
- svga_propagate_surface(svga, svga->state.hw_draw.dsv, FALSE);
+ if (svga->state.hw_clear.dsv) {
+ svga_propagate_surface(svga, svga->state.hw_clear.dsv, FALSE);
}
}