d3d11: Implement d3d10_device_CreateGeometryShaderWithStreamOutput().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-03-31 13:11:50 +02:00 committed by Alexandre Julliard
parent a0ed4bdb1f
commit acb337492d
2 changed files with 37 additions and 6 deletions

View File

@ -9946,8 +9946,7 @@ static void test_index_buffer_offset(void)
hr = ID3D10Device_CreateGeometryShaderWithStreamOutput(device, gs_code, sizeof(gs_code),
so_declaration, sizeof(so_declaration) / sizeof(*so_declaration),
stride, &gs);
todo_wine ok(SUCCEEDED(hr), "Failed to create geometry shader with stream output, hr %#x.\n", hr);
if (FAILED(hr)) goto cleanup;
ok(SUCCEEDED(hr), "Failed to create geometry shader with stream output, hr %#x.\n", hr);
hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &vs);
ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr);
@ -9992,7 +9991,6 @@ static void test_index_buffer_offset(void)
ID3D10Buffer_Release(vb);
ID3D10VertexShader_Release(vs);
ID3D10GeometryShader_Release(gs);
cleanup:
ID3D10InputLayout_Release(input_layout);
release_test_context(&test_context);
}

View File

@ -4927,12 +4927,45 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutp
const void *byte_code, SIZE_T byte_code_length, const D3D10_SO_DECLARATION_ENTRY *output_stream_decls,
UINT output_stream_decl_count, UINT output_stream_stride, ID3D10GeometryShader **shader)
{
FIXME("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p, "
"output_stream_decl_count %u, output_stream_stride %u, shader %p stub!\n",
struct d3d_device *device = impl_from_ID3D10Device(iface);
D3D11_SO_DECLARATION_ENTRY *so_entries;
struct d3d_geometry_shader *object;
unsigned int i, stride_count = 1;
HRESULT hr;
TRACE("iface %p, byte_code %p, byte_code_length %lu, output_stream_decls %p, "
"output_stream_decl_count %u, output_stream_stride %u, shader %p.\n",
iface, byte_code, byte_code_length, output_stream_decls,
output_stream_decl_count, output_stream_stride, shader);
return E_NOTIMPL;
if (!(so_entries = d3d11_calloc(output_stream_decl_count, sizeof(*so_entries))))
{
ERR("Failed to allocate D3D11 SO declaration array memory.\n");
return E_OUTOFMEMORY;
}
for (i = 0; i < output_stream_decl_count; ++i)
{
so_entries[i].Stream = 0;
so_entries[i].SemanticName = output_stream_decls[i].SemanticName;
so_entries[i].SemanticIndex = output_stream_decls[i].SemanticIndex;
so_entries[i].StartComponent = output_stream_decls[i].StartComponent;
so_entries[i].ComponentCount = output_stream_decls[i].ComponentCount;
so_entries[i].OutputSlot = output_stream_decls[i].OutputSlot;
if (output_stream_decls[i].OutputSlot)
stride_count = 0;
}
hr = d3d_geometry_shader_create(device, byte_code, byte_code_length,
so_entries, output_stream_decl_count, &output_stream_stride, stride_count, 0, &object);
HeapFree(GetProcessHeap(), 0, so_entries);
if (FAILED(hr))
return hr;
*shader = &object->ID3D10GeometryShader_iface;
return hr;
}
static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device1 *iface,