Skip to content

sdl_glimp: require VAO explicitly #1691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions src/engine/sys/sdl_glimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1768,8 +1768,8 @@ static rserr_t GLimp_StartDriverAndSetMode( int mode, bool fullscreen, bool bord
rserr_t err = GLimp_SetMode(mode, fullscreen, bordered);

const char* glRequirements =
"You need a graphics card with drivers supporting at least\n"
"OpenGL 3.2 or OpenGL 2.1 with EXT_framebuffer_object.";
"You need a graphics card with drivers supporting at least OpenGL 3.2\n"
"or OpenGL 2.1 with EXT_framebuffer_object and ARB_vertex_array_object.";

switch ( err )
{
Expand Down Expand Up @@ -2261,9 +2261,10 @@ static void GLimp_InitExtensions()

// made required in OpenGL 1.3
glConfig.textureCompression = textureCompression_t::TC_NONE;

/* ExtFlag_REQUIRED could be turned into ExtFlag_NONE if s3tc-to-rgba is implemented.
See https://github.com/DaemonEngine/Daemon/pull/738 */
if( LOAD_EXTENSION( ExtFlag_REQUIRED, EXT_texture_compression_s3tc ) )
if ( LOAD_EXTENSION( ExtFlag_REQUIRED, EXT_texture_compression_s3tc ) )
{
glConfig.textureCompression = textureCompression_t::TC_S3TC;
}
Expand All @@ -2283,6 +2284,14 @@ static void GLimp_InitExtensions()
glConfig2.textureAnisotropy = std::max( std::min( r_ext_texture_filter_anisotropic.Get(), glConfig2.maxTextureAnisotropy ), 1.0f );
}

// VAO and VBO

// made required in OpenGL 3.0
LOAD_EXTENSION( ExtFlag_REQUIRED | ExtFlag_CORE, ARB_vertex_array_object );

// made required in OpenGL 2.1
LOAD_EXTENSION( ExtFlag_REQUIRED | ExtFlag_CORE, ARB_vertex_buffer_object );

/* We call RV300 the first generation of R300 cards, to make a difference
with RV400 and RV500 cards that are also supported by the Mesa r300 driver.

Expand Down Expand Up @@ -2346,7 +2355,6 @@ static void GLimp_InitExtensions()
}
}

// VAO and VBO
// made required in OpenGL 3.0
glConfig2.halfFloatVertexAvailable = LOAD_EXTENSION_WITH_TEST( ExtFlag_CORE, ARB_half_float_vertex, halfFloatVertexEnabled );

Expand All @@ -2356,6 +2364,8 @@ static void GLimp_InitExtensions()
}
}

// FBO

if ( !workaround_glExtension_missingArbFbo_useExtFbo.Get() )
{
// made required in OpenGL 3.0
Expand Down Expand Up @@ -2388,7 +2398,6 @@ static void GLimp_InitExtensions()
glFboSetExt();
}

// FBO
glGetIntegerv( GL_MAX_RENDERBUFFER_SIZE, &glConfig2.maxRenderbufferSize );
glGetIntegerv( GL_MAX_COLOR_ATTACHMENTS, &glConfig2.maxColorAttachments );

Expand Down