Skip to content

Commit

Permalink
Set the version of the BC3 shaders to 310 es
Browse files Browse the repository at this point in the history
The shaders are compatible with GLSL ES version 310. Require the
GL_ARB_ES3_1_compatibility extension and change the version directives
accordingly so that we get validation from the GL implementation.
  • Loading branch information
nchery-intel committed Oct 26, 2022
1 parent 069c246 commit 834c79d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/Data/bc1.glsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 430 core
#version 310 es

#if defined(GL_ES) && GL_ES == 1
// Desktop GLSL allows the const keyword for either compile-time or
Expand Down
2 changes: 1 addition & 1 deletion bin/Data/bc1_dither.glsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 430 core
#version 310 es

#define BC1_DITHER
#include "bc1.glsl"
2 changes: 1 addition & 1 deletion bin/Data/bc4.glsl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 430 core
#version 310 es

#if defined(GL_ES) && GL_ES == 1
// Desktop GLSL allows the const keyword for either compile-time or
Expand Down
2 changes: 1 addition & 1 deletion bin/Data/etc2_rgba_stitch.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// This compute shader merely stitches them together to form the final result
// It's also used by RG11 driver to stitch two R11 into one RG11

#version 430 core
#version 310 es

// #include "/media/matias/Datos/SyntaxHighlightingMisc.h"

Expand Down
8 changes: 8 additions & 0 deletions src/PlatformGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,20 @@ namespace betsy

g_glContext = SDL_GL_CreateContext( g_sdlWindow );

const SDL_bool has_required_extensions = SDL_GL_ExtensionSupported( "GL_ARB_ES3_1_compatibility" );

if( !g_glContext )
{
fprintf( stderr, "GL Context creation failed.\n" );
SDL_Quit();
abort();
}
else if ( has_required_extensions == SDL_FALSE )
{
fprintf( stderr, "GL Context lacks required extensions.\n" );
SDL_Quit();
abort();
}
else
{
printf( "GL Context creation suceeded.\n" );
Expand Down

0 comments on commit 834c79d

Please sign in to comment.