mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 20:40:24 +01:00
fix rgba pointer bug hit on zoomed+fogged glDrawPixels
This commit is contained in:
parent
ed5ed6fe2f
commit
93becd8a18
2 changed files with 11 additions and 11 deletions
|
|
@ -1150,6 +1150,7 @@ convert_color_type(SWspan *span, GLenum newType, GLuint output)
|
|||
span->end, span->array->mask);
|
||||
|
||||
span->array->ChanType = newType;
|
||||
span->array->rgba = dst;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1234,7 +1235,8 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span)
|
|||
const GLbitfield origInterpMask = span->interpMask;
|
||||
const GLbitfield origArrayMask = span->arrayMask;
|
||||
const GLbitfield origArrayAttribs = span->arrayAttribs;
|
||||
const GLenum chanType = span->array->ChanType;
|
||||
const GLenum origChanType = span->array->ChanType;
|
||||
void * const origRgba = span->array->rgba;
|
||||
const GLboolean shader = (ctx->FragmentProgram._Current
|
||||
|| ctx->ATIFragmentShader._Enabled);
|
||||
const GLboolean shaderOrTexture = shader || ctx->Texture._EnabledUnits;
|
||||
|
|
@ -1456,7 +1458,8 @@ end:
|
|||
span->interpMask = origInterpMask;
|
||||
span->arrayMask = origArrayMask;
|
||||
span->arrayAttribs = origArrayAttribs;
|
||||
span->array->ChanType = chanType;
|
||||
span->array->ChanType = origChanType;
|
||||
span->array->rgba = origRgba;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -153,16 +153,13 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
|
|||
zoomed.end = zoomedWidth;
|
||||
zoomed.array = &zoomed_arrays;
|
||||
zoomed_arrays.ChanType = span->array->ChanType;
|
||||
/* XXX temporary */
|
||||
#if CHAN_TYPE == GL_UNSIGNED_BYTE
|
||||
zoomed_arrays.rgba = zoomed_arrays.rgba8;
|
||||
#elif CHAN_TYPE == GL_UNSIGNED_SHORT
|
||||
zoomed_arrays.rgba = zoomed_arrays.rgba16;
|
||||
#else
|
||||
zoomed_arrays.rgba = zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
|
||||
#endif
|
||||
if (zoomed_arrays.ChanType == GL_UNSIGNED_BYTE)
|
||||
zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba8;
|
||||
else if (zoomed_arrays.ChanType == GL_UNSIGNED_SHORT)
|
||||
zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.rgba16;
|
||||
else
|
||||
zoomed_arrays.rgba = (GLchan (*)[4]) zoomed_arrays.attribs[FRAG_ATTRIB_COL0];
|
||||
|
||||
/* copy attribute info (XXX copy all attribs?) */
|
||||
COPY_4V(zoomed.attrStart[FRAG_ATTRIB_WPOS], span->attrStart[FRAG_ATTRIB_WPOS]);
|
||||
COPY_4V(zoomed.attrStepX[FRAG_ATTRIB_WPOS], span->attrStepX[FRAG_ATTRIB_WPOS]);
|
||||
COPY_4V(zoomed.attrStepY[FRAG_ATTRIB_WPOS], span->attrStepY[FRAG_ATTRIB_WPOS]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue