Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/doitsujin/dxvk.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Rebohle <philip.rebohle@tu-dortmund.de>2023-08-23 17:36:13 +0300
committerPhilip Rebohle <philip.rebohle@tu-dortmund.de>2023-08-24 14:12:07 +0300
commit92dc61f161939535c8984ef8a33b393a0e51dcdf (patch)
tree6e8822c9c7cd5b544b6754991fa3b0cb542043f1
parent6a5ed02db33cd9b5b8166c1679b14f85c9648281 (diff)
[d3d11] Fix up UAV clears for A8_UNORMmaintenance5
-rw-r--r--src/d3d11/d3d11_context.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/d3d11/d3d11_context.cpp b/src/d3d11/d3d11_context.cpp
index 21468988..977a403e 100644
--- a/src/d3d11/d3d11_context.cpp
+++ b/src/d3d11/d3d11_context.cpp
@@ -406,15 +406,22 @@ namespace dxvk {
VkClearValue clearValue;
- // R11G11B10 is a special case since there's no corresponding
- // integer format with the same bit layout. Use R32 instead.
- if (uavFormat == VK_FORMAT_B10G11R11_UFLOAT_PACK32) {
+ if (uavDesc.Format == DXGI_FORMAT_R11G11B10_FLOAT) {
+ // R11G11B10 is a special case since there's no corresponding
+ // integer format with the same bit layout. Use R32 instead.
clearValue.color.uint32[0] = ((Values[0] & 0x7FF) << 0)
| ((Values[1] & 0x7FF) << 11)
| ((Values[2] & 0x3FF) << 22);
clearValue.color.uint32[1] = 0;
clearValue.color.uint32[2] = 0;
clearValue.color.uint32[3] = 0;
+ } else if (uavDesc.Format == DXGI_FORMAT_A8_UNORM) {
+ // We need to use R8_UINT to clear A8_UNORM images,
+ // so remap the alpha component to the red channel.
+ clearValue.color.uint32[0] = Values[3];
+ clearValue.color.uint32[1] = 0;
+ clearValue.color.uint32[2] = 0;
+ clearValue.color.uint32[3] = 0;
} else {
clearValue.color.uint32[0] = Values[0];
clearValue.color.uint32[1] = Values[1];