mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-06-08 11:23:52 +00:00
Fixed texture array support for embedded shaders.
This commit is contained in:
@@ -161,6 +161,7 @@ lod_exists_in_stage(const _mesa_glsl_parse_state *state)
|
||||
*/
|
||||
return state->stage == MESA_SHADER_VERTEX ||
|
||||
state->is_version(130, 300) ||
|
||||
state->EXT_texture_array_enable || /* BK - don't complain about texture array in fragment shaders. */
|
||||
state->ARB_shader_texture_lod_enable;
|
||||
}
|
||||
|
||||
|
||||
@@ -570,7 +570,7 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
|
||||
EXT(EXT_shader_integer_mix, true, true, EXT_shader_integer_mix),
|
||||
EXT(EXT_shader_texture_lod, false, true, ARB_shader_texture_lod),
|
||||
EXT(EXT_shadow_samplers, false, true, EXT_shadow_samplers),
|
||||
EXT(EXT_texture_array, true, false, EXT_texture_array),
|
||||
EXT(EXT_texture_array, true, true, EXT_texture_array), // BK - made it available in ESSL
|
||||
};
|
||||
|
||||
#undef EXT
|
||||
|
||||
@@ -362,6 +362,10 @@ float bgfxShadow2DProj(sampler2DShadow _sampler, vec4 _coord)
|
||||
# define texture2D(_sampler, _coord) tex2D(_sampler, _coord)
|
||||
# define texture2DProj(_sampler, _coord) bgfxTexture2DProj(_sampler, _coord)
|
||||
|
||||
# define SAMPLER2DARRAY(_name, _reg) SAMPLER2D(_name, _reg)
|
||||
# define texture2DArray(_sampler, _coord) texture2D(_sampler, (_coord).xy)
|
||||
# define texture2DArrayLod(_sampler, _coord, _lod) texture2DLod(_sampler, _coord, _lod)
|
||||
|
||||
# define SAMPLER2DSHADOW(_name, _reg) uniform sampler2DShadow _name : REGISTER(s, _reg)
|
||||
# define shadow2D(_sampler, _coord) bgfxShadow2D(_sampler, _coord)
|
||||
# define shadow2DProj(_sampler, _coord) bgfxShadow2DProj(_sampler, _coord)
|
||||
|
||||
Reference in New Issue
Block a user