[Mesa-dev] [PATCH 15/20] glsl/es3.1: Allow textureGather and textureGatherOffset in GLSL ES 3.10
Chris Forbes
chrisf at ijw.co.nz
Thu Apr 30 14:56:52 PDT 2015
> /* Only ARB_texture_gather but not GLSL 4.0 or ARB_gpu_shader5.
> * used for relaxation of const offset requirements.
> */
> static bool
> -texture_gather_only(const _mesa_glsl_parse_state *state)
> +texture_gather_only_or_es31(const _mesa_glsl_parse_state *state)
> {
> return !state->is_version(400, 0) &&
> !state->ARB_gpu_shader5_enable &&
> - state->ARB_texture_gather_enable;
> + (state->ARB_texture_gather_enable ||
> + state->is_version(0, 310));
> }
I don't think this is correct. This is used to enable the restricted
versions of textureGather/textureGatherOffset which require a constant
offset. This restriction doesn't appear to exist in ES3.1 -- it's more
or less the GS5 version.
An example pair, where at most one should be enabled:
_texture(ir_tg4, texture_gather_only, glsl_type::vec4_type,
glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET),
_texture(ir_tg4, gpu_shader5, glsl_type::vec4_type,
glsl_type::sampler2D_type, glsl_type::vec2_type, TEX_OFFSET_NONCONST),
- Chris
More information about the mesa-dev
mailing list