@@ -519,8 +519,10 @@ class IOpenGL_PhysicalDeviceBase : public IOpenGLPhysicalDeviceBase
519
519
GLuint maxElementIndex = 0u ;
520
520
GetIntegerv (GL_MAX_ELEMENT_INDEX, reinterpret_cast <GLint*>(&maxElementIndex));
521
521
522
- // [TODO] robustBufferAccess: EGL_EXT_create_context_robustness&(IsGLES ? (Version>=320 || KHR_robustness || ARB_robustness):(Version>=450 || KHR_robustness || ARB_robustness))
523
- m_features.robustBufferAccess = false ;
522
+ m_features.robustBufferAccess = m_glfeatures.isFeatureAvailable (m_glfeatures.NBL_EXT_create_context_robustness ) &&
523
+ ((IsGLES ? m_glfeatures.Version >= 320u : m_glfeatures.Version >= 450 ) ||
524
+ m_glfeatures.isFeatureAvailable (m_glfeatures.NBL_KHR_robustness ) ||
525
+ m_glfeatures.isFeatureAvailable (m_glfeatures.NBL_ARB_robustness ));
524
526
m_features.fullDrawIndexUint32 = (maxElementIndex == 0xffff'ffff );
525
527
m_features.imageCubeArray = true ; // we require OES_texture_cube_map_array on GLES
526
528
m_features.independentBlend = IsGLES
@@ -681,32 +683,28 @@ class IOpenGL_PhysicalDeviceBase : public IOpenGLPhysicalDeviceBase
681
683
m_features.vertexPipelineStoresAndAtomics = false ;
682
684
m_features.fragmentStoresAndAtomics = false ;
683
685
684
- // [TODO] shaderTessellationAndGeometryPointSize
685
- /*
686
686
// An implementation supporting this feature must also support one or both of the [tessellationShader] or [geometryShader] features.
687
687
m_features.shaderTessellationAndGeometryPointSize = true ;
688
- if (OES_geometry_shader )
689
- m_features.shaderTessellationAndGeometryPointSize &=OES_geometry_point_size ;
690
- else if (EXT_geometry_shader )
691
- m_features.shaderTessellationAndGeometryPointSize &=EXT_geometry_point_size ;
692
- if (OES_tessellation_shader )
693
- m_features.shaderTessellationAndGeometryPointSize &=OES_tessellation_point_size ;
694
- else if (EXT_tessellation_shader )
695
- m_features.shaderTessellationAndGeometryPointSize &=EXT_tessellation_point_size ;
688
+ if (m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_OES_geometry_shader) )
689
+ m_features.shaderTessellationAndGeometryPointSize &= m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_OES_geometry_point_size) ;
690
+ else if (m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_geometry_shader) )
691
+ m_features.shaderTessellationAndGeometryPointSize &= m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_geometry_point_size) ;
692
+ if (m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_OES_tessellation_shader) )
693
+ m_features.shaderTessellationAndGeometryPointSize &= m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_OES_tessellation_point_size) ;
694
+ else if (m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_tessellation_shader) )
695
+ m_features.shaderTessellationAndGeometryPointSize &= m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_tessellation_point_size) ;
696
696
else if (!m_features.geometryShader ) // tessellation not supported,
697
697
m_features.shaderTessellationAndGeometryPointSize = false ;
698
- */
699
698
700
-
701
- // [TODO] m_features.shaderImageGatherExtended = IsGLES ? (Version>=320 || GL_OES_gpu_shader5 || GL_EXT_gpu_shader5):true
702
- // [TODO] m_features.shaderStorageImageExtendedFormats = !IsGLES
703
699
m_features.shaderStorageImageMultisample = true ; // true in our minimum supported GL and GLES
704
- // [TODO] m_features.shaderStorageImageReadWithoutFormat :in GL, always false
705
- // [TODO] m_features.shaderStorageImageWriteWithoutFormat :in GL, always false
706
- // [TODO] m_features.shaderUniformBufferArrayDynamicIndexing = IsGLES ? (Version>=320 || GL_OES_gpu_shader5 || GL_EXT_gpu_shader5 || GL_NV_gpu_shader5):true
707
- // [TODO] m_features.shaderSampledImageArrayDynamicIndexing = IsGLES ? (Version>=320 || GL_OES_gpu_shader5 || GL_EXT_gpu_shader5 || GL_NV_gpu_shader5):true
708
- // [TODO] m_features.shaderStorageBufferArrayDynamicIndexing = IsGLES ? (Version>=320 || GL_NV_gpu_shader5):true
709
- // [TODO] m_features.shaderStorageImageArrayDynamicIndexing = IsGLES ? (Version>=320 || GL_NV_gpu_shader5):true
700
+ m_features.shaderImageGatherExtended = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_OES_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_gpu_shader5)) : true ;
701
+ m_features.shaderStorageImageExtendedFormats = !IsGLES;
702
+ m_features.shaderStorageImageReadWithoutFormat = false ;
703
+ m_features.shaderStorageImageWriteWithoutFormat = false ;
704
+ m_features.shaderUniformBufferArrayDynamicIndexing = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_OES_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5)) : true ;
705
+ m_features.shaderSampledImageArrayDynamicIndexing = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_OES_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5)) : true ;
706
+ m_features.shaderStorageBufferArrayDynamicIndexing = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5)) : true ;
707
+ m_features.shaderStorageImageArrayDynamicIndexing = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5)) : true ;
710
708
711
709
if constexpr (IsGLES)
712
710
{
@@ -732,21 +730,18 @@ class IOpenGL_PhysicalDeviceBase : public IOpenGLPhysicalDeviceBase
732
730
}
733
731
734
732
m_features.vertexAttributeDouble = !IsGLES;
735
-
736
- // [TODO] shaderInt64 = NV_gpu_shader5 || GL_ARB_gpu_shader_int64 || GL_AMD_gpu_shader_int64 // keep in sync with `GL_EXT_shader_explicit_arithmetic_types_int16` SPIRV-Cross Handling https://github.com/KhronosGroup/SPIRV-Cross/blob/master/spirv_glsl.cpp#L411
737
- // [TODO] shaderInt16 = NV_gpu_shader5 || GL_AMD_gpu_shader_int16 // keep in sync with `GL_EXT_shader_explicit_arithmetic_types_int16` SPIRV-Cross Handling https://github.com/KhronosGroup/SPIRV-Cross/blob/master/spirv_glsl.cpp#L849
738
- // [TODO] shaderResourceResidency = ARB_sparse_texture2 || EXT_sparse_texture2 || AMD_sparse_texture
739
- // [TODO] shaderResourceMinLod = EXT_sparse_texture2 || ARB_sparse_texture_clamp
733
+
734
+ m_features. shaderInt64 = m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5) || m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_ARB_gpu_shader_int64) || m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_int64); // keep in sync with `GL_EXT_shader_explicit_arithmetic_types_int16` SPIRV-Cross Handling https://github.com/KhronosGroup/SPIRV-Cross/blob/master/spirv_glsl.cpp#L411
735
+ m_features. shaderInt16 = m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5) || m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_int16); // keep in sync with `GL_EXT_shader_explicit_arithmetic_types_int16` SPIRV-Cross Handling https://github.com/KhronosGroup/SPIRV-Cross/blob/master/spirv_glsl.cpp#L849
736
+ m_features. shaderResourceResidency = m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_ARB_sparse_texture2) || m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_sparse_texture2) || m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_sparse_texture);
737
+ m_features. shaderResourceMinLod = m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_sparse_texture2) || m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_ARB_sparse_texture_clamp);
740
738
741
739
m_features.variableMultisampleRate = true ;
742
740
m_features.inheritedQueries = true ; // We emulate secondary command buffers so enable by default
743
741
744
742
/* Vulkan 1.1 Core */
745
-
746
- // [TODO] storageBuffer16BitAccess = NV_gpu_shader5 || GL_AMD_gpu_shader_int16 && AMD_gpu_shader_half_float
747
- // [TODO] uniformAndStorageBuffer16BitAccess = NV_gpu_shader5 || GL_AMD_gpu_shader_int16 && AMD_gpu_shader_half_float
748
- // [TODO] storagePushConstant16
749
- // [TODO] storageInputOutput16
743
+ m_features.storageBuffer16BitAccess = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_int16) && m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_half_float);
744
+ m_features.uniformAndStorageBuffer16BitAccess = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_int16) && m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_half_float);
750
745
751
746
m_features.shaderDrawParameters = IsGLES ? false : (m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_ARB_shader_draw_parameters) || m_glfeatures.Version >= 460u );
752
747
@@ -770,37 +765,41 @@ class IOpenGL_PhysicalDeviceBase : public IOpenGLPhysicalDeviceBase
770
765
771
766
m_properties.limits .imageFootprint = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_shader_texture_footprint);
772
767
773
- // [TODO] storageBuffer8BitAccess = NV_gpu_shader5
774
- // [TODO] uniformAndStorageBuffer8BitAccess = NV_gpu_shader5
775
- // [TODO] storagePushConstant8 => for now make GL and GLES report false and leave a comment with a TODO: implemenent, then return true
768
+ // [TODO]
769
+ m_features.storagePushConstant8 = false ;
770
+ m_features.storagePushConstant16 = false ;
771
+ m_features.storageInputOutput16 = false ;
776
772
777
- // [TODO] shaderBufferInt64Atomics NV_shader_atomic_int64
778
- // [TODO] shaderSharedInt64Atomics probably false on GL, not sure
773
+ m_features. shaderBufferInt64Atomics = m_glfeatures. isFeatureAvailable (COpenGLFeatureMap::NBL_NV_shader_atomic_int64);
774
+ m_features. shaderSharedInt64Atomics = false ;
779
775
780
- // [TODO] shaderFloat16 = NV_gpu_shader5 || AMD_gpu_shader_half_float
781
- // [TODO] shaderInt8 = NV_gpu_shader5
782
-
783
- // [TODO] descriptorIndexing = false
784
- // [TODO] shaderInputAttachmentArrayDynamicIndexing = no input attachments in GL / GLES, so false
785
- // [TODO] shaderUniformTexelBufferArrayDynamicIndexing = IsGLES ? (Version>=320 || GL_NV_gpu_shader5):true
786
- // [TODO] shaderStorageTexelBufferArrayDynamicIndexing = IsGLES ? (Version>=320 || GL_NV_gpu_shader5):true
787
- // [TODO] shaderUniformBufferArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
788
- // [TODO] shaderSampledImageArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
789
- // [TODO] shaderStorageBufferArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
790
- // [TODO] shaderStorageImageArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
791
- // [TODO] shaderInputAttachmentArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
792
- // [TODO] shaderUniformTexelBufferArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
793
- // [TODO] shaderStorageTexelBufferArrayNonUniformIndexing = NV_gpu_shader5 || EXT_nonuniform_qualifier
794
- // [TODO] descriptorBindingUniformBufferUpdateAfterBind = always report true for those in GL
795
- // [TODO] descriptorBindingSampledImageUpdateAfterBind = always report true for those in GL
796
- // [TODO] descriptorBindingStorageImageUpdateAfterBind = always report true for those in GL
797
- // [TODO] descriptorBindingStorageBufferUpdateAfterBind = always report true for those in GL
798
- // [TODO] descriptorBindingUniformTexelBufferUpdateAfterBind = always report true for those in GL
799
- // [TODO] descriptorBindingStorageTexelBufferUpdateAfterBind = always report true for those in GL
800
- // [TODO] descriptorBindingUpdateUnusedWhilePending = always report true for those in GL
801
- // [TODO] descriptorBindingPartiallyBound = always report true for those in GL
802
- // [TODO] descriptorBindingVariableDescriptorCount = false, GL limits on descriptor counts are so low, it makes no sense to bother to implement
803
- // [TODO] runtimeDescriptorArray = false
776
+ m_features.shaderFloat16 = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_gpu_shader_half_float);
777
+ m_features.shaderInt8 = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5);
778
+ m_features.storageBuffer8BitAccess = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5);
779
+ m_features.uniformAndStorageBuffer8BitAccess = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5);
780
+
781
+ m_features.descriptorIndexing = false ;
782
+ m_features.shaderInputAttachmentArrayDynamicIndexing = false ;
783
+ m_features.shaderUniformTexelBufferArrayDynamicIndexing = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5)) : true ;
784
+ m_features.shaderStorageTexelBufferArrayDynamicIndexing = IsGLES ? (m_glfeatures.Version >= 320 || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5)) : true ;
785
+ bool reportArrayNonUniformIndexing = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_NV_gpu_shader5) || m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_EXT_nonuniform_qualifier);
786
+ m_features.shaderUniformBufferArrayNonUniformIndexing = reportArrayNonUniformIndexing;
787
+ m_features.shaderSampledImageArrayNonUniformIndexing = reportArrayNonUniformIndexing;
788
+ m_features.shaderStorageBufferArrayNonUniformIndexing = reportArrayNonUniformIndexing;
789
+ m_features.shaderStorageImageArrayNonUniformIndexing = reportArrayNonUniformIndexing;
790
+ m_features.shaderInputAttachmentArrayNonUniformIndexing = reportArrayNonUniformIndexing;
791
+ m_features.shaderUniformTexelBufferArrayNonUniformIndexing = reportArrayNonUniformIndexing;
792
+ m_features.shaderStorageTexelBufferArrayNonUniformIndexing = reportArrayNonUniformIndexing;
793
+ m_features.descriptorBindingUniformBufferUpdateAfterBind = true ;
794
+ m_features.descriptorBindingSampledImageUpdateAfterBind = true ;
795
+ m_features.descriptorBindingStorageImageUpdateAfterBind = true ;
796
+ m_features.descriptorBindingStorageBufferUpdateAfterBind = true ;
797
+ m_features.descriptorBindingUniformTexelBufferUpdateAfterBind = true ;
798
+ m_features.descriptorBindingStorageTexelBufferUpdateAfterBind = true ;
799
+ m_features.descriptorBindingUpdateUnusedWhilePending = true ;
800
+ m_features.descriptorBindingPartiallyBound = true ;
801
+ m_features.descriptorBindingVariableDescriptorCount = false ;
802
+ m_features.runtimeDescriptorArray = false ;
804
803
805
804
m_features.samplerFilterMinmax = false ; // no such sampler in GL
806
805
m_features.shaderSubgroupExtendedTypes = m_glfeatures.isFeatureAvailable (COpenGLFeatureMap::NBL_AMD_shader_ballot);
0 commit comments