Henri Verbeet : wined3d: Abort on invalid instructions in shader_get_registers_used().
Module: wine Branch: master Commit: dfe8b7798a7bb408cec72106ba18f2c6505525a4 URL: http://source.winehq.org/git/wine.git/?a=commit;h=dfe8b7798a7bb408cec72106ba... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Mar 8 10:53:06 2017 +0100 wined3d: Abort on invalid instructions in shader_get_registers_used(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/d3d9ex.c | 2 +- dlls/d3d9/tests/device.c | 2 +- dlls/wined3d/shader.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/d3d9/tests/d3d9ex.c b/dlls/d3d9/tests/d3d9ex.c index 1dbab26..a3cbdbf 100644 --- a/dlls/d3d9/tests/d3d9ex.c +++ b/dlls/d3d9/tests/d3d9ex.c @@ -2429,7 +2429,7 @@ static void test_unsupported_shaders(void) hr = IDirect3DDevice9Ex_CreatePixelShader(device, ps_3_224, &ps); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9Ex_CreatePixelShader(device, ps_2_0_boolint, &ps); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); if (ps) IDirect3DPixelShader9_Release(ps); diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 5aba575..4da1653 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -6528,7 +6528,7 @@ float4 main(const float4 color : COLOR) : SV_TARGET hr = IDirect3DDevice9_CreatePixelShader(device, ps_3_224, &ps); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_CreatePixelShader(device, ps_2_0_boolint, &ps); - todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); if (ps) IDirect3DPixelShader9_Release(ps); diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 0c617c4..9601b2d 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -933,8 +933,8 @@ static HRESULT shader_get_registers_used(struct wined3d_shader *shader, const st /* Unhandled opcode, and its parameters. */ if (ins.handler_idx == WINED3DSIH_TABLE_SIZE) { - TRACE("Skipping unrecognized instruction.\n"); - continue; + WARN("Encountered unrecognised or invalid instruction.\n"); + return WINED3DERR_INVALIDCALL; } /* Handle declarations. */
participants (1)
-
Alexandre Julliard