mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-11 01:24:12 +01:00
[dxbc] Implemented ld2dms
This commit is contained in:
parent
4c8c23eea1
commit
b3cd126d0f
@ -2271,6 +2271,11 @@ namespace dxvk {
|
|||||||
// (dst0) The destination register
|
// (dst0) The destination register
|
||||||
// (src0) Source address
|
// (src0) Source address
|
||||||
// (src1) Source texture
|
// (src1) Source texture
|
||||||
|
// ld2dms has four operands:
|
||||||
|
// (dst0) The destination register
|
||||||
|
// (src0) Source address
|
||||||
|
// (src1) Source texture
|
||||||
|
// (src2) Sample number
|
||||||
const uint32_t textureId = ins.src[1].idx[0].offset;
|
const uint32_t textureId = ins.src[1].idx[0].offset;
|
||||||
|
|
||||||
// Image type, which stores the image dimensions etc.
|
// Image type, which stores the image dimensions etc.
|
||||||
@ -2302,18 +2307,24 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The LOD is not present when reading from a buffer
|
// The LOD is not present when reading from a buffer
|
||||||
DxbcRegisterValue imageLod;
|
|
||||||
imageLod.type = address.type;
|
|
||||||
imageLod.id = 0;
|
|
||||||
|
|
||||||
if (imageType.dim != spv::DimBuffer) {
|
if (imageType.dim != spv::DimBuffer) {
|
||||||
imageLod = emitRegisterExtract(address,
|
DxbcRegisterValue imageLod = emitRegisterExtract(
|
||||||
DxbcRegMask(false, false, false, true));
|
address, DxbcRegMask(false, false, false, true));
|
||||||
|
|
||||||
imageOperands.flags |= spv::ImageOperandsLodMask;
|
imageOperands.flags |= spv::ImageOperandsLodMask;
|
||||||
imageOperands.sLod = imageLod.id;
|
imageOperands.sLod = imageLod.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The ld2ms instruction also has a sample index, but
|
||||||
|
// we are only allowed to set it for multisample views
|
||||||
|
if (ins.op == DxbcOpcode::LdMs && imageType.ms == 1) {
|
||||||
|
DxbcRegisterValue sampleId = emitRegisterLoad(
|
||||||
|
ins.src[2], DxbcRegMask(true, false, false, false));
|
||||||
|
|
||||||
|
imageOperands.flags |= spv::ImageOperandsSampleMask;
|
||||||
|
imageOperands.sSampleId = sampleId.id;
|
||||||
|
}
|
||||||
|
|
||||||
// Extract coordinates from address
|
// Extract coordinates from address
|
||||||
const DxbcRegisterValue coord =
|
const DxbcRegisterValue coord =
|
||||||
emitRegisterExtract(address, coordArrayMask);
|
emitRegisterExtract(address, coordArrayMask);
|
||||||
|
@ -217,7 +217,12 @@ namespace dxvk {
|
|||||||
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 },
|
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 },
|
||||||
} },
|
} },
|
||||||
/* LdMs */
|
/* LdMs */
|
||||||
{ },
|
{ 4, DxbcInstClass::TextureFetch, {
|
||||||
|
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },
|
||||||
|
{ DxbcOperandKind::SrcReg, DxbcScalarType::Sint32 },
|
||||||
|
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 },
|
||||||
|
{ DxbcOperandKind::SrcReg, DxbcScalarType::Sint32 },
|
||||||
|
} },
|
||||||
/* Log */
|
/* Log */
|
||||||
{ 2, DxbcInstClass::VectorAlu, {
|
{ 2, DxbcInstClass::VectorAlu, {
|
||||||
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },
|
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },
|
||||||
|
Loading…
Reference in New Issue
Block a user