[Mesa-dev] [PATCH v3 2/5] glsl: add support for the imageSize builtin
Pohjolainen, Topi
topi.pohjolainen at intel.com
Thu Aug 13 22:42:59 PDT 2015
On Thu, Aug 13, 2015 at 07:58:53PM +0300, Martin Peres wrote:
> The code is heavily inspired from Francisco Jerez's code supporting the
> image_load_store extension.
>
> Backends willing to support this builtin should handle
> __intrinsic_image_size.
>
> v2: Based on the review of Ilia Mirkin
> - Enable the extension for GLES 3.1
> - Fix indentation
> - Fix the return type (float to int, number of components for CubeImages)
> - Add a warning related to GLES 3.1
>
> v3: Based on the review of Francisco Jerez
> - Refactor the code to share both add_image_function and _image with the other
> image-related functions
>
> Signed-off-by: Martin Peres <martin.peres at linux.intel.com>
> ---
> src/glsl/builtin_functions.cpp | 109 +++++++++++++++++++++++++++++++++++------
> 1 file changed, 93 insertions(+), 16 deletions(-)
>
> diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
> index 2175c66..5d0a825 100644
> --- a/src/glsl/builtin_functions.cpp
> +++ b/src/glsl/builtin_functions.cpp
> @@ -399,6 +399,13 @@ shader_image_load_store(const _mesa_glsl_parse_state *state)
> }
>
> static bool
> +shader_image_size(const _mesa_glsl_parse_state *state)
> +{
> + return (state->is_version(430, 310) ||
> + state->ARB_shader_image_size_enable);
You can drop the extra ().
More information about the mesa-dev
mailing list