1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-30 13:24:10 +01:00

[dxbc] Fixed incorrect result vector dimension for OpImageQuerySize

This commit is contained in:
Philip Rebohle 2018-04-12 13:57:15 +02:00
parent f5679211cd
commit adb1789571
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 16 additions and 1 deletions

View File

@ -4551,7 +4551,7 @@ namespace dxvk {
DxbcRegisterValue result; DxbcRegisterValue result;
result.type.ctype = DxbcScalarType::Uint32; result.type.ctype = DxbcScalarType::Uint32;
result.type.ccount = getTexCoordDim(info.image); result.type.ccount = getTexSizeDim(info.image);
if (info.image.ms == 0 && info.image.sampled == 1) { if (info.image.ms == 0 && info.image.sampled == 1) {
result.id = m_module.opImageQuerySizeLod( result.id = m_module.opImageQuerySizeLod(
@ -6185,6 +6185,18 @@ namespace dxvk {
} }
uint32_t DxbcCompiler::getTexSizeDim(const DxbcImageInfo& imageType) const {
switch (imageType.dim) {
case spv::DimBuffer: return 1 + imageType.array;
case spv::Dim1D: return 1 + imageType.array;
case spv::Dim2D: return 2 + imageType.array;
case spv::Dim3D: return 3 + imageType.array;
case spv::DimCube: return 2 + imageType.array;
default: throw DxvkError("DxbcCompiler: getTexLayerDim: Unsupported image dimension");
}
}
uint32_t DxbcCompiler::getTexLayerDim(const DxbcImageInfo& imageType) const { uint32_t DxbcCompiler::getTexLayerDim(const DxbcImageInfo& imageType) const {
switch (imageType.dim) { switch (imageType.dim) {
case spv::DimBuffer: return 1; case spv::DimBuffer: return 1;

View File

@ -985,6 +985,9 @@ namespace dxvk {
DxbcBufferInfo getBufferInfo( DxbcBufferInfo getBufferInfo(
const DxbcRegister& reg); const DxbcRegister& reg);
uint32_t getTexSizeDim(
const DxbcImageInfo& imageType) const;
uint32_t getTexLayerDim( uint32_t getTexLayerDim(
const DxbcImageInfo& imageType) const; const DxbcImageInfo& imageType) const;