X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fswrast%2Fs_logic.c;h=c7cac2e40163e49a218395fad7c169438089e57a;hb=cebc62f1060c815e3b5a1bd3728c3d909db3d2b8;hp=0af9063968a40e7d99ec0d48c644640ea1d7a322;hpb=3b8bc1f46758d4da9155419fcf558a493e729501;p=mesa.git diff --git a/src/mesa/swrast/s_logic.c b/src/mesa/swrast/s_logic.c index 0af9063968a..c7cac2e4016 100644 --- a/src/mesa/swrast/s_logic.c +++ b/src/mesa/swrast/s_logic.c @@ -1,6 +1,5 @@ /* * Mesa 3-D graphics library - * Version: 6.5.2 * * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. * @@ -17,16 +16,17 @@ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. */ -#include "glheader.h" -#include "context.h" -#include "imports.h" -#include "macros.h" +#include "main/glheader.h" +#include "main/context.h" +#include "main/imports.h" +#include "main/macros.h" #include "s_context.h" #include "s_logic.h" @@ -157,24 +157,24 @@ do { \ -static INLINE void -logicop_uint1(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], +static inline void +logicop_uint1(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[], const GLubyte mask[]) { LOGIC_OP_LOOP(ctx->Color.LogicOp, 1); } -static INLINE void -logicop_uint2(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], +static inline void +logicop_uint2(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[], const GLubyte mask[]) { LOGIC_OP_LOOP(ctx->Color.LogicOp, 2); } -static INLINE void -logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], +static inline void +logicop_uint4(struct gl_context *ctx, GLuint n, GLuint src[], const GLuint dest[], const GLubyte mask[]) { LOGIC_OP_LOOP(ctx->Color.LogicOp, 4); @@ -182,47 +182,19 @@ logicop_uint4(GLcontext *ctx, GLuint n, GLuint src[], const GLuint dest[], -/* - * Apply the current logic operator to a span of CI pixels. This is only - * used if the device driver can't do logic ops. - */ -void -_swrast_logicop_ci_span(GLcontext *ctx, struct gl_renderbuffer *rb, - SWspan *span) -{ - GLuint dest[MAX_WIDTH]; - GLuint *index = span->array->index; - - ASSERT(span->end < MAX_WIDTH); - ASSERT(rb->DataType == GL_UNSIGNED_INT); - - /* Read dest values from frame buffer */ - if (span->arrayMask & SPAN_XY) { - _swrast_get_values(ctx, rb, span->end, span->array->x, span->array->y, - dest, sizeof(GLuint)); - } - else { - rb->GetRow(ctx, rb, span->end, span->x, span->y, dest); - } - - logicop_uint1(ctx, span->end, index, dest, span->array->mask); -} - - /** * Apply the current logic operator to a span of RGBA pixels. * We can handle horizontal runs of pixels (spans) or arrays of x/y * pixel coordinates. */ void -_swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, +_swrast_logicop_rgba_span(struct gl_context *ctx, struct gl_renderbuffer *rb, SWspan *span) { void *rbPixels; - ASSERT(span->end < MAX_WIDTH); - ASSERT(span->arrayMask & SPAN_RGBA); - ASSERT(rb->DataType == span->array->ChanType); + assert(span->end < SWRAST_MAX_WIDTH); + assert(span->arrayMask & SPAN_RGBA); rbPixels = _swrast_get_dest_rgba(ctx, rb, span); @@ -240,7 +212,7 @@ _swrast_logicop_rgba_span(GLcontext *ctx, struct gl_renderbuffer *rb, } else { logicop_uint4(ctx, 4 * span->end, - (GLuint *) span->array->attribs[FRAG_ATTRIB_COL0], + (GLuint *) span->array->attribs[VARYING_SLOT_COL0], (const GLuint *) rbPixels, span->array->mask); } }