mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-08 02:00:21 +01:00
st/mesa: set PIPE_BIND_RENDER_TARGET for sRGB formats if UNORM is supported
Because the format can be changed to UNORM in a surface. This fixes: state_tracker/st_atom_framebuffer.c:163:update_framebuffer_state: Assertion `framebuffer->cbufs[i]->texture->bind & (1 << 1)' failed.
This commit is contained in:
parent
5378983417
commit
ba48811fa8
1 changed files with 9 additions and 2 deletions
|
|
@ -227,8 +227,15 @@ default_bindings(struct st_context *st, enum pipe_format format)
|
|||
|
||||
if (screen->is_format_supported(screen, format, target, 0, bindings, geom))
|
||||
return bindings;
|
||||
else
|
||||
return PIPE_BIND_SAMPLER_VIEW;
|
||||
else {
|
||||
/* Try non-sRGB. */
|
||||
format = util_format_linear(format);
|
||||
|
||||
if (screen->is_format_supported(screen, format, target, 0, bindings, geom))
|
||||
return bindings;
|
||||
else
|
||||
return PIPE_BIND_SAMPLER_VIEW;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue