mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[spirv] Implement opInverse, opNormalize and opLength
This commit is contained in:
parent
edf0661994
commit
fdbfb2c92d
@ -1974,6 +1974,21 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
uint32_t SpirvModule::opInverse(
|
||||
uint32_t resultType,
|
||||
uint32_t matrix) {
|
||||
uint32_t resultId = this->allocateId();
|
||||
|
||||
m_code.putIns(spv::OpExtInst, 6);
|
||||
m_code.putWord(resultType);
|
||||
m_code.putWord(resultId);
|
||||
m_code.putWord(m_instExtGlsl450);
|
||||
m_code.putWord(spv::GLSLstd450MatrixInverse);
|
||||
m_code.putWord(matrix);
|
||||
return resultId;
|
||||
}
|
||||
|
||||
|
||||
uint32_t SpirvModule::opFFma(
|
||||
uint32_t resultType,
|
||||
uint32_t a,
|
||||
@ -2553,6 +2568,36 @@ namespace dxvk {
|
||||
m_code.putWord(operand);
|
||||
return resultId;
|
||||
}
|
||||
|
||||
|
||||
uint32_t SpirvModule::opNormalize(
|
||||
uint32_t resultType,
|
||||
uint32_t operand) {
|
||||
uint32_t resultId = this->allocateId();
|
||||
|
||||
m_code.putIns (spv::OpExtInst, 6);
|
||||
m_code.putWord(resultType);
|
||||
m_code.putWord(resultId);
|
||||
m_code.putWord(m_instExtGlsl450);
|
||||
m_code.putWord(spv::GLSLstd450Normalize);
|
||||
m_code.putWord(operand);
|
||||
return resultId;
|
||||
}
|
||||
|
||||
|
||||
uint32_t SpirvModule::opLength(
|
||||
uint32_t resultType,
|
||||
uint32_t operand) {
|
||||
uint32_t resultId = this->allocateId();
|
||||
|
||||
m_code.putIns (spv::OpExtInst, 6);
|
||||
m_code.putWord(resultType);
|
||||
m_code.putWord(resultId);
|
||||
m_code.putWord(m_instExtGlsl450);
|
||||
m_code.putWord(spv::GLSLstd450Length);
|
||||
m_code.putWord(operand);
|
||||
return resultId;
|
||||
}
|
||||
|
||||
|
||||
uint32_t SpirvModule::opExp2(
|
||||
|
@ -711,6 +711,10 @@ namespace dxvk {
|
||||
uint32_t opTranspose(
|
||||
uint32_t resultType,
|
||||
uint32_t matrix);
|
||||
|
||||
uint32_t opInverse(
|
||||
uint32_t resultType,
|
||||
uint32_t matrix);
|
||||
|
||||
uint32_t opFFma(
|
||||
uint32_t resultType,
|
||||
@ -894,6 +898,14 @@ namespace dxvk {
|
||||
uint32_t opInverseSqrt(
|
||||
uint32_t resultType,
|
||||
uint32_t operand);
|
||||
|
||||
uint32_t opNormalize(
|
||||
uint32_t resultType,
|
||||
uint32_t operand);
|
||||
|
||||
uint32_t opLength(
|
||||
uint32_t resultType,
|
||||
uint32_t operand);
|
||||
|
||||
uint32_t opExp2(
|
||||
uint32_t resultType,
|
||||
|
Loading…
x
Reference in New Issue
Block a user