d3d11: Implement UAV binding.

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 2016-11-23 14:36:06 +01:00 committed by Alexandre Julliard
parent 794d59259b
commit 35a6ca530e
3 changed files with 42 additions and 2 deletions

View File

@ -237,6 +237,8 @@ struct d3d11_unordered_access_view
HRESULT d3d11_unordered_access_view_create(struct d3d_device *device, ID3D11Resource *resource,
const D3D11_UNORDERED_ACCESS_VIEW_DESC *desc, struct d3d11_unordered_access_view **view) DECLSPEC_HIDDEN;
struct d3d11_unordered_access_view *unsafe_impl_from_ID3D11UnorderedAccessView(
ID3D11UnorderedAccessView *iface) DECLSPEC_HIDDEN;
/* ID3D11InputLayout, ID3D10InputLayout */
struct d3d_input_layout

View File

@ -634,9 +634,12 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetRenderTargetsAndUnord
UINT unordered_access_view_start_slot, UINT unordered_access_view_count,
ID3D11UnorderedAccessView *const *unordered_access_views, const UINT *initial_counts)
{
FIXME("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, "
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
unsigned int i;
TRACE("iface %p, render_target_view_count %u, render_target_views %p, depth_stencil_view %p, "
"unordered_access_view_start_slot %u, unordered_access_view_count %u, unordered_access_views %p, "
"initial_counts %p partial-stub!\n",
"initial_counts %p.\n",
iface, render_target_view_count, render_target_views, depth_stencil_view,
unordered_access_view_start_slot, unordered_access_view_count, unordered_access_views,
initial_counts);
@ -646,6 +649,32 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetRenderTargetsAndUnord
d3d11_immediate_context_OMSetRenderTargets(iface, render_target_view_count, render_target_views,
depth_stencil_view);
}
if (unordered_access_view_count != D3D11_KEEP_UNORDERED_ACCESS_VIEWS)
{
if (initial_counts)
FIXME("Ignoring initial counts.\n");
wined3d_mutex_lock();
for (i = 0; i < unordered_access_view_start_slot; ++i)
{
wined3d_device_set_unordered_access_view(device->wined3d_device, i, NULL);
}
for (i = 0; i < unordered_access_view_count; ++i)
{
struct d3d11_unordered_access_view *view
= unsafe_impl_from_ID3D11UnorderedAccessView(unordered_access_views[i]);
wined3d_device_set_unordered_access_view(device->wined3d_device,
unordered_access_view_start_slot + i,
view ? view->wined3d_view : NULL);
}
for (; unordered_access_view_start_slot + i < D3D11_PS_CS_UAV_REGISTER_COUNT; ++i)
{
wined3d_device_set_unordered_access_view(device->wined3d_device, i, NULL);
}
wined3d_mutex_unlock();
}
}
static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11DeviceContext *iface,

View File

@ -2526,3 +2526,12 @@ HRESULT d3d11_unordered_access_view_create(struct d3d_device *device, ID3D11Reso
return S_OK;
}
struct d3d11_unordered_access_view *unsafe_impl_from_ID3D11UnorderedAccessView(ID3D11UnorderedAccessView *iface)
{
if (!iface)
return NULL;
assert(iface->lpVtbl == &d3d11_unordered_access_view_vtbl);
return impl_from_ID3D11UnorderedAccessView(iface);
}