From 3e3c31f3652725376fd12f557e13e9adef4d7fe7 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 16 Nov 2018 19:47:06 +0100 Subject: [PATCH] [spirv] Add support for Index decoration Needed for dual-source blending --- src/spirv/spirv_module.cpp | 10 ++++++++++ src/spirv/spirv_module.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/src/spirv/spirv_module.cpp b/src/spirv/spirv_module.cpp index 0f63facb..bea4f538 100644 --- a/src/spirv/spirv_module.cpp +++ b/src/spirv/spirv_module.cpp @@ -419,6 +419,16 @@ namespace dxvk { } + void SpirvModule::decorateIndex( + uint32_t object, + uint32_t index) { + m_annotations.putIns (spv::OpDecorate, 4); + m_annotations.putWord (object); + m_annotations.putWord (spv::DecorationIndex); + m_annotations.putInt32(index); + } + + void SpirvModule::decorateLocation( uint32_t object, uint32_t location) { diff --git a/src/spirv/spirv_module.h b/src/spirv/spirv_module.h index 36f0fdd2..22fc76ea 100644 --- a/src/spirv/spirv_module.h +++ b/src/spirv/spirv_module.h @@ -189,6 +189,10 @@ namespace dxvk { uint32_t object, uint32_t set); + void decorateIndex( + uint32_t object, + uint32_t index); + void decorateLocation( uint32_t object, uint32_t location);