[spirv] Add support for 32-bit specialization constants

This commit is contained in:
Philip Rebohle 2018-05-26 13:52:33 +02:00
parent b78130defd
commit 27816b470a
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 17 additions and 0 deletions

View File

@ -340,6 +340,19 @@ namespace dxvk {
}
uint32_t SpirvModule::specConst32(
uint32_t typeId,
uint32_t value) {
uint32_t resultId = this->allocateId();
m_typeConstDefs.putIns (spv::OpSpecConstant, 4);
m_typeConstDefs.putWord (typeId);
m_typeConstDefs.putWord (resultId);
m_typeConstDefs.putWord (value);
return resultId;
}
void SpirvModule::decorate(
uint32_t object,
spv::Decoration decoration) {

View File

@ -158,6 +158,10 @@ namespace dxvk {
uint32_t specConstBool(
bool v);
uint32_t specConst32(
uint32_t typeId,
uint32_t value);
void decorate(
uint32_t object,
spv::Decoration decoration);