#include "arrayobj.h"
#include "bufferobj.h"
#include "context.h"
-#include "imports.h"
+#include "util/imports.h"
#include "mtypes.h"
#include "pipelineobj.h"
#include "enums.h"
"%s(tess ctrl shader is missing)", function);
return false;
}
+
+ /* From GL_EXT_color_buffer_float:
+ *
+ * "Blending applies only if the color buffer has a fixed-point or
+ * or floating-point format. If the color buffer has an integer
+ * format, proceed to the next operation. Furthermore, an
+ * INVALID_OPERATION error is generated by DrawArrays and the other
+ * drawing commands defined in section 2.8.3 (10.5 in ES 3.1) if
+ * blending is enabled (see below) and any draw buffer has 32-bit
+ * floating-point format components."
+ *
+ * However GL_EXT_float_blend removes this text.
+ */
+ if (!ctx->Extensions.EXT_float_blend &&
+ (ctx->DrawBuffer->_FP32Buffers & ctx->Color.BlendEnabled)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(32-bit float output + blending)", function);
+ return false;
+ }
break;
case API_OPENGL_CORE:
/* Not using a VBO for indices, so avoid NULL pointer derefs later.
*/
- if (!_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) {
+ if (!ctx->Array.VAO->IndexBufferObj) {
for (i = 0; i < primcount; i++) {
if (!indices[i])
return GL_FALSE;
* structure, be in buffer objects, and may not be called when
* the default vertex array object is bound."
*/
- if (ctx->Array.VAO == ctx->Array.DefaultVAO) {
+ if (ctx->API != API_OPENGL_COMPAT &&
+ ctx->Array.VAO == ctx->Array.DefaultVAO) {
_mesa_error(ctx, GL_INVALID_OPERATION, "(no VAO bound)");
return GL_FALSE;
}
* buffer bound.
*/
if (_mesa_is_gles31(ctx) &&
- ctx->Array.VAO->_Enabled & ~ctx->Array.VAO->VertexAttribBufferMask) {
+ ctx->Array.VAO->Enabled & ~ctx->Array.VAO->VertexAttribBufferMask) {
_mesa_error(ctx, GL_INVALID_OPERATION, "%s(No VBO bound)", name);
return GL_FALSE;
}
return GL_FALSE;
}
- if (!_mesa_is_bufferobj(ctx->DrawIndirectBuffer)) {
+ if (!ctx->DrawIndirectBuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s: no buffer bound to DRAW_INDIRECT_BUFFER", name);
return GL_FALSE;
* If no element array buffer is bound, an INVALID_OPERATION error is
* generated.
*/
- if (!_mesa_is_bufferobj(ctx->Array.VAO->IndexBufferObj)) {
+ if (!ctx->Array.VAO->IndexBufferObj) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s(no buffer bound to GL_ELEMENT_ARRAY_BUFFER)", name);
return GL_FALSE;
* MultiDrawElementsIndirectCountARB if no buffer is bound to the
* PARAMETER_BUFFER_ARB binding point."
*/
- if (!_mesa_is_bufferobj(ctx->ParameterBuffer)) {
+ if (!ctx->ParameterBuffer) {
_mesa_error(ctx, GL_INVALID_OPERATION,
"%s: no buffer bound to PARAMETER_BUFFER", name);
return GL_FALSE;