glsl: Implement the required built-in functions when OES_shader_image_atomic is enabled.
authorFrancisco Jerez <currojerez@riseup.net>
Fri, 21 Aug 2015 11:12:22 +0000 (14:12 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Tue, 23 Feb 2016 03:56:54 +0000 (19:56 -0800)
commit81c16a2dabf9903ca85b8a27002a354e223fa7cc
treed60f7ab1dc589a86072af23266c1a05a0872f4d4
parentbe125af95ece0f24ca09fefeda6b5ab84478212b
glsl: Implement the required built-in functions when OES_shader_image_atomic is enabled.

This is basically just the same atomic functions exposed by
ARB_shader_image_load_store, with one exception:

    "highp float imageAtomicExchange(
         coherent IMAGE_PARAMS,
         float data);"

There's no float atomic exchange overload in the original
ARB_shader_image_load_store or GL 4.2, so this seems like new
functionality that requires specific back-end support and a separate
availability condition in the built-in function generator.

v2: Move image availability predicate logic into a separate static
    function for clarity.  Had to pull out the image_function_flags
    enum from the builtin_builder class for that to be possible.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/compiler/glsl/builtin_functions.cpp