Correct Adreno texture binding quirk

We incorrectly determined an Adreno driver bug to require padding between binding slots but the real issue was not supporting consecutive binding writes for `VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER` and was fixed by the padding slot unintentionally requiring individual writes. The quirk has now been corrected to explicitly specify this as the bug and the solution is more apt.
This commit is contained in:
PixelyIon 2022-03-07 16:44:08 +05:30
parent da8cb48933
commit 730bf504f8
3 changed files with 9 additions and 7 deletions

View File

@ -932,16 +932,18 @@ namespace skyline::gpu::interconnect {
} }
if (!program.info.texture_descriptors.empty()) { if (!program.info.texture_descriptors.empty()) {
if (!gpu.traits.quirks.needsTextureBindingPadding) if (!gpu.traits.quirks.needsIndividualTextureBindingWrites)
descriptorSetWrites.push_back(vk::WriteDescriptorSet{ descriptorSetWrites.push_back(vk::WriteDescriptorSet{
.dstBinding = bindingIndex, .dstBinding = bindingIndex,
.descriptorCount = static_cast<u32>(program.info.texture_descriptors.size()), .descriptorCount = static_cast<u32>(program.info.texture_descriptors.size()),
.descriptorType = vk::DescriptorType::eCombinedImageSampler, .descriptorType = vk::DescriptorType::eCombinedImageSampler,
.pImageInfo = imageInfo.data() + imageInfo.size(), .pImageInfo = imageInfo.data() + imageInfo.size(),
}); });
else
descriptorSetWrites.reserve(descriptorSetWrites.size() + program.info.texture_descriptors.size());
for (auto &texture : program.info.texture_descriptors) { for (auto &texture : program.info.texture_descriptors) {
if (gpu.traits.quirks.needsTextureBindingPadding) if (gpu.traits.quirks.needsIndividualTextureBindingWrites)
descriptorSetWrites.push_back(vk::WriteDescriptorSet{ descriptorSetWrites.push_back(vk::WriteDescriptorSet{
.dstBinding = bindingIndex, .dstBinding = bindingIndex,
.descriptorCount = 1, .descriptorCount = 1,
@ -952,7 +954,7 @@ namespace skyline::gpu::interconnect {
layoutBindings.push_back(vk::DescriptorSetLayoutBinding{ layoutBindings.push_back(vk::DescriptorSetLayoutBinding{
.binding = bindingIndex++, .binding = bindingIndex++,
.descriptorType = vk::DescriptorType::eCombinedImageSampler, .descriptorType = vk::DescriptorType::eCombinedImageSampler,
.descriptorCount = gpu.traits.quirks.needsTextureBindingPadding ? 1U : 2U, .descriptorCount = 1,
.stageFlags = pipelineStage.vkStage, .stageFlags = pipelineStage.vkStage,
}); });

View File

@ -130,7 +130,7 @@ namespace skyline::gpu {
TraitManager::QuirkManager::QuirkManager(const vk::PhysicalDeviceProperties &deviceProperties, const vk::PhysicalDeviceDriverProperties &driverProperties) { TraitManager::QuirkManager::QuirkManager(const vk::PhysicalDeviceProperties &deviceProperties, const vk::PhysicalDeviceDriverProperties &driverProperties) {
switch (driverProperties.driverID) { switch (driverProperties.driverID) {
case vk::DriverId::eQualcommProprietary: { case vk::DriverId::eQualcommProprietary: {
needsTextureBindingPadding = true; needsIndividualTextureBindingWrites = true;
break; break;
} }
@ -141,8 +141,8 @@ namespace skyline::gpu {
std::string TraitManager::QuirkManager::Summary() { std::string TraitManager::QuirkManager::Summary() {
return fmt::format( return fmt::format(
"\n* Needs Texture Binding Padding: {}", "\n* Needs Individual Texture Binding Writes: {}",
needsTextureBindingPadding needsIndividualTextureBindingWrites
); );
} }

View File

@ -39,7 +39,7 @@ namespace skyline::gpu {
* @brief Manages a list of any vendor/device-specific errata in the host GPU * @brief Manages a list of any vendor/device-specific errata in the host GPU
*/ */
struct QuirkManager { struct QuirkManager {
bool needsTextureBindingPadding{}; //!< [Adreno Proprietary] A bug that requires a padding descriptor slot for VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER bool needsIndividualTextureBindingWrites{}; //!< [Adreno Proprietary] A bug that requires descriptor set writes for VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER to be done individually with descriptorCount = 1 rather than batched
QuirkManager() = default; QuirkManager() = default;