Henri Verbeet : d3d10core: Implement d3d10_sampler_state_GetDesc().

Alexandre Julliard julliard at winehq.org
Wed Dec 12 15:14:54 CST 2012


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Dec 11 22:27:30 2012 +0100

d3d10core: Implement d3d10_sampler_state_GetDesc().

---

 dlls/d3d10core/d3d10core_private.h |    3 ++-
 dlls/d3d10core/device.c            |    6 ++++--
 dlls/d3d10core/state.c             |    9 +++++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/d3d10core/d3d10core_private.h b/dlls/d3d10core/d3d10core_private.h
index ffc4e34..4d643a0 100644
--- a/dlls/d3d10core/d3d10core_private.h
+++ b/dlls/d3d10core/d3d10core_private.h
@@ -248,9 +248,10 @@ struct d3d10_sampler_state
     LONG refcount;
 
     struct wined3d_sampler *wined3d_sampler;
+    D3D10_SAMPLER_DESC desc;
 };
 
-HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state) DECLSPEC_HIDDEN;
+HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, const D3D10_SAMPLER_DESC *desc) DECLSPEC_HIDDEN;
 struct d3d10_sampler_state *unsafe_impl_from_ID3D10SamplerState(ID3D10SamplerState *iface) DECLSPEC_HIDDEN;
 
 /* ID3D10Query */
diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c
index 8074380..9070d85 100644
--- a/dlls/d3d10core/device.c
+++ b/dlls/d3d10core/device.c
@@ -1476,6 +1476,9 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *i
 
     TRACE("iface %p, desc %p, sampler_state %p.\n", iface, desc, sampler_state);
 
+    if (!desc)
+        return E_INVALIDARG;
+
     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
     if (!object)
     {
@@ -1483,8 +1486,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateSamplerState(ID3D10Device *i
         return E_OUTOFMEMORY;
     }
 
-    hr = d3d10_sampler_state_init(object);
-    if (FAILED(hr))
+    if (FAILED(hr = d3d10_sampler_state_init(object, desc)))
     {
         WARN("Failed to initialize sampler state, hr %#x.\n", hr);
         HeapFree(GetProcessHeap(), 0, object);
diff --git a/dlls/d3d10core/state.c b/dlls/d3d10core/state.c
index c1018f8..c086066 100644
--- a/dlls/d3d10core/state.c
+++ b/dlls/d3d10core/state.c
@@ -490,7 +490,11 @@ static HRESULT STDMETHODCALLTYPE d3d10_sampler_state_SetPrivateDataInterface(ID3
 static void STDMETHODCALLTYPE d3d10_sampler_state_GetDesc(ID3D10SamplerState *iface,
         D3D10_SAMPLER_DESC *desc)
 {
-    FIXME("iface %p, desc %p stub!\n", iface, desc);
+    struct d3d10_sampler_state *state = impl_from_ID3D10SamplerState(iface);
+
+    TRACE("iface %p, desc %p.\n", iface, desc);
+
+    *desc = state->desc;
 }
 
 static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
@@ -508,12 +512,13 @@ static const struct ID3D10SamplerStateVtbl d3d10_sampler_state_vtbl =
     d3d10_sampler_state_GetDesc,
 };
 
-HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state)
+HRESULT d3d10_sampler_state_init(struct d3d10_sampler_state *state, const D3D10_SAMPLER_DESC *desc)
 {
     HRESULT hr;
 
     state->ID3D10SamplerState_iface.lpVtbl = &d3d10_sampler_state_vtbl;
     state->refcount = 1;
+    state->desc = *desc;
 
     if (FAILED(hr = wined3d_sampler_create(state, &state->wined3d_sampler)))
     {




More information about the wine-cvs mailing list