return;
}
- if (!ctx->Current.RasterPosValid) {
- return; /* not an error */
- }
-
if (ctx->NewState) {
_mesa_update_state(ctx);
}
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glDrawPixels(incomplete framebuffer)" );
+ return;
+ }
+
+ if (!ctx->Current.RasterPosValid) {
+ return;
+ }
+
if (ctx->RenderMode == GL_RENDER) {
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
GLint x = IROUND(ctx->Current.RasterPos[0]);
_mesa_update_state(ctx);
}
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT ||
+ ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glCopyPixels(incomplete framebuffer)" );
+ return;
+ }
+
if (!ctx->Current.RasterPosValid) {
return;
}
GLenum format, GLenum type, GLvoid *pixels )
{
GET_CURRENT_CONTEXT(ctx);
+ const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
if (width < 0 || height < 0) {
if (ctx->NewState)
_mesa_update_state(ctx);
+ if (ctx->ReadBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glReadPixels(incomplete framebuffer)" );
+ return;
+ }
+
+ if (!rb) {
+ _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(no readbuffer)");
+ return;
+ }
+
ctx->Driver.ReadPixels(ctx, x, y, width, height,
format, type, &ctx->Pack, pixels);
}
_mesa_update_state(ctx);
}
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glBitmap(incomplete framebuffer)");
+ return;
+ }
+
if (ctx->RenderMode == GL_RENDER) {
/* Truncate, to satisfy conformance tests (matches SGI's OpenGL). */
GLint x = IFLOOR(ctx->Current.RasterPos[0] - xorig);
_mesa_update_state(ctx);
}
+ if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
+ _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
+ "glDrawDepthPixelsMESA(incomplete framebuffer)");
+ return;
+ }
+
if (ctx->RenderMode == GL_RENDER) {
/* Round, to satisfy conformance tests (matches SGI's OpenGL) */
GLint x = IROUND(ctx->Current.RasterPos[0]);