ASSERT(state == 0 || state == 1);
switch (cap) {
case GL_BLEND:
+ if (!ctx->Extensions.EXT_draw_buffers2) {
+ goto bad_cap_error;
+ }
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
state ? "glEnableIndexed" : "glDisableIndexed", index);
}
break;
default:
- _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
- state ? "glEnableIndexed" : "glDisableIndexed",
- _mesa_lookup_enum_by_nr(cap));
+ goto bad_cap_error;
}
+ return;
+
+bad_cap_error:
+ _mesa_error(ctx, GL_INVALID_ENUM, "%s(cap=%s)",
+ state ? "glEnablei" : "glDisablei",
+ _mesa_lookup_enum_by_nr(cap));
}
{ OFF, "GL_EXT_convolution", F(EXT_convolution) },
{ ON, "GL_EXT_copy_texture", F(EXT_copy_texture) },
{ OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) },
+ { OFF, "GL_EXT_draw_buffers2", F(EXT_draw_buffers2) },
{ ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) },
{ OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) },
{ OFF, "GL_EXT_framebuffer_multisample", F(EXT_framebuffer_multisample) },
switch (pname) {
case GL_BLEND:
+ CHECK_EXT1(EXT_draw_buffers2, "GetBooleanIndexedv");
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
}
params[0] = INT_TO_BOOLEAN(((ctx->Color.BlendEnabled >> index) & 1));
break;
case GL_COLOR_WRITEMASK:
+ CHECK_EXT1(EXT_draw_buffers2, "GetBooleanIndexedv");
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetBooleanIndexedv(index=%u), index", pname);
}
switch (pname) {
case GL_BLEND:
+ CHECK_EXT1(EXT_draw_buffers2, "GetIntegerIndexedv");
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
}
params[0] = ((ctx->Color.BlendEnabled >> index) & 1);
break;
case GL_COLOR_WRITEMASK:
+ CHECK_EXT1(EXT_draw_buffers2, "GetIntegerIndexedv");
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetIntegerIndexedv(index=%u), index", pname);
}
switch (pname) {
case GL_BLEND:
+ CHECK_EXT1(EXT_draw_buffers2, "GetInteger64Indexedv");
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
}
params[0] = (GLint64)(((ctx->Color.BlendEnabled >> index) & 1));
break;
case GL_COLOR_WRITEMASK:
+ CHECK_EXT1(EXT_draw_buffers2, "GetInteger64Indexedv");
if (index >= ctx->Const.MaxDrawBuffers) {
_mesa_error(ctx, GL_INVALID_VALUE, "glGetInteger64Indexedv(index=%u), index", pname);
}
# These are queried via glGetIntegetIndexdvEXT() or glGetIntegeri_v()
IndexedStateVars = [
( "GL_BLEND", GLint, ["((ctx->Color.BlendEnabled >> index) & 1)"],
- "ctx->Const.MaxDrawBuffers", None ),
+ "ctx->Const.MaxDrawBuffers", ["EXT_draw_buffers2"] ),
( "GL_COLOR_WRITEMASK", GLint,
[ "ctx->Color.ColorMask[index][RCOMP] ? 1 : 0",
"ctx->Color.ColorMask[index][GCOMP] ? 1 : 0",
"ctx->Color.ColorMask[index][BCOMP] ? 1 : 0",
"ctx->Color.ColorMask[index][ACOMP] ? 1 : 0" ],
- "ctx->Const.MaxDrawBuffers", None ),
+ "ctx->Const.MaxDrawBuffers", ["EXT_draw_buffers2"] ),
# XXX more to come...
]
(name, varType, state, optionalCode, extensions) = state
indexMax = 0
print " case " + name + ":"
- if indexMax:
- print (' if (index >= %s) {' % indexMax)
- print (' _mesa_error(ctx, GL_INVALID_VALUE, "gl%s(index=%%u), index", pname);' % function)
- print (' }')
-
if extensions:
if len(extensions) == 1:
print (' CHECK_EXT1(%s, "%s");' %
assert len(extensions) == 4
print (' CHECK_EXT4(%s, %s, %s, %s, "%s");' %
(extensions[0], extensions[1], extensions[2], extensions[3], function))
+ if indexMax:
+ print (' if (index >= %s) {' % indexMax)
+ print (' _mesa_error(ctx, GL_INVALID_VALUE, "gl%s(index=%%u), index", pname);' % function)
+ print (' }')
+
conversion = ConversionFunc(varType, returnType)
if optionalCode:
optionalCode = string.replace(optionalCode, "CONVERSION", conversion);
GLboolean EXT_compiled_vertex_array;
GLboolean EXT_copy_texture;
GLboolean EXT_depth_bounds_test;
+ GLboolean EXT_draw_buffers2;
GLboolean EXT_draw_range_elements;
GLboolean EXT_fog_coord;
GLboolean EXT_framebuffer_blit;