[Fix] (GL): report GL_SAMPLE_POSITION from the backend's sample locations and check the index against the draw framebuffer's GL_SAMPLES

This commit is contained in:
2026-10-12 08:32:44 -04:00
parent 45f5bae8b3
commit c2dbcbee19
9 changed files with 174 additions and 9 deletions
@@ -187,6 +187,7 @@ namespace MobileGL::MG_Util::BackendLoader {
// reproduced on this backend. One word is the spec minimum and therefore always legal.
// It is also what PipelineCreatePayload::sampleMask is sized for.
caps.MaxSampleMaskWords = std::min(SaturateToInt(p.limits.maxSampleMaskWords), 1);
caps.StandardSampleLocations = p.limits.standardSampleLocations == VK_TRUE;
caps.MaxTextureImageUnits = SaturateToInt(p.limits.maxPerStageDescriptorSampledImages);
caps.MaxVertexTextureImageUnits = SaturateToInt(p.limits.maxPerStageDescriptorSampledImages);
caps.MaxComputeTextureImageUnits = SaturateToInt(p.limits.maxPerStageDescriptorSampledImages);
@@ -329,6 +330,7 @@ namespace MobileGL::MG_Util::BackendLoader {
// reproduced on this backend. One word is the spec minimum and therefore always legal.
// It is also what PipelineCreatePayload::sampleMask is sized for.
caps.MaxSampleMaskWords = std::min(SaturateToInt(properties.limits.maxSampleMaskWords), 1);
caps.StandardSampleLocations = properties.limits.standardSampleLocations == VK_TRUE;
caps.MaxTextureImageUnits = SaturateToInt(properties.limits.maxPerStageDescriptorSampledImages);
caps.MaxVertexTextureImageUnits = SaturateToInt(properties.limits.maxPerStageDescriptorSampledImages);
caps.MaxComputeTextureImageUnits = SaturateToInt(properties.limits.maxPerStageDescriptorSampledImages);
@@ -47,6 +47,9 @@ namespace MobileGL {
Int MaxIntegerSamples = 1;
Int MaxSamples = 1;
Int MaxSampleMaskWords = 1;
// VkPhysicalDeviceLimits::standardSampleLocations: the device places the samples of
// every supported count at the standard locations the Vulkan specification tabulates.
Bool StandardSampleLocations = false;
Int MaxTextureImageUnits = 32;
Int MaxVertexTextureImageUnits = 32;
Int MaxComputeTextureImageUnits = 32;