mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 14:40:13 +01:00
svga: rebind using render target surfaces in hw draw state
Currently when we rebind framebuffer resources at the beginning of the command buffer, we use the color buffer surfaces saved in the context hw clear state. But the surfaces could be different from the actual emitted render target surfaces if any of the color buffer surfaces is also used for shader resource, in that case, we create a backed surface for the collided render target surface. So to rebind the framebuffer resources correctly, use the render target surfaces saved in the context hw draw state. Tested with Heaven, Lightsmark2008, MTT piglit, glretrace, conform. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
da98cee067
commit
c3c7ff014b
1 changed files with 6 additions and 6 deletions
|
|
@ -289,7 +289,7 @@ enum pipe_error
|
|||
svga_rebind_framebuffer_bindings(struct svga_context *svga)
|
||||
{
|
||||
const struct svga_screen *ss = svga_screen(svga->pipe.screen);
|
||||
struct pipe_framebuffer_state *hw = &svga->state.hw_clear.framebuffer;
|
||||
struct svga_hw_draw_state *hw = &svga->state.hw_draw;
|
||||
unsigned i;
|
||||
enum pipe_error ret;
|
||||
|
||||
|
|
@ -298,10 +298,10 @@ svga_rebind_framebuffer_bindings(struct svga_context *svga)
|
|||
if (!svga->rebind.flags.rendertargets)
|
||||
return PIPE_OK;
|
||||
|
||||
for (i = 0; i < ss->max_color_buffers; i++) {
|
||||
if (hw->cbufs[i]) {
|
||||
for (i = 0; i < hw->num_rendertargets; i++) {
|
||||
if (hw->rtv[i]) {
|
||||
ret = svga->swc->resource_rebind(svga->swc,
|
||||
svga_surface(hw->cbufs[i])->handle,
|
||||
svga_surface(hw->rtv[i])->handle,
|
||||
NULL,
|
||||
SVGA_RELOC_WRITE);
|
||||
if (ret != PIPE_OK)
|
||||
|
|
@ -309,9 +309,9 @@ svga_rebind_framebuffer_bindings(struct svga_context *svga)
|
|||
}
|
||||
}
|
||||
|
||||
if (hw->zsbuf) {
|
||||
if (hw->dsv) {
|
||||
ret = svga->swc->resource_rebind(svga->swc,
|
||||
svga_surface(hw->zsbuf)->handle,
|
||||
svga_surface(hw->dsv)->handle,
|
||||
NULL,
|
||||
SVGA_RELOC_WRITE);
|
||||
if (ret != PIPE_OK)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue