mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Fixed GLES3 shader patching.
This commit is contained in:
parent
b4dc2d4ea1
commit
c49656c473
1 changed files with 14 additions and 4 deletions
|
@ -1382,8 +1382,8 @@ namespace bgfx
|
|||
}
|
||||
}
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 31)
|
||||
|| BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 31) )
|
||||
// || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
|
||||
{
|
||||
s_textureFormat[TextureFormat::R8].m_internalFmt = GL_R8;
|
||||
s_textureFormat[TextureFormat::R8].m_fmt = GL_RED;
|
||||
|
@ -2641,8 +2641,18 @@ namespace bgfx
|
|||
writeString(&writer, "#define texture2D texture\n");
|
||||
writeString(&writer, "#define texture2DLod textureLod\n");
|
||||
writeString(&writer, "#define texture2DProj textureProj\n");
|
||||
writeString(&writer, "#define shadow2D(_sampler, _coord) vec2(textureProj(_sampler, vec4(_coord, 1.0) ) )\n");
|
||||
writeString(&writer, "#define shadow2DProj(_sampler, _coord) vec2(textureProj(_sampler, _coord) ) )\n");
|
||||
|
||||
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
|
||||
{
|
||||
writeString(&writer, "#define shadow2D(_sampler, _coord) vec2(textureProj(_sampler, vec4(_coord, 1.0) ) )\n");
|
||||
writeString(&writer, "#define shadow2DProj(_sampler, _coord) vec2(textureProj(_sampler, _coord) ) )\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
writeString(&writer, "#define shadow2D(_sampler, _coord) (textureProj(_sampler, vec4(_coord, 1.0) ) )\n");
|
||||
writeString(&writer, "#define shadow2DProj(_sampler, _coord) (textureProj(_sampler, _coord) ) )\n");
|
||||
}
|
||||
|
||||
writeString(&writer, "#define texture3D texture\n");
|
||||
writeString(&writer, "#define texture3DLod textureLod\n");
|
||||
writeString(&writer, "#define textureCube texture\n");
|
||||
|
|
Loading…
Reference in a new issue