1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-02 19:24:12 +01:00

[dxbc] Implemented ld2dms

This commit is contained in:
Philip Rebohle 2018-01-16 22:39:30 +01:00
parent 4c8c23eea1
commit b3cd126d0f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 23 additions and 7 deletions

View File

@ -2271,6 +2271,11 @@ namespace dxvk {
// (dst0) The destination register
// (src0) Source address
// (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;
// Image type, which stores the image dimensions etc.
@ -2302,18 +2307,24 @@ namespace dxvk {
}
// The LOD is not present when reading from a buffer
DxbcRegisterValue imageLod;
imageLod.type = address.type;
imageLod.id = 0;
if (imageType.dim != spv::DimBuffer) {
imageLod = emitRegisterExtract(address,
DxbcRegMask(false, false, false, true));
DxbcRegisterValue imageLod = emitRegisterExtract(
address, DxbcRegMask(false, false, false, true));
imageOperands.flags |= spv::ImageOperandsLodMask;
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
const DxbcRegisterValue coord =
emitRegisterExtract(address, coordArrayMask);

View File

@ -217,7 +217,12 @@ namespace dxvk {
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 },
} },
/* LdMs */
{ },
{ 4, DxbcInstClass::TextureFetch, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Sint32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Float32 },
{ DxbcOperandKind::SrcReg, DxbcScalarType::Sint32 },
} },
/* Log */
{ 2, DxbcInstClass::VectorAlu, {
{ DxbcOperandKind::DstReg, DxbcScalarType::Float32 },