diff --git a/src/spirv/spirv_module.cpp b/src/spirv/spirv_module.cpp index 4d44e51a7..4d763eea1 100644 --- a/src/spirv/spirv_module.cpp +++ b/src/spirv/spirv_module.cpp @@ -354,6 +354,13 @@ namespace dxvk { } + uint32_t SpirvModule::constUndef( + uint32_t typeId) { + return this->defConst(spv::OpUndef, + typeId, 0, nullptr); + } + + uint32_t SpirvModule::specConstBool( bool v) { uint32_t typeId = this->defBoolType(); @@ -767,8 +774,8 @@ namespace dxvk { void SpirvModule::functionEnd() { m_code.putIns (spv::OpFunctionEnd, 1); } - - + + uint32_t SpirvModule::opAccessChain( uint32_t resultType, uint32_t composite, @@ -3059,24 +3066,30 @@ namespace dxvk { } - uint32_t SpirvModule::opGroupNonUniformLogicalAnd( + uint32_t SpirvModule::opGroupNonUniformElect( uint32_t resultType, - uint32_t execution, - uint32_t operation, - uint32_t value, - uint32_t clusterSize) { + uint32_t execution) { uint32_t resultId = this->allocateId(); - m_code.putIns(spv::OpGroupNonUniformLogicalAnd, - 6 + (clusterSize ? 1 : 0)); + m_code.putIns(spv::OpGroupNonUniformElect, 4); m_code.putWord(resultType); m_code.putWord(resultId); m_code.putWord(execution); - m_code.putWord(operation); - m_code.putWord(value); + return resultId; + } - if (clusterSize) - m_code.putWord(clusterSize); + + uint32_t SpirvModule::opGroupNonUniformBroadcastFirst( + uint32_t resultType, + uint32_t execution, + uint32_t value) { + uint32_t resultId = this->allocateId(); + + m_code.putIns(spv::OpGroupNonUniformBroadcastFirst, 5); + m_code.putWord(resultType); + m_code.putWord(resultId); + m_code.putWord(execution); + m_code.putWord(value); return resultId; } diff --git a/src/spirv/spirv_module.h b/src/spirv/spirv_module.h index 79cc1e4ea..6776f8a5f 100644 --- a/src/spirv/spirv_module.h +++ b/src/spirv/spirv_module.h @@ -164,6 +164,9 @@ namespace dxvk { uint32_t constCount, const uint32_t* constIds); + uint32_t constUndef( + uint32_t typeId); + uint32_t specConstBool( bool v); @@ -310,7 +313,7 @@ namespace dxvk { uint32_t parameterType); void functionEnd(); - + uint32_t opAccessChain( uint32_t resultType, uint32_t composite, @@ -1053,12 +1056,14 @@ namespace dxvk { uint32_t operation, uint32_t ballot); - uint32_t opGroupNonUniformLogicalAnd( + uint32_t opGroupNonUniformElect( + uint32_t resultType, + uint32_t execution); + + uint32_t opGroupNonUniformBroadcastFirst( uint32_t resultType, uint32_t execution, - uint32_t operation, - uint32_t value, - uint32_t clusterSize); + uint32_t value); void opControlBarrier( uint32_t execution,