Fix Texture Handle Offset Calculation

The texture handle offset calculation involved an incorrect shift by descriptor size which was found to be unnecessary and would result in an invalid handle that had the wrong TIC/TSC index and caused broken rendering.
This commit is contained in:
PixelyIon 2022-01-22 19:13:16 +05:30
parent aa57ec6d55
commit 0b2ce6a8f3

View File

@ -949,7 +949,6 @@ namespace skyline::gpu::interconnect {
.pImageInfo = imageInfo.data() + imageInfo.size(),
});
u32 descriptorIndex{};
for (auto &texture : program.info.texture_descriptors) {
layoutBindings.push_back(vk::DescriptorSetLayoutBinding{
.binding = bindingIndex++,
@ -965,7 +964,7 @@ namespace skyline::gpu::interconnect {
u32 textureIndex : 20;
u32 samplerIndex : 12;
};
} handle{constantBuffer.Read<u32>(texture.cbuf_offset + (descriptorIndex++ << texture.size_shift))};
} handle{constantBuffer.Read<u32>(texture.cbuf_offset)};
auto sampler{GetSampler(handle.samplerIndex)};
auto textureView{GetPoolTextureView(handle.textureIndex)};