summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2013-07-30 22:29:04 +0200
committerMarek Olšák <[email protected]>2013-07-30 22:36:20 +0200
commit1302c66896e6fbdb4eeb086d41901ddaeb89513f (patch)
tree9e91b97f1bd00ae2b6e96e287e4dc885984e28e0 /src
parent4dfe1a0df56d084b6a29fe423afe0535abec29e9 (diff)
st/mesa: fix sRGB renderbuffers without EXT_framebuffer_sRGB support
https://bugs.freedesktop.org/show_bug.cgi?id=59322 Cc: [email protected]
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c8
-rw-r--r--src/mesa/state_tracker/st_format.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 826722be862..77aaccd0489 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -37,6 +37,7 @@
#include "main/context.h"
#include "main/fbobject.h"
#include "main/framebuffer.h"
+#include "main/glformats.h"
#include "main/macros.h"
#include "main/renderbuffer.h"
@@ -132,6 +133,13 @@ st_renderbuffer_alloc_storage(struct gl_context * ctx,
pipe_surface_reference( &strb->surface, NULL );
pipe_resource_reference( &strb->texture, NULL );
+ /* If an sRGB framebuffer is unsupported, sRGB formats behave like linear
+ * formats.
+ */
+ if (!ctx->Extensions.EXT_framebuffer_sRGB) {
+ internalFormat = _mesa_get_linear_internalformat(internalFormat);
+ }
+
/* Handle multisample renderbuffers first.
*
* From ARB_framebuffer_object:
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 16d977fc9ae..64bfd1faaff 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -1782,6 +1782,13 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target,
else
bind = PIPE_BIND_RENDER_TARGET;
+ /* If an sRGB framebuffer is unsupported, sRGB formats behave like linear
+ * formats.
+ */
+ if (!ctx->Extensions.EXT_framebuffer_sRGB) {
+ internalFormat = _mesa_get_linear_internalformat(internalFormat);
+ }
+
/* Set sample counts in descending order. */
for (i = 16; i > 1; i--) {
format = st_choose_format(st, internalFormat, GL_NONE, GL_NONE,