mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-30 13:24:16 +01:00
gles: fix crashing on mali gpus (#6956)
* gles: reorder framebuffer fetch extension directives * Address review comments
This commit is contained in:
parent
0b0d3a4ac3
commit
bbb47cd753
@ -1351,21 +1351,22 @@ ShaderDecompiler::ProgramResult GenerateFragmentShader(const PicaFSConfig& confi
|
|||||||
out += "#extension GL_ARB_separate_shader_objects : enable\n";
|
out += "#extension GL_ARB_separate_shader_objects : enable\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GLES) {
|
// The extension directives need to come before non-preprocessor tokens
|
||||||
out += fragment_shader_precision_OES;
|
|
||||||
}
|
|
||||||
|
|
||||||
out += R"(
|
out += R"(
|
||||||
#if defined(GL_EXT_shader_framebuffer_fetch)
|
#if defined(GL_EXT_shader_framebuffer_fetch)
|
||||||
#extension GL_EXT_shader_framebuffer_fetch : enable
|
#extension GL_EXT_shader_framebuffer_fetch : enable
|
||||||
#elif defined(GL_ARM_shader_framebuffer_fetch)
|
#elif defined(GL_ARM_shader_framebuffer_fetch)
|
||||||
#extension GL_ARM_shader_framebuffer_fetch : enable
|
#extension GL_ARM_shader_framebuffer_fetch : enable
|
||||||
#else
|
#else
|
||||||
layout(location = 10) uniform sampler2D colorBuffer;
|
#define CITRA_NO_FRAMEBUFFER_FETCH 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
)";
|
)";
|
||||||
|
|
||||||
|
if (GLES) {
|
||||||
|
out += fragment_shader_precision_OES;
|
||||||
|
}
|
||||||
|
|
||||||
out += GetVertexInterfaceDeclaration(false, separable_shader);
|
out += GetVertexInterfaceDeclaration(false, separable_shader);
|
||||||
|
|
||||||
out += R"(
|
out += R"(
|
||||||
@ -1391,6 +1392,10 @@ layout(binding = 3, r32ui) uniform readonly uimage2D shadow_texture_ny;
|
|||||||
layout(binding = 4, r32ui) uniform readonly uimage2D shadow_texture_pz;
|
layout(binding = 4, r32ui) uniform readonly uimage2D shadow_texture_pz;
|
||||||
layout(binding = 5, r32ui) uniform readonly uimage2D shadow_texture_nz;
|
layout(binding = 5, r32ui) uniform readonly uimage2D shadow_texture_nz;
|
||||||
layout(binding = 6, r32ui) uniform uimage2D shadow_buffer;
|
layout(binding = 6, r32ui) uniform uimage2D shadow_buffer;
|
||||||
|
|
||||||
|
#if defined(CITRA_NO_FRAMEBUFFER_FETCH)
|
||||||
|
layout(location = 10) uniform sampler2D colorBuffer;
|
||||||
|
#endif
|
||||||
)";
|
)";
|
||||||
|
|
||||||
out += UniformBlockDef;
|
out += UniformBlockDef;
|
||||||
|
Loading…
Reference in New Issue
Block a user