aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/renderbuffer.c15
-rw-r--r--mesalib/src/mesa/main/texformat.c26
2 files changed, 37 insertions, 4 deletions
diff --git a/mesalib/src/mesa/main/renderbuffer.c b/mesalib/src/mesa/main/renderbuffer.c
index 67ee589d7..e6d5fe4bf 100644
--- a/mesalib/src/mesa/main/renderbuffer.c
+++ b/mesalib/src/mesa/main/renderbuffer.c
@@ -1122,7 +1122,20 @@ _mesa_soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *
rb->Width = width;
rb->Height = height;
rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat);
- ASSERT(rb->_BaseFormat);
+
+ if (rb->Name == 0 &&
+ internalFormat == GL_RGBA16_SNORM &&
+ rb->_BaseFormat == 0) {
+ /* NOTE: This is a special case just for accumulation buffers.
+ * This is a very limited use case- there's no snorm texturing or
+ * rendering going on.
+ */
+ rb->_BaseFormat = GL_RGBA;
+ }
+ else {
+ /* the internalFormat should have been error checked long ago */
+ ASSERT(rb->_BaseFormat);
+ }
return GL_TRUE;
}
diff --git a/mesalib/src/mesa/main/texformat.c b/mesalib/src/mesa/main/texformat.c
index 8b7b4ff47..da907455b 100644
--- a/mesalib/src/mesa/main/texformat.c
+++ b/mesalib/src/mesa/main/texformat.c
@@ -402,7 +402,7 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_RGB_SNORM:
case GL_RGB8_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888);
- break;
+ /* FALLTHROUGH */
case GL_RGBA_SNORM:
case GL_RGBA8_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
@@ -411,18 +411,27 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
case GL_ALPHA_SNORM:
case GL_ALPHA8_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_LUMINANCE_SNORM:
case GL_LUMINANCE8_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_LUMINANCE_ALPHA_SNORM:
case GL_LUMINANCE8_ALPHA8_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL88);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_INTENSITY_SNORM:
case GL_INTENSITY8_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I8);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_R16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R16);
@@ -432,21 +441,32 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
break;
case GL_RGB16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16);
- break;
+ /* FALLTHROUGH */
case GL_RGBA16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_ALPHA16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_LUMINANCE16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L16);
- break;
+ /* FALLTHROUGH */
case GL_LUMINANCE16_ALPHA16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL1616);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
case GL_INTENSITY16_SNORM:
RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888);
+ RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV);
break;
default:
; /* fall-through */