summaryrefslogtreecommitdiff
path: root/src/mesa/main/context.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-10-26 18:01:06 -0600
committerBrian Paul <brianp@vmware.com>2010-10-26 18:05:37 -0600
commit705978e2831eb8b8bb23bd11ee08ce51d9b2915c (patch)
tree20696308beb046a1fe996dfe8930ce41ea1433a9 /src/mesa/main/context.c
parentbb4f12f53875707a0d3c1eb254745b6250c42951 (diff)
mesa: do integer FB / shader validation check in _mesa_valid_to_render()
Diffstat (limited to 'src/mesa/main/context.c')
-rw-r--r--src/mesa/main/context.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 9401e3dcc2..3e265fb308 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -1700,7 +1700,7 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
if (ctx->Shader.CurrentProgram) {
struct gl_shader_program *const prog = ctx->Shader.CurrentProgram;
- /* using shaders */
+ /* The current shader program must be successfully linked */
if (!prog->LinkStatus) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(shader not linked)", where);
@@ -1728,6 +1728,16 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
prog->_LinkedShaders[MESA_SHADER_FRAGMENT] != NULL;
}
+ /* If drawing to integer-valued color buffers, there must be an
+ * active fragment shader (GL_EXT_texture_integer).
+ */
+ if (ctx->DrawBuffer && ctx->DrawBuffer->_IntegerColor) {
+ if (!frag_from_glsl_shader) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(integer format but no fragment shader)", where);
+ return GL_FALSE;
+ }
+ }
/* Any shader stages that are not supplied by the GLSL shader and have
* assembly shaders enabled must now be validated.