From eba1f90ef6f4292592b75e4771eda960de19c3ff Mon Sep 17 00:00:00 2001 From: Roderick Colenbrander Date: Tue, 8 Aug 2006 17:46:03 +0200 Subject: [PATCH] wined3d: Shader declaration cap fixes. --- dlls/wined3d/directx.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index dca813e558d..9bc7e710354 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -2031,7 +2031,7 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, WINED3DVTXPCAPS_VERTEXFOG | WINED3DVTXPCAPS_TEXGEN; /* FIXME: Add - D3DVTXPCAPS_TWEENING */ + D3DVTXPCAPS_TWEENING, D3DVTXPCAPS_TEXGEN_SPHEREMAP */ *pCaps->MaxPrimitiveCount = 0xFFFFF; /* For now set 2^20-1 which is used by most >=Geforce3/Radeon8500 cards */ *pCaps->MaxVertexIndex = 0xFFFFF; @@ -2095,12 +2095,27 @@ static HRESULT WINAPI IWineD3DImpl_GetDeviceCaps(IWineD3D *iface, UINT Adapter, GLint max_buffers = 1; FIXME("Caps support for directx9 is nonexistent at the moment!\n"); *pCaps->DevCaps2 = 0; - /* TODO: D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES */ + /* TODO: D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES and VS3.0 needs atleast D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET */ *pCaps->MaxNpatchTessellationLevel = 0; *pCaps->MasterAdapterOrdinal = 0; *pCaps->AdapterOrdinalInGroup = 0; *pCaps->NumberOfAdaptersInGroup = 1; - *pCaps->DeclTypes = 0; + + if(*pCaps->VertexShaderVersion >= D3DVS_VERSION(2,0)) { + /* OpenGL supports all formats below perhaps not allways without conversion but it supports them. + Further GLSL doesn't seem to have an official unsigned type as I'm not sure how we handle it + don't advertise iet yet. We might need to add some clamping in the shader engine to support it. + TODO: D3DDTCAPS_USHORT2N, D3DDTCAPS_USHORT4N, D3DDTCAPS_UDEC3, D3DDTCAPS_DEC3N */ + *pCaps->DeclTypes = D3DDTCAPS_UBYTE4 | + D3DDTCAPS_UBYTE4N | + D3DDTCAPS_SHORT2N | + D3DDTCAPS_SHORT4N | + D3DDTCAPS_FLOAT16_2 | + D3DDTCAPS_FLOAT16_4; + + } else + *pCaps->DeclTypes = 0; + #if 0 /*FIXME: Simultaneous render targets*/ GL_MAX_DRAW_BUFFERS_ATI 0x00008824 if (GL_SUPPORT(GL_MAX_DRAW_BUFFERS_ATI)) {