Ver código fonte

gpu: fix OpenGL context creation and shader patching on macOS Catalina.

legacy
Sam Hocevar 4 anos atrás
pai
commit
fd1c5f5cd4
2 arquivos alterados com 8 adições e 0 exclusões
  1. +3
    -0
      src/application/sdl-app.cpp
  2. +5
    -0
      src/gpu/shader.cpp

+ 3
- 0
src/application/sdl-app.cpp Ver arquivo

@@ -56,6 +56,9 @@ sdl::app_display::app_display(char const *title, ivec2 res)
// Ask for GL 3.2 at least
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2);
#if __APPLE__
SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
#endif

#if LOL_BUILD_DEBUG
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);


+ 5
- 0
src/gpu/shader.cpp Ver arquivo

@@ -653,6 +653,10 @@ std::string ShaderData::Patch(std::string const &code, ShaderType type)
/* Perform small replaces */
char const * const fast_replaces[] =
{
#if __APPLE__
"#version 130", "#version 150",
"texture2D", "texture",
#else
"#version 130", "#version 120",
"out vec4 out_color;", " ",
"out_color =", "gl_FragColor =",
@@ -664,6 +668,7 @@ std::string ShaderData::Patch(std::string const &code, ShaderType type)
"out vec3", "varying vec3",
"out vec4", "varying vec4",
"out mat4", "varying mat4",
#endif
nullptr
};



Carregando…
Cancelar
Salvar