z = invert_z(ctx->Depth.Clear);
}
- if (fb->_IntegerColor) {
+ if (fb->_IntegerBuffers) {
assert(glsl);
_mesa_meta_use_program(ctx, clear->IntegerShaderProg);
_mesa_Uniform4iv(0, 1, ctx->Color.ClearColor.i);
/* 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 (ctx->DrawBuffer && ctx->DrawBuffer->_IntegerBuffers) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(integer format but no fragment shader)", where);
return GL_FALSE;
* - there is an integer colorbuffer
*/
if (!drawFb || !drawFb->_HasSNormOrFloatColorBuffer ||
- drawFb->_IntegerColor)
+ drawFb->_IntegerBuffers)
ctx->Color._ClampFragmentColor = GL_FALSE;
else
ctx->Color._ClampFragmentColor =
fb->_AllColorBuffersFixedPoint = GL_TRUE;
fb->_HasSNormOrFloatColorBuffer = GL_FALSE;
fb->_HasAttachments = true;
+ fb->_IntegerBuffers = 0;
/* Start at -2 to more easily loop over all attachment points.
* -2: depth buffer
continue;
}
- /* check if integer color */
- fb->_IntegerColor = _mesa_is_format_integer_color(attFormat);
-
- /* Update _AllColorBuffersFixedPoint and _HasSNormOrFloatColorBuffer. */
+ /* Update flags describing color buffer datatypes */
if (i >= 0) {
GLenum type = _mesa_get_format_datatype(attFormat);
+ /* check if integer color */
+ if (_mesa_is_format_integer_color(attFormat))
+ fb->_IntegerBuffers |= (1 << i);
+
fb->_AllColorBuffersFixedPoint =
fb->_AllColorBuffersFixedPoint &&
(type == GL_UNSIGNED_NORMALIZED || type == GL_SIGNED_NORMALIZED);
case GL_SAMPLE_BUFFERS:
v->value_int = _mesa_geometric_samples(ctx->DrawBuffer) > 0;
break;
+ /* GL_EXT_textrue_integer */
+ case GL_RGBA_INTEGER_MODE_EXT:
+ v->value_int = (ctx->DrawBuffer->_IntegerBuffers != 0);
+ break;
/* GL_ATI_meminfo & GL_NVX_gpu_memory_info */
case GL_VBO_FREE_MEMORY_ATI:
case GL_TEXTURE_FREE_MEMORY_ATI:
[ "TEXTURE_CUBE_MAP_SEAMLESS", "CONTEXT_BOOL(Texture.CubeMapSeamless), extra_ARB_seamless_cube_map" ],
# GL_EXT_texture_integer
- [ "RGBA_INTEGER_MODE_EXT", "BUFFER_BOOL(_IntegerColor), extra_EXT_texture_integer_and_new_buffers" ],
+ [ "RGBA_INTEGER_MODE_EXT", "LOC_CUSTOM, TYPE_INT, 0, extra_EXT_texture_integer_and_new_buffers" ],
# GL_ARB_transform_feedback3
[ "MAX_TRANSFORM_FEEDBACK_BUFFERS", "CONTEXT_INT(Const.MaxTransformFeedbackBuffers), extra_ARB_transform_feedback3" ],
*/
bool _HasAttachments;
- /** Integer color values */
- GLboolean _IntegerColor;
+ GLbitfield _IntegerBuffers; /**< Which color buffers are integer valued */
/* ARB_color_buffer_float */
GLboolean _AllColorBuffersFixedPoint; /* no integer, no float */