Luis C. Busquets Pérez : d3dx9: Implementation of D3DXGetVertexShaderProfile.

Alexandre Julliard julliard at winehq.org
Mon Aug 4 08:53:59 CDT 2008


Module: wine
Branch: master
Commit: 9b572170da5f35a80c6bb07ab8ebcda7a854f27f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9b572170da5f35a80c6bb07ab8ebcda7a854f27f

Author: Luis C. Busquets Pérez <luis.busquets at ilidium.com>
Date:   Fri Aug  1 21:19:11 2008 +0200

d3dx9: Implementation of D3DXGetVertexShaderProfile.

---

 dlls/d3dx9_36/d3dx9_36.spec |    2 +-
 dlls/d3dx9_36/shader.c      |   29 +++++++++++++++++++++++++++++
 include/d3dx9shader.h       |    1 +
 3 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx9_36/d3dx9_36.spec b/dlls/d3dx9_36/d3dx9_36.spec
index 95e9c26..a2dab96 100644
--- a/dlls/d3dx9_36/d3dx9_36.spec
+++ b/dlls/d3dx9_36/d3dx9_36.spec
@@ -164,7 +164,7 @@
 @ stub D3DXGetShaderSamplers
 @ stdcall D3DXGetShaderSize(ptr)
 @ stdcall D3DXGetShaderVersion(ptr)
-@ stub D3DXGetVertexShaderProfile
+@ stdcall D3DXGetVertexShaderProfile(ptr)
 @ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersect
 @ stdcall D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersectSubset
 @ stdcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersectTri
diff --git a/dlls/d3dx9_36/shader.c b/dlls/d3dx9_36/shader.c
index f4a2ce9..a84287f 100644
--- a/dlls/d3dx9_36/shader.c
+++ b/dlls/d3dx9_36/shader.c
@@ -102,3 +102,32 @@ DWORD WINAPI D3DXGetShaderVersion(const DWORD *byte_code)
 
     return byte_code ? *byte_code : 0;
 }
+
+LPCSTR WINAPI D3DXGetVertexShaderProfile(LPDIRECT3DDEVICE9 device)
+{
+    D3DCAPS9 caps;
+
+    TRACE("(void): relay\n");
+
+    if (!device) return NULL;
+
+    IDirect3DDevice9_GetDeviceCaps(device,&caps);
+
+    switch (caps.VertexShaderVersion)
+    {
+    case D3DVS_VERSION(1, 1):
+        return "vs_1_1";
+    case D3DVS_VERSION(2, 0):
+        if ((caps.VS20Caps.NumTemps>=13) &&
+            (caps.VS20Caps.DynamicFlowControlDepth=24) &&
+            (caps.VS20Caps.Caps&D3DPS20CAPS_PREDICATION))
+        {
+            return "vs_2_a";
+        }
+        return "vs_2_0";
+    case D3DVS_VERSION(3, 0):
+        return "vs_3_0";
+    }
+
+    return NULL;
+}
diff --git a/include/d3dx9shader.h b/include/d3dx9shader.h
index 38ca97d..0e629d9 100644
--- a/include/d3dx9shader.h
+++ b/include/d3dx9shader.h
@@ -28,6 +28,7 @@ extern "C" {
 LPCSTR WINAPI D3DXGetPixelShaderProfile(LPDIRECT3DDEVICE9 device);
 UINT WINAPI D3DXGetShaderSize(const DWORD *byte_code);
 DWORD WINAPI D3DXGetShaderVersion(const DWORD *byte_code);
+LPCSTR WINAPI D3DXGetVertexShaderProfile(LPDIRECT3DDEVICE9 device);
 
 #ifdef __cplusplus
 }




More information about the wine-cvs mailing list