wined3d: Fix glBlendColorEXT for use on RivaTNT.

This commit is contained in:
Roderick Colenbrander 2008-01-12 23:32:24 +00:00 committed by Alexandre Julliard
parent be853b6f4f
commit 916b56391d
3 changed files with 16 additions and 5 deletions

View File

@ -83,6 +83,7 @@ static const struct {
{"GL_ARB_shader_objects", ARB_SHADER_OBJECTS, 0 },
/* EXT */
{"GL_EXT_blend_color", EXT_BLEND_COLOR, 0 },
{"GL_EXT_blend_minmax", EXT_BLEND_MINMAX, 0 },
{"GL_EXT_fog_coord", EXT_FOG_COORD, 0 },
{"GL_EXT_framebuffer_blit", EXT_FRAMEBUFFER_BLIT, 0 },
@ -2224,8 +2225,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
WINED3DPCMPCAPS_NEVER |
WINED3DPCMPCAPS_NOTEQUAL;
*pCaps->SrcBlendCaps = WINED3DPBLENDCAPS_BLENDFACTOR |
WINED3DPBLENDCAPS_BOTHINVSRCALPHA |
*pCaps->SrcBlendCaps = WINED3DPBLENDCAPS_BOTHINVSRCALPHA |
WINED3DPBLENDCAPS_BOTHSRCALPHA |
WINED3DPBLENDCAPS_DESTALPHA |
WINED3DPBLENDCAPS_DESTCOLOR |
@ -2239,8 +2239,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
WINED3DPBLENDCAPS_SRCCOLOR |
WINED3DPBLENDCAPS_ZERO;
*pCaps->DestBlendCaps = WINED3DPBLENDCAPS_BLENDFACTOR |
WINED3DPBLENDCAPS_DESTALPHA |
*pCaps->DestBlendCaps = WINED3DPBLENDCAPS_DESTALPHA |
WINED3DPBLENDCAPS_DESTCOLOR |
WINED3DPBLENDCAPS_INVDESTALPHA |
WINED3DPBLENDCAPS_INVDESTCOLOR |
@ -2257,6 +2256,12 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter,
* legacy settings for srcblend only
*/
if( GL_SUPPORT(EXT_BLEND_COLOR)) {
*pCaps->SrcBlendCaps |= WINED3DPBLENDCAPS_BLENDFACTOR;
*pCaps->DestBlendCaps |= WINED3DPBLENDCAPS_BLENDFACTOR;
}
*pCaps->AlphaCmpCaps = WINED3DPCMPCAPS_ALWAYS |
WINED3DPCMPCAPS_EQUAL |
WINED3DPCMPCAPS_GREATER |

View File

@ -356,6 +356,11 @@ static void state_blend(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3D
static void state_blendfactor(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
float col[4];
if(!GL_SUPPORT(EXT_BLEND_COLOR)) {
WARN("Unsupported in local OpenGL implementation: glBlendColorEXT\n");
return;
}
TRACE("Setting BlendFactor to %d\n", stateblock->renderState[WINED3DRS_BLENDFACTOR]);
D3DCOLORTOGLFLOAT4(stateblock->renderState[WINED3DRS_BLENDFACTOR], col);
GL_EXTCALL(glBlendColorEXT (col[0],col[1],col[2],col[3]));

View File

@ -3188,6 +3188,7 @@ typedef enum _GL_SupportedExt {
ARB_VERTEX_SHADER,
ARB_SHADER_OBJECTS,
/* EXT */
EXT_BLEND_COLOR,
EXT_BLEND_MINMAX,
EXT_FOG_COORD,
EXT_FRAMEBUFFER_OBJECT,
@ -3257,7 +3258,7 @@ typedef enum _GL_SupportedExt {
/* GL_ARB_draw_buffers */ \
USE_GL_FUNC(PGLFNDRAWBUFFERSARBPROC, glDrawBuffersARB, ARB_DRAW_BUFFERS, NULL );\
/* GL_ARB_imaging, GL_EXT_blend_minmax */ \
USE_GL_FUNC(PGLFNBLENDCOLORPROC, glBlendColorEXT, EXT_BLEND_MINMAX, NULL );\
USE_GL_FUNC(PGLFNBLENDCOLORPROC, glBlendColorEXT, EXT_BLEND_COLOR, NULL );\
USE_GL_FUNC(PGLFNBLENDEQUATIONPROC, glBlendEquationEXT, EXT_BLEND_MINMAX, NULL );\
/* GL_ARB_multisample */ \
USE_GL_FUNC(WINED3D_PFNGLSAMPLECOVERAGEARBPROC, glSampleCoverageARB, ARB_MULTISAMPLE, NULL );\