Skip to content

sdl_glimp: make ARB_separate_shader_objects an explicit hard requirement#1899

Open
illwieckz wants to merge 1 commit intomasterfrom
illwieckz/separate-shader-objects
Open

sdl_glimp: make ARB_separate_shader_objects an explicit hard requirement#1899
illwieckz wants to merge 1 commit intomasterfrom
illwieckz/separate-shader-objects

Conversation

@illwieckz
Copy link
Member

Our code require ARB_separate_shader_objects, so we should test for it explicitly.

The ARB_separate_shader_objects extension is made required in OpenGL 4., but it only requires OpenGL 2.0 or ARB_shader_objects.

Mesa provides it with all known desktop OpenGL drivers, including GL 2.1 ones.

GL4ES doesn't provide it despite providing OpenGL 2.1 over OpenGL ES because as far as I know GL ES doesn't provide such feature and then it doesn't translate.

@illwieckz
Copy link
Member Author

illwieckz commented Feb 17, 2026

This makes the engine display a proper warning instead of aborting with cryptic errors later like discussed in that issue:

With this branch the engine catches the missing requirement and reports it properly:

--- Common Initialization Complete ---
Calling GetRefAPI…
SDL_Init( SDL_INIT_VIDEO )... 
Using SDL version 3.2.22 (compiled against SDL version 3.2.22)
SDL using driver "x11"
Using OpenGL ABI "LEGACY"
Initializing OpenGL display
Using GLEW version 2.2.0
Display aspect: 1.778
...setting mode -1: 640×480
Using preferred context - 24-bit OpenGL 3.2 core
Warn: Provided OpenGL compatibility profile is not the same as requested core profile.
OpenGL vendor: ptitSeb
OpenGL renderer: GL4ES wrapper
OpenGL version: 2.1 gl4es wrapper 1.1.7
Warn: Provided OpenGL 2.1 is not the same as requested 3.2 version
Available modes: 1280x720 1600x900 1920x1080 2560x1440 3840x2160 720x400 1280x800 1680x1050 720x480 640x480 800x600 832x624 1024x768 1152x864 720x576 1280x1024
Detected graphics hardware class 'generic'
Initializing OpenGL extensions
...missing optional extension GL_ARB_debug_output.
...using required extension GL_ARB_fragment_program.
...using shading language version 120
...using up to 8192 texture size.
...using up to 2048 3D texture size.
...using up to 8192 cube map texture size.
...using up to 96 texture units.
...missing optional extension GL_ARB_half_float_pixel.
...using optional extension GL_ARB_texture_float.
...missing optional extension GL_EXT_gpu_shader4.
...missing optional extension GL_ARB_gpu_shader5.
...missing optional extension GL_EXT_texture_integer.
...using optional extension GL_ARB_texture_rg.
...missing optional extension GL_ARB_texture_gather.
...using required extension GL_EXT_texture_compression_s3tc.
...missing optional extension GL_ARB_texture_compression_rgtc.
...missing optional extension GL_EXT_texture_filter_anisotropic.
...using required extension GL_ARB_vertex_array_object.
...using required extension GL_ARB_vertex_buffer_object.
...missing optional extension GL_ARB_half_float_vertex.
...using optional extension GL_ARB_framebuffer_object.
...missing optional extension GL_ARB_get_program_binary.
...missing optional extension GL_ARB_buffer_storage.
...missing optional extension GL_ARB_uniform_buffer_object.
...using optional extension GL_ARB_map_buffer_range.
...missing optional extension GL_ARB_sync.
...missing optional extension GL_ARB_texture_barrier.
...missing optional extension GL_ARB_compute_shader.
...missing optional extension GL_ARB_bindless_texture.
...missing optional extension GL_ARB_shader_draw_parameters.
...missing optional extension GL_ARB_program_interface_query.
...missing optional extension GL_ARB_shader_storage_buffer_object.
...missing optional extension GL_ARB_multi_draw_indirect.
...missing optional extension GL_ARB_shading_language_420pack.
...missing optional extension GL_ARB_explicit_uniform_location.
...missing optional extension GL_ARB_shader_image_load_store.
...missing optional extension GL_ARB_shader_atomic_counters.
...missing optional extension GL_ARB_shader_atomic_counter_ops.
Warn: Missing required extension GL_ARB_separate_shader_objects.

@slipher
Copy link
Member

slipher commented Feb 17, 2026

I don't think we use anything from that extension. The extension is about compiling a vertex shader by itself, or compiling a fragment shader by itself. The idea is to allow any (vertex shader, fragment shader) pair without having to recompile each possible combination. But we do it the old-fashioned way of compiling vertex + fragment together each time.

It's true that GLES has a limitation of only allowing one compilation unit per shader, according to https://stackoverflow.com/a/33622131. But the multiple compilation units feature is part of basic desktop OpenGL and doesn't require an extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants