mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-14 22:29:15 +01:00
[dxbc] Fixed redundant bitcasts
This commit is contained in:
parent
f4cd90d6fa
commit
7cc65be16b
@ -3679,11 +3679,11 @@ namespace dxvk {
|
|||||||
for (uint32_t i = 0; i < m_vRegs.size(); i++) {
|
for (uint32_t i = 0; i < m_vRegs.size(); i++) {
|
||||||
if (m_vRegs.at(i) != 0) {
|
if (m_vRegs.at(i) != 0) {
|
||||||
const uint32_t registerId = m_module.consti32(i);
|
const uint32_t registerId = m_module.consti32(i);
|
||||||
m_module.opStore(
|
const uint32_t srcTypeId = getVectorTypeId(getInputRegType(i));
|
||||||
m_module.opAccessChain(ptrTypeId, m_vArray, 1, ®isterId),
|
const uint32_t srcValue = m_module.opLoad(srcTypeId, m_vRegs.at(i));
|
||||||
m_module.opBitcast(vecTypeId, m_module.opLoad(
|
|
||||||
getVectorTypeId(getInputRegType(i)),
|
m_module.opStore(m_module.opAccessChain(ptrTypeId, m_vArray, 1, ®isterId),
|
||||||
m_vRegs.at(i))));
|
vecTypeId != srcTypeId ? m_module.opBitcast(vecTypeId, srcValue) : srcValue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3723,17 +3723,16 @@ namespace dxvk {
|
|||||||
const uint32_t registerId = m_module.consti32(i);
|
const uint32_t registerId = m_module.consti32(i);
|
||||||
|
|
||||||
for (uint32_t v = 0; v < vertexCount; v++) {
|
for (uint32_t v = 0; v < vertexCount; v++) {
|
||||||
std::array<uint32_t, 2> indices = {
|
std::array<uint32_t, 2> indices
|
||||||
m_module.consti32(v), registerId,
|
= {{ m_module.consti32(v), registerId }};
|
||||||
};
|
|
||||||
|
const uint32_t srcTypeId = getVectorTypeId(getInputRegType(i));
|
||||||
|
const uint32_t srcValue = m_module.opLoad(srcTypeId,
|
||||||
|
m_module.opAccessChain(srcPtrTypeId, m_vRegs.at(i), 1, indices.data()));
|
||||||
|
|
||||||
m_module.opStore(
|
m_module.opStore(
|
||||||
m_module.opAccessChain(dstPtrTypeId,
|
m_module.opAccessChain(dstPtrTypeId, m_vArray, indices.size(), indices.data()),
|
||||||
m_vArray, indices.size(), indices.data()),
|
vecTypeId != srcTypeId ? m_module.opBitcast(vecTypeId, srcValue) : srcValue);
|
||||||
m_module.opBitcast(vecTypeId, m_module.opLoad(
|
|
||||||
getVectorTypeId(getInputRegType(i)),
|
|
||||||
m_module.opAccessChain(srcPtrTypeId,
|
|
||||||
m_vRegs.at(i), 1, indices.data()))));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4272,6 +4271,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
uint32_t DxbcCompiler::getTexCoordDim(const DxbcImageInfo& imageType) const {
|
uint32_t DxbcCompiler::getTexCoordDim(const DxbcImageInfo& imageType) const {
|
||||||
return getTexLayerDim(imageType) + imageType.array;
|
return getTexLayerDim(imageType) + imageType.array;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user