Commit be4a332e authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 671f6b2a
......@@ -3890,14 +3890,20 @@ void main(point float4 vin[1] : POSITION, inout TriangleStream<gs_out> vout)
refcount = ID3D10VertexShader_Release(vs);
ok(!refcount, "Vertex shader has %u references left.\n", refcount);
vs = (void *)0xdeadbeef;
hr = ID3D10Device_CreateVertexShader(device, vs_2_0, sizeof(vs_2_0), &vs);
ok(hr == E_INVALIDARG, "Created a SM2 vertex shader, hr %#x\n", hr);
ok(!vs, "Unexpected pointer %p.\n", vs);
vs = (void *)0xdeadbeef;
hr = ID3D10Device_CreateVertexShader(device, vs_3_0, sizeof(vs_3_0), &vs);
ok(hr == E_INVALIDARG, "Created a SM3 vertex shader, hr %#x\n", hr);
ok(!vs, "Unexpected pointer %p.\n", vs);
vs = (void *)0xdeadbeef;
hr = ID3D10Device_CreateVertexShader(device, ps_4_0, sizeof(ps_4_0), &vs);
ok(hr == E_INVALIDARG, "Created a SM4 vertex shader from a pixel shader source, hr %#x\n", hr);
ok(!vs, "Unexpected pointer %p.\n", vs);
/* pixel shader */
expected_refcount = get_refcount(device) + 1;
......
......@@ -3469,6 +3469,8 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateVertexShader(ID3D11Device2 *
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);
*shader = NULL;
if (class_linkage)
FIXME("Class linkage is not implemented yet.\n");
......@@ -6176,6 +6178,8 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateVertexShader(ID3D10Device1 *
TRACE("iface %p, byte_code %p, byte_code_length %Iu, shader %p.\n",
iface, byte_code, byte_code_length, shader);
*shader = NULL;
if (FAILED(hr = d3d_vertex_shader_create(device, byte_code, byte_code_length, &object)))
return hr;
......
......@@ -4849,14 +4849,20 @@ static void test_create_shader(const D3D_FEATURE_LEVEL feature_level)
ID3D11PixelShader_Release(ps);
/* vertex shader */
vs = (void *)0xdeadbeef;
hr = ID3D11Device_CreateVertexShader(device, vs_2_0, sizeof(vs_2_0), NULL, &vs);
ok(hr == E_INVALIDARG, "Feature level %#x: Got unexpected hr %#lx.\n", feature_level, hr);
ok(!vs, "Unexpected pointer %p.\n", vs);
vs = (void *)0xdeadbeef;
hr = ID3D11Device_CreateVertexShader(device, vs_3_0, sizeof(vs_3_0), NULL, &vs);
ok(hr == E_INVALIDARG, "Feature level %#x: Got unexpected hr %#lx.\n", feature_level, hr);
ok(!vs, "Unexpected pointer %p.\n", vs);
vs = (void *)0xdeadbeef;
hr = ID3D11Device_CreateVertexShader(device, ps_4_0, sizeof(ps_4_0), NULL, &vs);
ok(hr == E_INVALIDARG, "Feature level %#x: Got unexpected hr %#lx.\n", feature_level, hr);
ok(!vs, "Unexpected pointer %p.\n", vs);
expected_refcount = get_refcount(device) + (feature_level >= D3D_FEATURE_LEVEL_10_0);
hr = ID3D11Device_CreateVertexShader(device, vs_4_0, sizeof(vs_4_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