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-01 17:26:56 +0300
committerPhilip Rebohle <philip.rebohle@tu-dortmund.de>2023-08-01 17:27:23 +0300
commit007e9f4c89a61ccd05b312145bc03aaf7a91665f (patch)
tree7704457aa3714ab2159d19045b3529cb402ccbe7
parent9b019d26accf9053240d1e88691f0c3275bcee49 (diff)
[dxvk] Check whether fragment shader exports sample mask
-rw-r--r--src/dxvk/dxvk_shader.cpp10
-rw-r--r--src/dxvk/dxvk_shader.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/dxvk/dxvk_shader.cpp b/src/dxvk/dxvk_shader.cpp
index 88073766..3208c008 100644
--- a/src/dxvk/dxvk_shader.cpp
+++ b/src/dxvk/dxvk_shader.cpp
@@ -77,6 +77,7 @@ namespace dxvk {
// info that we may need during pipeline compilation.
std::vector<BindingOffsets> bindingOffsets;
std::vector<uint32_t> varIds;
+ std::vector<uint32_t> sampleMaskIds;
SpirvCodeBuffer code = std::move(spirv);
uint32_t o1VarId = 0;
@@ -92,6 +93,8 @@ namespace dxvk {
}
if (ins.arg(2) == spv::DecorationBuiltIn) {
+ if (ins.arg(3) == spv::BuiltInSampleMask)
+ sampleMaskIds.push_back(ins.arg(1));
if (ins.arg(3) == spv::BuiltInPosition)
m_flags.set(DxvkShaderFlag::ExportsPosition);
}
@@ -146,6 +149,13 @@ namespace dxvk {
m_flags.set(DxvkShaderFlag::UsesFragmentCoverage);
}
+ if (ins.opCode() == spv::OpVariable) {
+ if (ins.arg(3) == spv::StorageClassOutput) {
+ if (std::find(sampleMaskIds.begin(), sampleMaskIds.end(), ins.arg(2)) != sampleMaskIds.end())
+ m_flags.set(DxvkShaderFlag::ExportsSampleMask);
+ }
+ }
+
// Ignore the actual shader code, there's nothing interesting for us in there.
if (ins.opCode() == spv::OpFunction)
break;
diff --git a/src/dxvk/dxvk_shader.h b/src/dxvk/dxvk_shader.h
index bb962a2b..e3c0d8b7 100644
--- a/src/dxvk/dxvk_shader.h
+++ b/src/dxvk/dxvk_shader.h
@@ -30,6 +30,7 @@ namespace dxvk {
ExportsPosition,
ExportsStencilRef,
ExportsViewportIndexLayerFromVertexStage,
+ ExportsSampleMask,
UsesFragmentCoverage,
UsesSparseResidency,
};