#include "main/pack.h"
#include "main/pbo.h"
#include "main/readpix.h"
+#include "main/state.h"
#include "main/texformat.h"
#include "main/teximage.h"
#include "main/texstore.h"
{
struct pipe_transfer *transfer;
- GLboolean success;
GLubyte *dest;
const GLbitfield imageTransferStateSave = ctx->_ImageTransferState;
format, type, /* src format/type */
pixels, /* data source */
unpack);
- success = GL_TRUE;
}
else {
+ bool MAYBE_UNUSED success;
success = _mesa_texstore(ctx, 2, /* dims */
baseInternalFormat, /* baseInternalFormat */
mformat, /* mesa_format */
format, type, /* src format/type */
pixels, /* data source */
unpack);
+
+ assert(success);
}
/* unmap */
pipe_transfer_unmap(pipe, transfer);
- assert(success);
-
/* restore */
ctx->_ImageTransferState = imageTransferStateSave;
}
const unsigned fb_width = _mesa_geometric_width(ctx->DrawBuffer);
const unsigned fb_height = _mesa_geometric_height(ctx->DrawBuffer);
GLfloat x0, y0, x1, y1;
- GLsizei maxSize;
+ GLsizei MAYBE_UNUSED maxSize;
boolean normalized = sv[0]->texture->target == PIPE_TEXTURE_2D;
unsigned cso_state_mask;
/* Mesa state should be up to date by now */
assert(ctx->NewState == 0x0);
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
st_flush_bitmap_cache(st);
st_invalidate_readpix_cache(st);
/* compiling a new fragment shader variant added new state constants
* into the constant buffer, we need to update them
*/
- st_upload_constants(st, st->fp->Base.Parameters, MESA_SHADER_FRAGMENT);
+ st_upload_constants(st, &st->fp->Base);
}
/* Put glDrawPixels image into a texture */
!ctx->FragmentProgram.Enabled &&
!ctx->VertexProgram.Enabled &&
!ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT] &&
- !ctx->ATIFragmentShader._Enabled &&
+ !_mesa_ati_fragment_shader_enabled(ctx) &&
ctx->DrawBuffer->_NumColorDrawBuffers == 1 &&
!ctx->Query.CondRenderQuery &&
!ctx->Query.CurrentOcclusionObject) {
GLint readX, readY, readW, readH;
struct gl_pixelstore_attrib pack = ctx->DefaultPacking;
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
st_flush_bitmap_cache(st);
st_invalidate_readpix_cache(st);
/* compiling a new fragment shader variant added new state constants
* into the constant buffer, we need to update them
*/
- st_upload_constants(st, st->fp->Base.Parameters, MESA_SHADER_FRAGMENT);
+ st_upload_constants(st, &st->fp->Base);
}
else {
assert(type == GL_DEPTH);