summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2011-03-04 06:38:13 +0100
committerMarek Olšák <[email protected]>2011-03-04 14:52:45 +0100
commitba48811fa8cbe80c67cdbbb9b8180aaf64433c4e (patch)
tree9075e5ca08f3f44cd70315d8a80e0fd39d56b2e3 /src
parent53789834176396ae69e21e460881600f36124fb5 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index c3c4246d139..3f98ffd3d6f 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -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;
+ }
}