1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-01-18 20:52:10 +01:00

[d3d11] Catch invalid ClearUnorderedAccessViewFloat calls

This method cannot be called on integer UAVs.
This commit is contained in:
Philip Rebohle 2019-07-17 11:45:39 +02:00
parent b20ceec727
commit 11b7fc8914
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -838,6 +838,16 @@ namespace dxvk {
if (!uav)
return;
auto imgView = uav->GetImageView();
auto bufView = uav->GetBufferView();
const DxvkFormatInfo* info = nullptr;
if (imgView != nullptr) info = imgView->formatInfo();
if (bufView != nullptr) info = bufView->formatInfo();
if (!info || info->flags.any(DxvkFormatFlag::SampledSInt, DxvkFormatFlag::SampledUInt))
return;
VkClearValue clearValue;
clearValue.color.float32[0] = Values[0];
clearValue.color.float32[1] = Values[1];
@ -847,7 +857,7 @@ namespace dxvk {
if (uav->GetResourceType() == D3D11_RESOURCE_DIMENSION_BUFFER) {
EmitCs([
cClearValue = clearValue,
cDstView = uav->GetBufferView()
cDstView = std::move(bufView)
] (DxvkContext* ctx) {
ctx->clearBufferView(
cDstView, 0,
@ -857,7 +867,7 @@ namespace dxvk {
} else {
EmitCs([
cClearValue = clearValue,
cDstView = uav->GetImageView()
cDstView = std::move(imgView)
] (DxvkContext* ctx) {
ctx->clearImageView(cDstView,
VkOffset3D { 0, 0, 0 },