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>2022-09-16 18:10:01 +0300
committerPhilip Rebohle <philip.rebohle@tu-dortmund.de>2022-09-16 18:24:48 +0300
commit2bd8797b168b99edf66a5b73de95dce6ec4c7028 (patch)
treed94bd5eb89406ff8cb9dab5f2e7c2893bfb760c0
parent0c2474b21070cdc38836163e50a4c4ab80c2d1b3 (diff)
[dxbc] Write point size in vertex shadersdxbc-cleanup-output
Silences some validation errors when point rendering is enabled.
-rw-r--r--src/dxbc/dxbc_compiler.cpp14
-rw-r--r--src/dxbc/dxbc_compiler.h8
2 files changed, 20 insertions, 2 deletions
diff --git a/src/dxbc/dxbc_compiler.cpp b/src/dxbc/dxbc_compiler.cpp
index b0e59ede..5d31f943 100644
--- a/src/dxbc/dxbc_compiler.cpp
+++ b/src/dxbc/dxbc_compiler.cpp
@@ -6634,6 +6634,19 @@ namespace dxvk {
}
+ void DxbcCompiler::emitPointSizeStore() {
+ if (!m_pointSizeOut) {
+ m_pointSizeOut = emitNewBuiltinVariable(DxbcRegisterInfo {
+ { DxbcScalarType::Float32, 1, 0 },
+ spv::StorageClassOutput },
+ spv::BuiltInPointSize,
+ "point_size");
+ }
+
+ m_module.opStore(m_pointSizeOut, m_module.constf32(1.0f));
+ }
+
+
void DxbcCompiler::emitInit() {
// Set up common capabilities for all shaders
m_module.enableCapability(spv::CapabilityShader);
@@ -6873,6 +6886,7 @@ namespace dxvk {
this->emitOutputSetup();
this->emitClipCullStore(DxbcSystemValue::ClipDistance, m_clipDistances);
this->emitClipCullStore(DxbcSystemValue::CullDistance, m_cullDistances);
+ this->emitPointSizeStore();
this->emitFunctionEnd();
}
diff --git a/src/dxbc/dxbc_compiler.h b/src/dxbc/dxbc_compiler.h
index 96121924..03ddf7ad 100644
--- a/src/dxbc/dxbc_compiler.h
+++ b/src/dxbc/dxbc_compiler.h
@@ -484,7 +484,9 @@ namespace dxvk {
uint32_t m_primitiveIdIn = 0;
uint32_t m_primitiveIdOut = 0;
-
+
+ uint32_t m_pointSizeOut = 0;
+
//////////////////////////////////////////////////
// Immediate constant buffer. If defined, this is
// an array of four-component uint32 vectors.
@@ -1077,7 +1079,9 @@ namespace dxvk {
void emitClipCullLoad(
DxbcSystemValue sv,
uint32_t srcArray);
-
+
+ void emitPointSizeStore();
+
//////////////////////////////////////
// Common function definition methods
void emitInit();