Actually fix shaders for amd gpus.

This commit is contained in:
Relintai 2025-02-19 16:31:16 +01:00
parent ade786cd55
commit 3ecea44801
7 changed files with 28 additions and 14 deletions

View File

@ -44,8 +44,10 @@ String ColorMaterial::get_vertex_shader_source() {
String ColorMaterial::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"varying vec4 v_color;\n"
"\n"

View File

@ -49,8 +49,10 @@ String ColorMaterial2D::get_vertex_shader_source() {
String ColorMaterial2D::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"varying vec4 v_color;\n"
"\n"

View File

@ -40,8 +40,10 @@ String ColoredMaterial::get_vertex_shader_source() {
String ColoredMaterial::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"\n"
"uniform vec4 fragment_color;\n"

View File

@ -59,8 +59,10 @@ String FontMaterial::get_vertex_shader_source() {
String FontMaterial::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"\n"
"uniform sampler2D u_texture;\n"

View File

@ -60,8 +60,10 @@ String TextureMaterial::get_vertex_shader_source() {
String TextureMaterial::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"uniform sampler2D u_texture;\n"
"\n"

View File

@ -56,8 +56,10 @@ String TextureMaterial2D::get_vertex_shader_source() {
String TextureMaterial2D::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"\n"
"uniform sampler2D u_texture;\n"

View File

@ -56,8 +56,10 @@ String TransparentTextureMaterial::get_vertex_shader_source() {
String TransparentTextureMaterial::get_fragment_shader_source() {
static const char *fragment_shader_source[] = {
#ifndef __APPLE__
"precision mediump float;\n"
"\n"
"#version 100\n"
"#ifdef GL_ES\n"
" precision mediump float;\n"
"#endif\n"
#endif
"uniform sampler2D u_texture;\n"
"\n"