mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 13:10:10 +01:00
mesa: Convert colors if span ChanType and renderbuffer data type don't match
This is a partial revert of f9874fe. It turns out that the types
don't always match. Specifically, this can happen when doing
glCopyPixels from a float FBO to a RGBA8 FBO.
NOTE: This is a candidate for the 8.0 branch.
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45429
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
e06b1c65bc
commit
660ed923de
1 changed files with 15 additions and 4 deletions
|
|
@ -1321,12 +1321,23 @@ _swrast_write_rgba_span( struct gl_context *ctx, SWspan *span)
|
|||
if (rb) {
|
||||
GLchan rgbaSave[MAX_WIDTH][4];
|
||||
|
||||
if (span->array->ChanType == GL_UNSIGNED_BYTE) {
|
||||
span->array->rgba = span->array->rgba8;
|
||||
GLenum datatype;
|
||||
GLuint comps;
|
||||
|
||||
_mesa_format_to_type_and_comps(rb->Format, &datatype, &comps);
|
||||
|
||||
/* set span->array->rgba to colors for render buffer's datatype */
|
||||
if (datatype != span->array->ChanType) {
|
||||
convert_color_type(span, datatype, 0);
|
||||
}
|
||||
else {
|
||||
span->array->rgba = (void *)
|
||||
span->array->attribs[FRAG_ATTRIB_COL0];
|
||||
if (span->array->ChanType == GL_UNSIGNED_BYTE) {
|
||||
span->array->rgba = span->array->rgba8;
|
||||
}
|
||||
else {
|
||||
span->array->rgba = (void *)
|
||||
span->array->attribs[FRAG_ATTRIB_COL0];
|
||||
}
|
||||
}
|
||||
|
||||
if (!multiFragOutputs && numBuffers > 1) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue