Because the format can be changed to UNORM in a sampler view. This fixes: state_tracker/st_atom_framebuffer.c:163:update_framebuffer_state: Assertion `framebuffer->cbufs[i]->texture->bind & (1 << 1)' failed. --- src/mesa/state_tracker/st_cb_texture.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index c3c4246..1e793dc 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -227,8 +227,17 @@ 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. */ + const gl_format linearFormat = + _mesa_get_srgb_format_linear(st_pipe_format_to_mesa_format(format)); + format = st_mesa_format_to_pipe_format(linearFormat); + + if (screen->is_format_supported(screen, format, target, 0, bindings, geom)) + return bindings; + else + return PIPE_BIND_SAMPLER_VIEW; + } } -- 1.7.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev