wined3d: Take EXT_vertex_array_bgra into account in send_attribute() and loadNumberedArrays().

This commit is contained in:
Henri Verbeet 2009-01-23 10:22:33 +01:00 committed by Alexandre Julliard
parent 2ce82aec19
commit e82eef28f9
2 changed files with 22 additions and 2 deletions

View File

@ -534,8 +534,18 @@ static inline void send_attribute(IWineD3DDeviceImpl *This, const DWORD type, co
case WINED3DDECLTYPE_UBYTE4:
GL_EXTCALL(glVertexAttrib4ubvARB(index, ptr));
break;
case WINED3DDECLTYPE_UBYTE4N:
case WINED3DDECLTYPE_D3DCOLOR:
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
{
const DWORD *src = ptr;
DWORD c = *src & 0xff00ff00;
c |= (*src & 0xff0000) >> 16;
c |= (*src & 0xff) << 16;
GL_EXTCALL(glVertexAttrib4NubvARB(index, (GLubyte *)&c));
break;
}
/* else fallthrough */
case WINED3DDECLTYPE_UBYTE4N:
GL_EXTCALL(glVertexAttrib4NubvARB(index, ptr));
break;

View File

@ -3925,8 +3925,18 @@ static inline void loadNumberedArrays(IWineD3DStateBlockImpl *stateblock,
case WINED3DDECLTYPE_UBYTE4:
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
break;
case WINED3DDECLTYPE_UBYTE4N:
case WINED3DDECLTYPE_D3DCOLOR:
if (GL_SUPPORT(EXT_VERTEX_ARRAY_BGRA))
{
const DWORD *src = (const DWORD *)ptr;
DWORD c = *src & 0xff00ff00;
c |= (*src & 0xff0000) >> 16;
c |= (*src & 0xff) << 16;
GL_EXTCALL(glVertexAttrib4NubvARB(i, (GLubyte *)&c));
break;
}
/* else fallthrough */
case WINED3DDECLTYPE_UBYTE4N:
GL_EXTCALL(glVertexAttrib4NubvARB(i, ptr));
break;