mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxbc] Implement ld_uav_typed with sparse feedback
This commit is contained in:
parent
0faba649da
commit
db3b2e23fb
1 changed files with 26 additions and 7 deletions
|
@ -3717,21 +3717,40 @@ namespace dxvk {
|
||||||
// Load texture coordinates
|
// Load texture coordinates
|
||||||
DxbcRegisterValue texCoord = emitLoadTexCoord(
|
DxbcRegisterValue texCoord = emitLoadTexCoord(
|
||||||
ins.src[0], uavInfo.imageInfo);
|
ins.src[0], uavInfo.imageInfo);
|
||||||
|
|
||||||
|
SpirvImageOperands imageOperands;
|
||||||
|
imageOperands.sparse = ins.dstCount == 2;
|
||||||
|
|
||||||
|
DxbcVectorType texelType;
|
||||||
|
texelType.ctype = uavInfo.sampledType;
|
||||||
|
texelType.ccount = 4;
|
||||||
|
|
||||||
|
uint32_t texelTypeId = getVectorTypeId(texelType);
|
||||||
|
uint32_t resultTypeId = texelTypeId;
|
||||||
|
uint32_t resultId = 0;
|
||||||
|
|
||||||
|
if (imageOperands.sparse)
|
||||||
|
resultTypeId = getSparseResultTypeId(texelTypeId);
|
||||||
|
|
||||||
// Load source value from the UAV
|
// Load source value from the UAV
|
||||||
DxbcRegisterValue uavValue;
|
resultId = m_module.opImageRead(resultTypeId,
|
||||||
uavValue.type.ctype = uavInfo.sampledType;
|
|
||||||
uavValue.type.ccount = 4;
|
|
||||||
uavValue.id = m_module.opImageRead(
|
|
||||||
getVectorTypeId(uavValue.type),
|
|
||||||
m_module.opLoad(uavInfo.imageTypeId, uavInfo.varId),
|
m_module.opLoad(uavInfo.imageTypeId, uavInfo.varId),
|
||||||
texCoord.id, SpirvImageOperands());
|
texCoord.id, imageOperands);
|
||||||
|
|
||||||
// Apply component swizzle and mask
|
// Apply component swizzle and mask
|
||||||
|
DxbcRegisterValue uavValue;
|
||||||
|
uavValue.type = texelType;
|
||||||
|
uavValue.id = imageOperands.sparse
|
||||||
|
? emitExtractSparseTexel(texelTypeId, resultId)
|
||||||
|
: resultId;
|
||||||
|
|
||||||
uavValue = emitRegisterSwizzle(uavValue,
|
uavValue = emitRegisterSwizzle(uavValue,
|
||||||
ins.src[1].swizzle, ins.dst[0].mask);
|
ins.src[1].swizzle, ins.dst[0].mask);
|
||||||
|
|
||||||
emitRegisterStore(ins.dst[0], uavValue);
|
emitRegisterStore(ins.dst[0], uavValue);
|
||||||
|
|
||||||
|
if (imageOperands.sparse)
|
||||||
|
emitStoreSparseFeedback(ins.dst[1], resultId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue