mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Merge] (GLImpl, DirectGLES, DirectVulkan): take the extension advertisements under the DSA completion
This commit is contained in:
@@ -1269,7 +1269,7 @@ namespace MobileGL::MG_Util::SelfTest {
|
||||
summary.caps.SupportsDisjointTimerQuery, summary.caps.SupportsTextureFilterAnisotropy,
|
||||
summary.caps.SupportsDrawIndirect,
|
||||
summary.caps.SupportsDrawIndirect && summary.caps.SupportsBaseInstance,
|
||||
summary.caps.SupportsTextureView));
|
||||
summary.caps.SupportsTextureView, summary.caps.SupportsTextureCubeMapArray));
|
||||
}
|
||||
AppendMobileGLReportedRows(builder, MG_Backend::DirectGLES::GetRendererIdentity(), backendApiVersionString,
|
||||
advertisedExtensions);
|
||||
@@ -2009,6 +2009,7 @@ namespace MobileGL::MG_Util::SelfTest {
|
||||
Bool samplerAnisotropySupported = false;
|
||||
Bool drawIndirectFirstInstanceSupported = false;
|
||||
Bool shaderDrawParametersSupported = false;
|
||||
Bool imageCubeArraySupported = false;
|
||||
};
|
||||
} // namespace
|
||||
|
||||
@@ -2300,6 +2301,7 @@ namespace MobileGL::MG_Util::SelfTest {
|
||||
VkPhysicalDeviceFeatures features{};
|
||||
vkGetPhysicalDeviceFeaturesFn(physicalDevice, &features);
|
||||
summary.samplerAnisotropySupported = features.samplerAnisotropy == VK_TRUE;
|
||||
summary.imageCubeArraySupported = features.imageCubeArray == VK_TRUE;
|
||||
summary.drawIndirectFirstInstanceSupported = features.drawIndirectFirstInstance == VK_TRUE;
|
||||
if (features.multiDrawIndirect == VK_TRUE) {
|
||||
builder.Pass("multiDrawIndirect", "indirect multi-draw batches run as single native commands");
|
||||
@@ -2721,7 +2723,8 @@ namespace MobileGL::MG_Util::SelfTest {
|
||||
summary.deviceName, summary.apiVersionString, summary.driverVersionString);
|
||||
advertisedExtensions = JoinAdvertisedExtensions(MG_Backend::DirectVulkan::BuildAdvertisedExtensions(
|
||||
summary.shaderSubgroupUsable, summary.timerQueriesSupported, summary.samplerAnisotropySupported,
|
||||
summary.drawIndirectFirstInstanceSupported && summary.shaderDrawParametersSupported));
|
||||
summary.drawIndirectFirstInstanceSupported && summary.shaderDrawParametersSupported,
|
||||
summary.imageCubeArraySupported));
|
||||
}
|
||||
AppendMobileGLReportedRows(builder, MG_Backend::DirectVulkan::GetRendererIdentity(), backendApiVersionString,
|
||||
advertisedExtensions);
|
||||
|
||||
@@ -20,6 +20,28 @@ namespace MobileGL {
|
||||
// buffer, and the trailing number is the only place the GL binding survives.
|
||||
inline constexpr const char* ATOMIC_COUNTER_BLOCK_PREFIX = "gl_AtomicCounterBlock";
|
||||
|
||||
// "gl_AtomicCounterBlock_5" -> 5; -1 for any name that is not one of these blocks.
|
||||
// Recovering N from the NAME is not a shortcut, it is the only way: the block reaches
|
||||
// a backend auto-mapped to whatever storage-block slot the IO mapper had free, and
|
||||
// that number has no relation to the GL atomic-counter binding the application asked
|
||||
// for (see TMglGlslIoResolver). A backend that resolves the block from the
|
||||
// shader-storage binding points therefore binds the wrong buffer - or, worse, the
|
||||
// application's own SSBO at the same slot.
|
||||
inline Int AtomicCounterBlockGlBinding(StringView name) {
|
||||
const SizeT prefixLength = StringView(ATOMIC_COUNTER_BLOCK_PREFIX).size();
|
||||
// Needs the prefix, the '_' and at least one digit.
|
||||
if (name.size() <= prefixLength + 1) return -1;
|
||||
if (name.compare(0, prefixLength, ATOMIC_COUNTER_BLOCK_PREFIX) != 0) return -1;
|
||||
if (name[prefixLength] != '_') return -1;
|
||||
Int binding = 0;
|
||||
for (SizeT i = prefixLength + 1; i < name.size(); ++i) {
|
||||
if (name[i] < '0' || name[i] > '9') return -1;
|
||||
binding = binding * 10 + (name[i] - '0');
|
||||
if (binding > 0x0FFFFFFF) return -1; // absurd suffix; treat as not-a-counter
|
||||
}
|
||||
return binding;
|
||||
}
|
||||
|
||||
// Atomic-counter limits, in ONE place because GL 4.6 requires glGetIntegerv and the
|
||||
// shading language's gl_MaxAtomicCounter* constants to report the same numbers
|
||||
// (KHR-GL43.shader_atomic_counters.basic-glsl-built-in compares them directly).
|
||||
|
||||
Reference in New Issue
Block a user