sdl-gpu icon indicating copy to clipboard operation
sdl-gpu copied to clipboard

GLSL version #120 is no longer supported on the Mac

Open ThrudTheBarbarian opened this issue 3 years ago • 0 comments

I got SDL_GPU working by changing the code to change the version from #120 to #150, and rewriting the shaders to be 150-compliant:

  • shader inputs are 'in' not 'attribute'
  • shader outputs are 'out' not 'varying'
  • fragment shader outputs go to a user-defined 'out vec4 fragColor' instead of a predefined gl_FragColor
  • fragment shader 'texture2D' calls are just 'texture' calls

This because on OSX Monterey at least, I see in the 'GPU_Renderer' struct:

min_shader_version int 150 max_shader_version int 410

... so it fails to load the #version 120 code.

ThrudTheBarbarian avatar Dec 29 '21 00:12 ThrudTheBarbarian