[PATCH v2 3/6] d3d9: Use wined3d_stateblock_get_state() in d3d9_device_GetRenderState(). (original) (raw)

Zebediah Figura z.figura12 at gmail.com
Tue Dec 10 12:13:14 CST 2019


On 12/10/19 2:34 AM, Matteo Bruni wrote:

On Thu, Nov 28, 2019 at 6:54 AM Zebediah Figura <z.figura12 at gmail.com> wrote:

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com> --- dlls/d3d9/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 2d66c569938..51b7f4d6f59 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -2329,6 +2329,7 @@ static HRESULT WINAPI d3d9deviceGetRenderState(IDirect3DDevice9Ex *iface, D3DRENDERSTATETYPE state, DWORD *value) { struct d3d9device *device = implfromIDirect3DDevice9Ex(iface); + const struct wined3dstateblockstate *devicestate; struct wined3dcolor factor; TRACE("iface %p, state %#x, value %p.\n", iface, state, value); @@ -2344,7 +2345,8 @@ static HRESULT WINAPI d3d9deviceGetRenderState(IDirect3DDevice9Ex *iface, } wined3dmutexlock(); - *value = wined3ddevicegetrenderstate(device->wined3ddevice, state); + devicestate = wined3dstateblockgetstate(device->state); + *value = devicestate->rs[state]; wined3dmutexunlock(); return D3DOK; Just a couple of comments WRT potential future improvements. Obviously they apply to the other d3d* versions too. The state for the stateblock isn't going to change from underneath so it could be stored in the d3d9 device once and for all instead of getting it from wined3d every time it's needed. It doesn't matter a lot I guess (and it's certainly not urgent anyway), especially for those Get*() methods, but it would be one less inter-module function call per API call.

Good point, thanks. I hadn't thought of that.



More information about the wine-devel mailing list