mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-07 16:54:14 +01:00
[dxbc] Remove old spec constant code
This commit is contained in:
parent
dc3cfc9fa0
commit
04e6479690
@ -44,13 +44,6 @@ namespace dxvk {
|
|||||||
m_oRegs.at(i) = DxbcRegisterPointer { };
|
m_oRegs.at(i) = DxbcRegisterPointer { };
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear spec constants
|
|
||||||
for (uint32_t i = 0; i < m_specConstants.size(); i++) {
|
|
||||||
m_specConstants.at(i) = DxbcRegisterValue {
|
|
||||||
DxbcVectorType { DxbcScalarType::Uint32, 0 },
|
|
||||||
0 };
|
|
||||||
}
|
|
||||||
|
|
||||||
this->emitInit();
|
this->emitInit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5452,43 +5445,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DxbcRegisterValue DxbcCompiler::getSpecConstant(DxvkSpecConstantId specId) {
|
|
||||||
const uint32_t specIdOffset = uint32_t(specId) - uint32_t(DxvkSpecConstantId::SpecConstantIdMin);
|
|
||||||
|
|
||||||
// Look up spec constant in the array
|
|
||||||
DxbcRegisterValue value = m_specConstants.at(specIdOffset);
|
|
||||||
|
|
||||||
if (value.id != 0)
|
|
||||||
return value;
|
|
||||||
|
|
||||||
// Declare a new specialization constant if needed
|
|
||||||
DxbcSpecConstant info = getSpecConstantProperties(specId);
|
|
||||||
|
|
||||||
value.type.ctype = info.ctype;
|
|
||||||
value.type.ccount = info.ccount;
|
|
||||||
value.id = m_module.specConst32(
|
|
||||||
getVectorTypeId(value.type),
|
|
||||||
info.value);
|
|
||||||
|
|
||||||
m_module.decorateSpecId(value.id, uint32_t(specId));
|
|
||||||
m_module.setDebugName(value.id, info.name);
|
|
||||||
|
|
||||||
m_specConstants.at(specIdOffset) = value;
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
DxbcSpecConstant DxbcCompiler::getSpecConstantProperties(DxvkSpecConstantId specId) {
|
|
||||||
static const std::array<DxbcSpecConstant,
|
|
||||||
uint32_t(DxvkSpecConstantId::SpecConstantIdMax) -
|
|
||||||
uint32_t(DxvkSpecConstantId::SpecConstantIdMin) + 1> s_specConstants = {{
|
|
||||||
{ DxbcScalarType::Uint32, 1, 1, "RasterizerSampleCount" },
|
|
||||||
}};
|
|
||||||
|
|
||||||
return s_specConstants.at(uint32_t(specId) - uint32_t(DxvkSpecConstantId::SpecConstantIdMin));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DxbcCompiler::emitInputSetup() {
|
void DxbcCompiler::emitInputSetup() {
|
||||||
// Copy all defined v# registers into the input array
|
// Copy all defined v# registers into the input array
|
||||||
const uint32_t vecTypeId = m_module.defVectorType(m_module.defFloatType(32), 4);
|
const uint32_t vecTypeId = m_module.defVectorType(m_module.defFloatType(32), 4);
|
||||||
|
@ -471,13 +471,6 @@ namespace dxvk {
|
|||||||
// to properly end functions in some cases.
|
// to properly end functions in some cases.
|
||||||
bool m_insideFunction = false;
|
bool m_insideFunction = false;
|
||||||
|
|
||||||
///////////////////////////////////////////////
|
|
||||||
// Specialization constants. These are defined
|
|
||||||
// as needed by the getSpecConstant method.
|
|
||||||
std::array<DxbcRegisterValue,
|
|
||||||
uint32_t(DxvkSpecConstantId::SpecConstantIdMax) -
|
|
||||||
uint32_t(DxvkSpecConstantId::SpecConstantIdMin) + 1> m_specConstants;
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////
|
||||||
// Array of input values. Since v# registers are indexable
|
// Array of input values. Since v# registers are indexable
|
||||||
// in DXBC, we need to copy them into an array first.
|
// in DXBC, we need to copy them into an array first.
|
||||||
@ -994,12 +987,6 @@ namespace dxvk {
|
|||||||
uint32_t value,
|
uint32_t value,
|
||||||
const char* name);
|
const char* name);
|
||||||
|
|
||||||
DxbcRegisterValue getSpecConstant(
|
|
||||||
DxvkSpecConstantId specId);
|
|
||||||
|
|
||||||
DxbcSpecConstant getSpecConstantProperties(
|
|
||||||
DxvkSpecConstantId specId);
|
|
||||||
|
|
||||||
////////////////////////////
|
////////////////////////////
|
||||||
// Input/output preparation
|
// Input/output preparation
|
||||||
void emitInputSetup();
|
void emitInputSetup();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user