Commit 3dd9a78a authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3d11: Always initialize out shader pointer in CreatePixelShader().

parent 6c818165
...@@ -3906,6 +3906,11 @@ void main(point float4 vin[1] : POSITION, inout TriangleStream<gs_out> vout) ...@@ -3906,6 +3906,11 @@ void main(point float4 vin[1] : POSITION, inout TriangleStream<gs_out> vout)
ok(!vs, "Unexpected pointer %p.\n", vs); ok(!vs, "Unexpected pointer %p.\n", vs);
/* pixel shader */ /* pixel shader */
ps = (void *)0xdeadbeef;
hr = ID3D10Device_CreatePixelShader(device, vs_2_0, sizeof(vs_2_0), &ps);
ok(hr == E_INVALIDARG, "Unexpected hr %#x.\n", hr);
ok(!ps, "Unexpected pointer %p.\n", ps);
expected_refcount = get_refcount(device) + 1; expected_refcount = get_refcount(device) + 1;
hr = ID3D10Device_CreatePixelShader(device, ps_4_0, sizeof(ps_4_0), &ps); hr = ID3D10Device_CreatePixelShader(device, ps_4_0, sizeof(ps_4_0), &ps);
ok(SUCCEEDED(hr), "Failed to create SM4 pixel shader, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to create SM4 pixel shader, hr %#x.\n", hr);
......
...@@ -3546,6 +3546,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device2 *i ...@@ -3546,6 +3546,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreatePixelShader(ID3D11Device2 *i
TRACE("iface %p, byte_code %p, byte_code_length %Iu, class_linkage %p, shader %p.\n", TRACE("iface %p, byte_code %p, byte_code_length %Iu, class_linkage %p, shader %p.\n",
iface, byte_code, byte_code_length, class_linkage, shader); iface, byte_code, byte_code_length, class_linkage, shader);
*shader = NULL;
if (class_linkage) if (class_linkage)
FIXME("Class linkage is not implemented yet.\n"); FIXME("Class linkage is not implemented yet.\n");
...@@ -6284,6 +6286,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device1 *i ...@@ -6284,6 +6286,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device1 *i
TRACE("iface %p, byte_code %p, byte_code_length %Iu, shader %p.\n", TRACE("iface %p, byte_code %p, byte_code_length %Iu, shader %p.\n",
iface, byte_code, byte_code_length, shader); iface, byte_code, byte_code_length, shader);
*shader = NULL;
if (FAILED(hr = d3d_pixel_shader_create(device, byte_code, byte_code_length, &object))) if (FAILED(hr = d3d_pixel_shader_create(device, byte_code, byte_code_length, &object)))
return hr; return hr;
......
...@@ -4848,6 +4848,11 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level) ...@@ -4848,6 +4848,11 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level)
ok(hr == S_OK, "Feature level %#x: Got unexpected hr %#lx.\n", feature_level, hr); ok(hr == S_OK, "Feature level %#x: Got unexpected hr %#lx.\n", feature_level, hr);
ID3D11PixelShader_Release(ps); ID3D11PixelShader_Release(ps);
ps = (void *)0xdeadbeef;
hr = ID3D11Device_CreatePixelShader(device, vs_2_0, sizeof(vs_2_0), NULL, &ps);
ok(hr == E_INVALIDARG, "Got unexpected hr %#lx.\n", hr);
ok(!ps, "Unexpected pointer %p.\n", ps);
/* vertex shader */ /* vertex shader */
vs = (void *)0xdeadbeef; vs = (void *)0xdeadbeef;
hr = ID3D11Device_CreateVertexShader(device, vs_2_0, sizeof(vs_2_0), NULL, &vs); hr = ID3D11Device_CreateVertexShader(device, vs_2_0, sizeof(vs_2_0), NULL, &vs);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment