1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 10:24:12 +01:00

[d3d11] Implemented ClearUnorderedAccessViewUint for images

This commit is contained in:
Philip Rebohle 2018-02-04 23:57:43 +01:00
parent fc947f5985
commit e25f4b2299
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 18 additions and 3 deletions

View File

@ -85,8 +85,6 @@ namespace dxvk {
mode.alphaSrcFactor = DecodeBlendFactor(BlendDesc.SrcBlendAlpha, true);
mode.alphaDstFactor = DecodeBlendFactor(BlendDesc.DestBlendAlpha, true);
mode.alphaBlendOp = DecodeBlendOp(BlendDesc.BlendOpAlpha);
// TODO find out if D3D11 wants us to apply the write mask if blending
// is disabled as well. This is standard behaviour in Vulkan.
mode.writeMask = BlendDesc.RenderTargetWriteMask;
return mode;
}

View File

@ -466,7 +466,24 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeviceContext::ClearUnorderedAccessViewUint(
ID3D11UnorderedAccessView* pUnorderedAccessView,
const UINT Values[4]) {
Logger::err("D3D11DeviceContext::ClearUnorderedAccessViewUint: Not implemented");
auto uav = static_cast<D3D11UnorderedAccessView*>(pUnorderedAccessView);
if (uav->GetResourceType() == D3D11_RESOURCE_DIMENSION_BUFFER) {
Logger::err("D3D11: ClearUnorderedAccessViewUint: Not supported for buffers");
} else {
VkClearColorValue clearValue;
for (uint32_t i = 0; i < 4; i++)
clearValue.uint32[i] = Values[i];
EmitCs([
cClearValue = clearValue,
cDstView = uav->GetImageView()
] (DxvkContext* ctx) {
ctx->clearColorImage(cDstView->image(),
cClearValue, cDstView->subresources());
});
}
}