mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[dxbc] Add new emitNewSpecConstant method
Convenience method to declare new specialization constants.
This commit is contained in:
parent
a340b3101c
commit
7111af423d
@ -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) {
|
DxbcRegisterValue DxbcCompiler::getSpecConstant(DxvkSpecConstantId specId) {
|
||||||
const uint32_t specIdOffset = uint32_t(specId) - uint32_t(DxvkSpecConstantId::SpecConstantIdMin);
|
const uint32_t specIdOffset = uint32_t(specId) - uint32_t(DxvkSpecConstantId::SpecConstantIdMin);
|
||||||
|
|
||||||
|
@ -986,6 +986,12 @@ namespace dxvk {
|
|||||||
|
|
||||||
////////////////////////////////////////
|
////////////////////////////////////////
|
||||||
// Spec constant declaration and access
|
// Spec constant declaration and access
|
||||||
|
uint32_t emitNewSpecConstant(
|
||||||
|
DxvkSpecConstantId specId,
|
||||||
|
DxbcScalarType type,
|
||||||
|
uint32_t value,
|
||||||
|
const char* name);
|
||||||
|
|
||||||
DxbcRegisterValue getSpecConstant(
|
DxbcRegisterValue getSpecConstant(
|
||||||
DxvkSpecConstantId specId);
|
DxvkSpecConstantId specId);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user