#include "i915_context.h"
#include "main/api_exec.h"
+#include "main/framebuffer.h"
#include "main/imports.h"
#include "main/macros.h"
#include "main/version.h"
_tnl_invalidate_vertex_state(ctx, new_state);
intel_context(ctx)->NewGLState |= new_state;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
/* Todo: gather state values under which tracked parameters become
* invalidated, add callbacks for things like
* ProgramLocalParameters, etc.
intel->NewGLState |= new_state;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
if (intel->vtbl.invalidate_state)
intel->vtbl.invalidate_state( intel, new_state );
}
_mesa_unlock_context_textures(ctx);
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
if (new_state & (_NEW_STENCIL | _NEW_BUFFERS)) {
brw->stencil_enabled = _mesa_stencil_is_enabled(ctx);
brw->stencil_two_sided = _mesa_stencil_is_two_sided(ctx);
#include "swrast/swrast.h"
#include "tnl/tnl.h"
#include "util/bitscan.h"
+#include "main/framebuffer.h"
static void
nouveau_alpha_func(struct gl_context *ctx, GLenum func, GLfloat ref)
GLbitfield new_state = ctx->NewState;
int i;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
if (new_state & (_NEW_PROJECTION | _NEW_MODELVIEW))
context_dirty(ctx, PROJECTION);
r200ContextPtr rmesa = R200_CONTEXT(ctx);
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
{
GLuint new_state = ctx->NewState;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
{
GLuint new_state = ctx->NewState;
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
/* not much to do here - pass it on */
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
static void
osmesa_update_state(struct gl_context *ctx, GLuint new_state)
{
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
/* easy - just propogate */
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
GLbitfield new_state = ctx->NewState;
const XMesaContext xmesa = XMESA_CONTEXT(ctx);
+ if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
/* Propagate statechange information to swrast and swrast_setup
* modules. The X11 driver has no internal GL-dependent state.
*/
#include "context.h"
#include "format_unpack.h"
#include "format_pack.h"
+#include "framebuffer.h"
#include "imports.h"
#include "macros.h"
#include "state.h"
if (!accRb)
return; /* missing accum buffer, not an error */
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
/* bounds, with scissor */
x = ctx->DrawBuffer->_Xmin;
y = ctx->DrawBuffer->_Ymin;
if (!_mesa_check_conditional_render(ctx))
return;
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
xpos = ctx->DrawBuffer->_Xmin;
ypos = ctx->DrawBuffer->_Ymin;
width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
if (new_state & _NEW_BUFFERS)
_mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer);
- if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT))
- _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
-
if (new_state & _NEW_LIGHT)
_mesa_update_lighting( ctx );
#include "main/glheader.h"
#include "main/accum.h"
#include "main/formats.h"
+#include "main/framebuffer.h"
#include "main/macros.h"
#include "main/glformats.h"
#include "program/prog_instruction.h"
const struct gl_framebuffer *fb = ctx->DrawBuffer;
const GLfloat fb_width = (GLfloat) fb->Width;
const GLfloat fb_height = (GLfloat) fb->Height;
+
+ _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer);
+
const GLfloat x0 = (GLfloat) ctx->DrawBuffer->_Xmin / fb_width * 2.0f - 1.0f;
const GLfloat x1 = (GLfloat) ctx->DrawBuffer->_Xmax / fb_width * 2.0f - 1.0f;
const GLfloat y0 = (GLfloat) ctx->DrawBuffer->_Ymin / fb_height * 2.0f - 1.0f;
/* 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);
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);