[dxbc] Add new emitNewSpecConstant method

Convenience method to declare new specialization constants.
This commit is contained in:
Philip Rebohle 2019-04-30 21:05:46 +02:00
parent a340b3101c
commit 7111af423d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 20 additions and 0 deletions

View File

@ -5427,6 +5427,20 @@ namespace dxvk {
}
uint32_t DxbcCompiler::emitNewSpecConstant(
DxvkSpecConstantId specId,
DxbcScalarType type,
uint32_t value,
const char* name) {
uint32_t id = m_module.specConst32(
getScalarTypeId(type), value);
m_module.decorateSpecId(id, uint32_t(specId));
m_module.setDebugName(id, name);
return id;
}
DxbcRegisterValue DxbcCompiler::getSpecConstant(DxvkSpecConstantId specId) {
const uint32_t specIdOffset = uint32_t(specId) - uint32_t(DxvkSpecConstantId::SpecConstantIdMin);

View File

@ -986,6 +986,12 @@ namespace dxvk {
////////////////////////////////////////
// Spec constant declaration and access
uint32_t emitNewSpecConstant(
DxvkSpecConstantId specId,
DxbcScalarType type,
uint32_t value,
const char* name);
DxbcRegisterValue getSpecConstant(
DxvkSpecConstantId specId);