1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 22:08:59 +01:00

[dxvk] Don't use pipeline libraries for VS that doesn't export position

This commit is contained in:
Philip Rebohle 2022-08-06 02:09:55 +02:00
parent 3aa786fb6f
commit 4d9c09b5e7
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 11 additions and 0 deletions

View File

@ -89,6 +89,11 @@ namespace dxvk {
varIds.push_back(varId);
}
if (ins.arg(2) == spv::DecorationBuiltIn) {
if (ins.arg(3) == spv::BuiltInPosition)
m_flags.set(DxvkShaderFlag::ExportsPosition);
}
if (ins.arg(2) == spv::DecorationDescriptorSet) {
uint32_t varId = ins.arg(1);
bindingOffsets.resize(std::max(bindingOffsets.size(), size_t(varId + 1)));
@ -190,6 +195,11 @@ namespace dxvk {
&& m_info.stage != VK_SHADER_STAGE_COMPUTE_BIT)
return false;
// Standalone vertex shaders must export vertex position
if (m_info.stage == VK_SHADER_STAGE_VERTEX_BIT
&& !m_flags.test(DxvkShaderFlag::ExportsPosition))
return false;
// Ignore shaders that have user-defined spec constants
// and no selector to read their contents from elsewhere
return !m_specConstantMask || (m_specConstantMask & (1u << MaxNumSpecConstants));

View File

@ -27,6 +27,7 @@ namespace dxvk {
enum DxvkShaderFlag : uint64_t {
HasSampleRateShading,
HasTransformFeedback,
ExportsPosition,
ExportsStencilRef,
ExportsViewportIndexLayerFromVertexStage,
};