Home | History | Annotate | Download | only in main

Lines Matching refs:ctx

46    GET_CURRENT_CONTEXT(ctx);
47 ASSERT_OUTSIDE_BEGIN_END(ctx);
54 if (TEST_EQ_4V(tmp, ctx->Accum.ClearColor))
57 COPY_4FV( ctx->Accum.ClearColor, tmp );
64 GET_CURRENT_CONTEXT(ctx);
65 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
76 _mesa_error(ctx, GL_INVALID_ENUM, "glAccum(op)");
80 if (ctx->DrawBuffer->Visual.haveAccumBuffer == 0) {
81 _mesa_error(ctx, GL_INVALID_OPERATION, "glAccum(no accum buffer)");
85 if (ctx->DrawBuffer != ctx->ReadBuffer) {
89 _mesa_error(ctx, GL_INVALID_OPERATION,
94 if (ctx->NewState)
95 _mesa_update_state(ctx);
97 if (ctx->DrawBuffer->_Status != GL_FRAMEBUFFER_COMPLETE_EXT) {
98 _mesa_error(ctx, GL_INVALID_FRAMEBUFFER_OPERATION_EXT,
103 if (ctx->RasterDiscard)
106 if (ctx->RenderMode == GL_RENDER) {
107 _mesa_accum(ctx, op, value);
126 _mesa_clear_accum_buffer(struct gl_context *ctx)
133 if (!ctx->DrawBuffer)
136 accRb = ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
141 x = ctx->DrawBuffer->_Xmin;
142 y = ctx->DrawBuffer->_Ymin;
143 width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
144 height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
146 ctx->Driver.MapRenderbuffer(ctx, accRb, x, y, width, height,
150 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
155 const GLshort clearR = FLOAT_TO_SHORT(ctx->Accum.ClearColor[0]);
156 const GLshort clearG = FLOAT_TO_SHORT(ctx->Accum.ClearColor[1]);
157 const GLshort clearB = FLOAT_TO_SHORT(ctx->Accum.ClearColor[2]);
158 const GLshort clearA = FLOAT_TO_SHORT(ctx->Accum.ClearColor[3]);
175 _mesa_warning(ctx, "unexpected accum buffer type");
178 ctx->Driver.UnmapRenderbuffer(ctx, accRb);
189 accum_scale_or_bias(struct gl_context *ctx, GLfloat value,
194 ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
200 ctx->Driver.MapRenderbuffer(ctx, accRb, xpos, ypos, width, height,
205 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
236 ctx->Driver.UnmapRenderbuffer(ctx, accRb);
247 accum_or_load(struct gl_context *ctx, GLfloat value,
252 ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer;
253 struct gl_renderbuffer *colorRb = ctx->ReadBuffer->_ColorReadBuffer;
270 ctx->Driver.MapRenderbuffer(ctx, accRb, xpos, ypos, width, height,
273 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
278 ctx->Driver.MapRenderbuffer(ctx, colorRb, xpos, ypos, width, height,
282 ctx->Driver.UnmapRenderbuffer(ctx, accRb);
283 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
325 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
332 ctx->Driver.UnmapRenderbuffer(ctx, accRb);
333 ctx->Driver.UnmapRenderbuffer(ctx, colorRb);
341 accum_return(struct gl_context *ctx, GLfloat value,
344 struct gl_framebuffer *fb = ctx->DrawBuffer;
351 ctx->Driver.MapRenderbuffer(ctx, accRb, xpos, ypos, width, height,
355 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
362 const GLboolean masking = (!ctx->Color.ColorMask[buffer][RCOMP] ||
363 !ctx->Color.ColorMask[buffer][GCOMP] ||
364 !ctx->Color.ColorMask[buffer][BCOMP] ||
365 !ctx->Color.ColorMask[buffer][ACOMP]);
372 ctx->Driver.MapRenderbuffer(ctx, colorRb, xpos, ypos, width, height,
375 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
404 if (ctx->Color.ColorMask[buffer][RCOMP] == 0) {
408 if (ctx->Color.ColorMask[buffer][GCOMP] == 0) {
412 if (ctx->Color.ColorMask[buffer][BCOMP] == 0) {
416 if (ctx->Color.ColorMask[buffer][ACOMP] == 0) {
430 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glAccum");
439 ctx->Driver.UnmapRenderbuffer(ctx, colorRb);
442 ctx->Driver.UnmapRenderbuffer(ctx, accRb);
453 _mesa_accum(struct gl_context *ctx, GLenum op, GLfloat value)
457 if (!ctx->DrawBuffer->Attachment[BUFFER_ACCUM].Renderbuffer) {
458 _mesa_warning(ctx, "Calling glAccum() without an accumulation buffer");
462 if (!_mesa_check_conditional_render(ctx))
465 xpos = ctx->DrawBuffer->_Xmin;
466 ypos = ctx->DrawBuffer->_Ymin;
467 width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
468 height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
473 accum_scale_or_bias(ctx, value, xpos, ypos, width, height, GL_TRUE);
478 accum_scale_or_bias(ctx, value, xpos, ypos, width, height, GL_FALSE);
483 accum_or_load(ctx, value, xpos, ypos, width, height, GL_FALSE);
487 accum_or_load(ctx, value, xpos, ypos, width, height, GL_TRUE);
490 accum_return(ctx, value, xpos, ypos, width, height);
493 _mesa_problem(ctx, "invalid mode in _mesa_accum()");
503 _mesa_init_accum( struct gl_context *ctx )
506 ASSIGN_4V( ctx->Accum.ClearColor, 0.0, 0.0, 0.0, 0.0 );