From 0d230eb447dfeef7ce1eb233c0c56a4e917eeeac Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 13 Dec 2018 13:36:27 +0100 Subject: [PATCH] [spirv] Add OpArrayLength instruction --- src/spirv/spirv_module.cpp | 15 +++++++++++++++ src/spirv/spirv_module.h | 5 +++++ 2 files changed, 20 insertions(+) diff --git a/src/spirv/spirv_module.cpp b/src/spirv/spirv_module.cpp index 5515a3fd0..8aad4f52f 100644 --- a/src/spirv/spirv_module.cpp +++ b/src/spirv/spirv_module.cpp @@ -755,6 +755,21 @@ namespace dxvk { m_code.putInt32(indexArray[i]); return resultId; } + + + uint32_t SpirvModule::opArrayLength( + uint32_t resultType, + uint32_t structure, + uint32_t memberId) { + uint32_t resultId = this->allocateId(); + + m_code.putIns (spv::OpArrayLength, 5); + m_code.putWord(resultType); + m_code.putWord(resultId); + m_code.putWord(structure); + m_code.putWord(memberId); + return resultId; + } uint32_t SpirvModule::opAny( diff --git a/src/spirv/spirv_module.h b/src/spirv/spirv_module.h index da86ef905..0569030c6 100644 --- a/src/spirv/spirv_module.h +++ b/src/spirv/spirv_module.h @@ -308,6 +308,11 @@ namespace dxvk { uint32_t indexCount, const uint32_t* indexArray); + uint32_t opArrayLength( + uint32_t resultType, + uint32_t structure, + uint32_t memberId); + uint32_t opAny( uint32_t resultType, uint32_t vector);