sRGBEnabled should affect both textures and renderbuffers, so we need
to check/update the pipe_surface format for both.
Fixes, for instance, rendering appearing too bright in wine applications
using sRGB multisample renderbuffers.
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
struct st_renderbuffer *strb)
{
struct pipe_context *pipe = st->pipe;
- struct pipe_resource *resource = strb->rtt->pt;
+ struct pipe_resource *resource = strb->rtt ? strb->rtt->pt : strb->texture;
int rtt_width = strb->Base.Width;
int rtt_height = strb->Base.Height;
enum pipe_format format = st->ctx->Color.sRGBEnabled ? resource->format : util_format_linear(resource->format);
if (strb) {
/*printf("--------- framebuffer surface rtt %p\n", strb->rtt);*/
- if (strb->rtt) {
+ if (strb->rtt ||
+ (strb->texture && util_format_is_srgb(strb->texture->format))) {
/* rendering to a GL texture, may have to update surface */
update_renderbuffer_surface(st, strb);
}