Commit eadc387c by Jonah Ryan-Davis Committed by Commit Bot

GL: Support GL_OES_texture_cube_map_array in shader translator

GL_OES_texture_cube_map_array is core in 3.2. This CL adds support for this extension in the shader translator. Now passes dEQP.KHR_GLES31/core_texture_cube_map_array.*, dEQP.GLES31/functional_fbo_color_texcubearray_*, and dEQP.GLES31/functional_opaque_type_indexing*samplercubearray* with GL backend. Bug: angleproject:3584 Change-Id: I1a8485c7d9d3fffb9b5109d292b35b0c56a3c665 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2133086Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent 7fde3673
...@@ -399,6 +399,8 @@ struct ShBuiltInResources ...@@ -399,6 +399,8 @@ struct ShBuiltInResources
int ANGLE_base_vertex_base_instance; int ANGLE_base_vertex_base_instance;
int WEBGL_video_texture; int WEBGL_video_texture;
int APPLE_clip_distance; int APPLE_clip_distance;
int OES_texture_cube_map_array;
int EXT_texture_cube_map_array;
// Set to 1 to enable replacing GL_EXT_draw_buffers #extension directives // Set to 1 to enable replacing GL_EXT_draw_buffers #extension directives
// with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate // with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate
......
...@@ -4,15 +4,15 @@ ...@@ -4,15 +4,15 @@
"src/compiler/translator/generate_parser.py": "src/compiler/translator/generate_parser.py":
"566178ecdfae3a29803b3687fc518ebb", "566178ecdfae3a29803b3687fc518ebb",
"src/compiler/translator/glslang.l": "src/compiler/translator/glslang.l":
"76676b64d51f4312e8060f4a00bc8f1b", "5af9feeb7ba8549265f8d19ec7f43343",
"src/compiler/translator/glslang.y": "src/compiler/translator/glslang.y":
"609c38a1997b77a9affec84541daf9c9", "1619aa1587a5fae94df9d143af732b77",
"src/compiler/translator/glslang_lex_autogen.cpp": "src/compiler/translator/glslang_lex_autogen.cpp":
"edc229f6d1b48f8588301219df80760e", "4b94107e3314432cfdc8f9e90909e5a0",
"src/compiler/translator/glslang_tab_autogen.cpp": "src/compiler/translator/glslang_tab_autogen.cpp":
"8872811534b4e8aeef0df354bbd05044", "fc0ab4cb3179dc0d936ed9d56bb2dbd0",
"src/compiler/translator/glslang_tab_autogen.h": "src/compiler/translator/glslang_tab_autogen.h":
"1bb42872dd5fd0a6f647201b142b67b6", "7be1b46407ec9671626ef3594bcec57e",
"tools/flex-bison/linux/bison.sha1": "tools/flex-bison/linux/bison.sha1":
"efa86001f00e7bcfdbe899dd15fc88e0", "efa86001f00e7bcfdbe899dd15fc88e0",
"tools/flex-bison/linux/flex.sha1": "tools/flex-bison/linux/flex.sha1":
......
{ {
"src/compiler/translator/ImmutableString_ESSL_autogen.cpp": "src/compiler/translator/ImmutableString_ESSL_autogen.cpp":
"0025705dc18b69c702b64644806a799c", "0ea93a3bc04293f610fdbfae45f8e436",
"src/compiler/translator/ImmutableString_autogen.cpp": "src/compiler/translator/ImmutableString_autogen.cpp":
"0af0ec12d54ecc032b74b58dd3526129", "f3b0095f9f8669520698c845085ab62e",
"src/compiler/translator/ParseContext_ESSL_autogen.h": "src/compiler/translator/ParseContext_ESSL_autogen.h":
"c753d946807cca10df7f50ca2db8a47a", "45035f9e1e7cd735476fc250e034bc72",
"src/compiler/translator/ParseContext_complete_autogen.h": "src/compiler/translator/ParseContext_complete_autogen.h":
"dc88a43c877a9955c909e73c4da34176", "d116f43b2e3b61a73b26b301be561e0b",
"src/compiler/translator/SymbolTable_ESSL_autogen.cpp": "src/compiler/translator/SymbolTable_ESSL_autogen.cpp":
"98e1c96985096c1bbe0625983f67a23e", "6f3e49f813ca1fa93de47514b3390dfe",
"src/compiler/translator/SymbolTable_autogen.cpp": "src/compiler/translator/SymbolTable_autogen.cpp":
"73ac6e5df17521d8cd6734450a9788a0", "912d1ec634bf4178d310de6db46066f3",
"src/compiler/translator/SymbolTable_autogen.h": "src/compiler/translator/SymbolTable_autogen.h":
"2d8bed6ff5debc6546199a2add316a66", "2d8bed6ff5debc6546199a2add316a66",
"src/compiler/translator/builtin_function_declarations.txt": "src/compiler/translator/builtin_function_declarations.txt":
"e4a0add049ebbaa8dc5b6c630816b7f8", "52e0dd28d8be3a0430b70c23d2b060aa",
"src/compiler/translator/builtin_variables.json": "src/compiler/translator/builtin_variables.json":
"98d347a6ed181eca3d89bfd73193d787", "98d347a6ed181eca3d89bfd73193d787",
"src/compiler/translator/gen_builtin_symbols.py": "src/compiler/translator/gen_builtin_symbols.py":
"ef6fde209ca86ffb1752fc3a5b9d72d7", "ef6fde209ca86ffb1752fc3a5b9d72d7",
"src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h": "src/compiler/translator/tree_util/BuiltIn_ESSL_autogen.h":
"aa5d8059a42adb2fb833c84e86726b95", "2ca793d3326d9e39e7d4ffbca7041e52",
"src/compiler/translator/tree_util/BuiltIn_complete_autogen.h": "src/compiler/translator/tree_util/BuiltIn_complete_autogen.h":
"cf8312c854b06d9fe4ede0daa67b5060", "f3713a80fc4ffee53ba4992cc275d5b7",
"src/tests/compiler_tests/ImmutableString_test_ESSL_autogen.cpp": "src/tests/compiler_tests/ImmutableString_test_ESSL_autogen.cpp":
"f3a7e48b43b08c17682a3bb5502fc016", "14cbdec9c41ae4a27910347b2c5e59ef",
"src/tests/compiler_tests/ImmutableString_test_autogen.cpp": "src/tests/compiler_tests/ImmutableString_test_autogen.cpp":
"673110e754ad8ea6939a736b88a781bc" "d368befd9e4c194c5f6b987b3628a184"
} }
\ No newline at end of file
{ {
"src/common/gen_uniform_type_table.py": "src/common/gen_uniform_type_table.py":
"f7a7846f21da3406f79dcd9a4cb394e8", "43f21df292ca1864166cc93ed59f2b66",
"src/common/uniform_type_info_autogen.cpp": "src/common/uniform_type_info_autogen.cpp":
"417dddc7510f3d3fa71345f8838e323e" "ecffb0755d6051d656f9b68e3d7eea72"
} }
\ No newline at end of file
...@@ -16,19 +16,23 @@ all_uniform_types = [ ...@@ -16,19 +16,23 @@ all_uniform_types = [
"GL_FLOAT_MAT2", "GL_FLOAT_MAT2x3", "GL_FLOAT_MAT2x4", "GL_FLOAT_MAT3", "GL_FLOAT_MAT3x2", "GL_FLOAT_MAT2", "GL_FLOAT_MAT2x3", "GL_FLOAT_MAT2x4", "GL_FLOAT_MAT3", "GL_FLOAT_MAT3x2",
"GL_FLOAT_MAT3x4", "GL_FLOAT_MAT4", "GL_FLOAT_MAT4x2", "GL_FLOAT_MAT4x3", "GL_FLOAT_VEC2", "GL_FLOAT_MAT3x4", "GL_FLOAT_MAT4", "GL_FLOAT_MAT4x2", "GL_FLOAT_MAT4x3", "GL_FLOAT_VEC2",
"GL_FLOAT_VEC3", "GL_FLOAT_VEC4", "GL_IMAGE_2D", "GL_IMAGE_2D_ARRAY", "GL_IMAGE_3D", "GL_FLOAT_VEC3", "GL_FLOAT_VEC4", "GL_IMAGE_2D", "GL_IMAGE_2D_ARRAY", "GL_IMAGE_3D",
"GL_IMAGE_CUBE", "GL_INT", "GL_INT_IMAGE_2D", "GL_INT_IMAGE_2D_ARRAY", "GL_INT_IMAGE_3D", "GL_IMAGE_CUBE", "GL_IMAGE_CUBE_MAP_ARRAY", "GL_INT", "GL_INT_IMAGE_2D",
"GL_INT_IMAGE_CUBE", "GL_INT_SAMPLER_2D", "GL_INT_SAMPLER_2D_ARRAY", "GL_INT_IMAGE_2D_ARRAY", "GL_INT_IMAGE_3D", "GL_INT_IMAGE_CUBE", "GL_INT_IMAGE_CUBE_MAP_ARRAY",
"GL_INT_SAMPLER_2D_MULTISAMPLE", "GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY", "GL_INT_SAMPLER_3D", "GL_INT_SAMPLER_2D", "GL_INT_SAMPLER_2D_ARRAY", "GL_INT_SAMPLER_2D_MULTISAMPLE",
"GL_INT_SAMPLER_CUBE", "GL_INT_VEC2", "GL_INT_VEC3", "GL_INT_VEC4", "GL_SAMPLER_2D", "GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY", "GL_INT_SAMPLER_3D", "GL_INT_SAMPLER_CUBE",
"GL_INT_SAMPLER_CUBE_MAP_ARRAY", "GL_INT_VEC2", "GL_INT_VEC3", "GL_INT_VEC4", "GL_SAMPLER_2D",
"GL_SAMPLER_2D_ARRAY", "GL_SAMPLER_2D_ARRAY_SHADOW", "GL_SAMPLER_2D_MULTISAMPLE", "GL_SAMPLER_2D_ARRAY", "GL_SAMPLER_2D_ARRAY_SHADOW", "GL_SAMPLER_2D_MULTISAMPLE",
"GL_SAMPLER_2D_MULTISAMPLE_ARRAY", "GL_SAMPLER_2D_RECT_ANGLE", "GL_SAMPLER_2D_SHADOW", "GL_SAMPLER_2D_MULTISAMPLE_ARRAY", "GL_SAMPLER_2D_RECT_ANGLE", "GL_SAMPLER_2D_SHADOW",
"GL_SAMPLER_3D", "GL_SAMPLER_CUBE", "GL_SAMPLER_CUBE_SHADOW", "GL_SAMPLER_EXTERNAL_OES", "GL_SAMPLER_3D", "GL_SAMPLER_CUBE", "GL_SAMPLER_CUBE_MAP_ARRAY", "GL_SAMPLER_CUBE_SHADOW",
"GL_UNSIGNED_INT", "GL_UNSIGNED_INT_ATOMIC_COUNTER", "GL_UNSIGNED_INT_IMAGE_2D", "GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW", "GL_SAMPLER_EXTERNAL_OES", "GL_UNSIGNED_INT",
"GL_UNSIGNED_INT_IMAGE_2D_ARRAY", "GL_UNSIGNED_INT_IMAGE_3D", "GL_UNSIGNED_INT_IMAGE_CUBE", "GL_UNSIGNED_INT_ATOMIC_COUNTER", "GL_UNSIGNED_INT_IMAGE_2D", "GL_UNSIGNED_INT_IMAGE_2D_ARRAY",
"GL_UNSIGNED_INT_SAMPLER_2D", "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY", "GL_UNSIGNED_INT_IMAGE_3D", "GL_UNSIGNED_INT_IMAGE_CUBE",
"GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE", "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY", "GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY", "GL_UNSIGNED_INT_SAMPLER_2D",
"GL_UNSIGNED_INT_SAMPLER_3D", "GL_UNSIGNED_INT_SAMPLER_CUBE", "GL_UNSIGNED_INT_VEC2", "GL_UNSIGNED_INT_SAMPLER_2D_ARRAY", "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE",
"GL_UNSIGNED_INT_VEC3", "GL_UNSIGNED_INT_VEC4", "GL_SAMPLER_VIDEO_IMAGE_WEBGL" "GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY", "GL_UNSIGNED_INT_SAMPLER_3D",
"GL_UNSIGNED_INT_SAMPLER_CUBE", "GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY",
"GL_UNSIGNED_INT_VEC2", "GL_UNSIGNED_INT_VEC3", "GL_UNSIGNED_INT_VEC4",
"GL_SAMPLER_VIDEO_IMAGE_WEBGL"
] ]
# Uniform texture types. Be wary of substrings finding the wrong types. # Uniform texture types. Be wary of substrings finding the wrong types.
...@@ -46,6 +50,7 @@ texture_types = { ...@@ -46,6 +50,7 @@ texture_types = {
"CUBE_SHADOW": "CUBE_MAP", "CUBE_SHADOW": "CUBE_MAP",
"EXTERNAL_OES": "EXTERNAL_OES", "EXTERNAL_OES": "EXTERNAL_OES",
"RECT": "RECTANGLE", "RECT": "RECTANGLE",
"CUBE_MAP_ARRAY": "CUBE_MAP_ARRAY",
"VIDEO_IMAGE_WEBGL": "VIDEO_IMAGE_WEBGL", "VIDEO_IMAGE_WEBGL": "VIDEO_IMAGE_WEBGL",
} }
......
...@@ -163,6 +163,9 @@ GLenum VariableComponentType(GLenum type) ...@@ -163,6 +163,9 @@ GLenum VariableComponentType(GLenum type)
case GL_IMAGE_CUBE: case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE: case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE:
case GL_IMAGE_CUBE_MAP_ARRAY:
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_ATOMIC_COUNTER: case GL_UNSIGNED_INT_ATOMIC_COUNTER:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL: case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
return GL_INT; return GL_INT;
...@@ -313,21 +316,25 @@ int VariableRowCount(GLenum type) ...@@ -313,21 +316,25 @@ int VariableRowCount(GLenum type)
case GL_SAMPLER_2D_RECT_ANGLE: case GL_SAMPLER_2D_RECT_ANGLE:
case GL_SAMPLER_2D_MULTISAMPLE: case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_CUBE_MAP_ARRAY:
case GL_INT_SAMPLER_2D: case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D: case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE: case GL_INT_SAMPLER_CUBE:
case GL_INT_SAMPLER_2D_ARRAY: case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE: case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D: case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE: case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_SAMPLER_2D_SHADOW: case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW: case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW: case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
case GL_IMAGE_2D: case GL_IMAGE_2D:
case GL_INT_IMAGE_2D: case GL_INT_IMAGE_2D:
case GL_UNSIGNED_INT_IMAGE_2D: case GL_UNSIGNED_INT_IMAGE_2D:
...@@ -341,6 +348,9 @@ int VariableRowCount(GLenum type) ...@@ -341,6 +348,9 @@ int VariableRowCount(GLenum type)
case GL_INT_IMAGE_CUBE: case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_ATOMIC_COUNTER: case GL_UNSIGNED_INT_ATOMIC_COUNTER:
case GL_IMAGE_CUBE_MAP_ARRAY:
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL: case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
return 1; return 1;
case GL_FLOAT_MAT2: case GL_FLOAT_MAT2:
...@@ -378,12 +388,14 @@ int VariableColumnCount(GLenum type) ...@@ -378,12 +388,14 @@ int VariableColumnCount(GLenum type)
case GL_SAMPLER_2D_ARRAY: case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_MULTISAMPLE: case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_CUBE_MAP_ARRAY:
case GL_INT_SAMPLER_2D: case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D: case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE: case GL_INT_SAMPLER_CUBE:
case GL_INT_SAMPLER_2D_ARRAY: case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE: case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_SAMPLER_EXTERNAL_OES: case GL_SAMPLER_EXTERNAL_OES:
case GL_SAMPLER_2D_RECT_ANGLE: case GL_SAMPLER_2D_RECT_ANGLE:
case GL_UNSIGNED_INT_SAMPLER_2D: case GL_UNSIGNED_INT_SAMPLER_2D:
...@@ -392,9 +404,11 @@ int VariableColumnCount(GLenum type) ...@@ -392,9 +404,11 @@ int VariableColumnCount(GLenum type)
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE: case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_SAMPLER_2D_SHADOW: case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW: case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW: case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
case GL_IMAGE_2D: case GL_IMAGE_2D:
case GL_INT_IMAGE_2D: case GL_INT_IMAGE_2D:
case GL_UNSIGNED_INT_IMAGE_2D: case GL_UNSIGNED_INT_IMAGE_2D:
...@@ -404,6 +418,9 @@ int VariableColumnCount(GLenum type) ...@@ -404,6 +418,9 @@ int VariableColumnCount(GLenum type)
case GL_IMAGE_2D_ARRAY: case GL_IMAGE_2D_ARRAY:
case GL_INT_IMAGE_2D_ARRAY: case GL_INT_IMAGE_2D_ARRAY:
case GL_UNSIGNED_INT_IMAGE_2D_ARRAY: case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
case GL_IMAGE_CUBE_MAP_ARRAY:
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_IMAGE_CUBE: case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE: case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE:
...@@ -452,6 +469,7 @@ bool IsSamplerType(GLenum type) ...@@ -452,6 +469,7 @@ bool IsSamplerType(GLenum type)
case GL_SAMPLER_EXTERNAL_OES: case GL_SAMPLER_EXTERNAL_OES:
case GL_SAMPLER_2D_MULTISAMPLE: case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_SAMPLER_CUBE_MAP_ARRAY:
case GL_SAMPLER_2D_RECT_ANGLE: case GL_SAMPLER_2D_RECT_ANGLE:
case GL_INT_SAMPLER_2D: case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D: case GL_INT_SAMPLER_3D:
...@@ -459,15 +477,18 @@ bool IsSamplerType(GLenum type) ...@@ -459,15 +477,18 @@ bool IsSamplerType(GLenum type)
case GL_INT_SAMPLER_2D_ARRAY: case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE: case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D: case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D: case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE: case GL_UNSIGNED_INT_SAMPLER_CUBE:
case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE: case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY: case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY:
case GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY:
case GL_SAMPLER_2D_SHADOW: case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_CUBE_SHADOW: case GL_SAMPLER_CUBE_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW: case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW:
case GL_SAMPLER_VIDEO_IMAGE_WEBGL: case GL_SAMPLER_VIDEO_IMAGE_WEBGL:
return true; return true;
} }
...@@ -502,6 +523,9 @@ bool IsImageType(GLenum type) ...@@ -502,6 +523,9 @@ bool IsImageType(GLenum type)
case GL_IMAGE_2D_ARRAY: case GL_IMAGE_2D_ARRAY:
case GL_INT_IMAGE_2D_ARRAY: case GL_INT_IMAGE_2D_ARRAY:
case GL_UNSIGNED_INT_IMAGE_2D_ARRAY: case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
case GL_IMAGE_CUBE_MAP_ARRAY:
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_IMAGE_CUBE: case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE: case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE:
...@@ -524,6 +548,9 @@ bool IsImage2DType(GLenum type) ...@@ -524,6 +548,9 @@ bool IsImage2DType(GLenum type)
case GL_IMAGE_2D_ARRAY: case GL_IMAGE_2D_ARRAY:
case GL_INT_IMAGE_2D_ARRAY: case GL_INT_IMAGE_2D_ARRAY:
case GL_UNSIGNED_INT_IMAGE_2D_ARRAY: case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
case GL_IMAGE_CUBE_MAP_ARRAY:
case GL_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY:
case GL_IMAGE_CUBE: case GL_IMAGE_CUBE:
case GL_INT_IMAGE_CUBE: case GL_INT_IMAGE_CUBE:
case GL_UNSIGNED_INT_IMAGE_CUBE: case GL_UNSIGNED_INT_IMAGE_CUBE:
......
...@@ -1087,6 +1087,8 @@ void TCompiler::setResourceString() ...@@ -1087,6 +1087,8 @@ void TCompiler::setResourceString()
<< ":ANGLE_multi_draw:" << mResources.ANGLE_multi_draw << ":ANGLE_multi_draw:" << mResources.ANGLE_multi_draw
<< ":ANGLE_base_vertex_base_instance:" << mResources.ANGLE_base_vertex_base_instance << ":ANGLE_base_vertex_base_instance:" << mResources.ANGLE_base_vertex_base_instance
<< ":APPLE_clip_distance:" << mResources.APPLE_clip_distance << ":APPLE_clip_distance:" << mResources.APPLE_clip_distance
<< ":OES_texture_cube_map_array:" << mResources.OES_texture_cube_map_array
<< ":EXT_texture_cube_map_array:" << mResources.EXT_texture_cube_map_array
<< ":MinProgramTextureGatherOffset:" << mResources.MinProgramTextureGatherOffset << ":MinProgramTextureGatherOffset:" << mResources.MinProgramTextureGatherOffset
<< ":MaxProgramTextureGatherOffset:" << mResources.MaxProgramTextureGatherOffset << ":MaxProgramTextureGatherOffset:" << mResources.MaxProgramTextureGatherOffset
<< ":MaxImageUnits:" << mResources.MaxImageUnits << ":MaxImageUnits:" << mResources.MaxImageUnits
......
...@@ -38,7 +38,9 @@ ...@@ -38,7 +38,9 @@
OP(ANGLE_multi_draw) \ OP(ANGLE_multi_draw) \
OP(ANGLE_base_vertex_base_instance) \ OP(ANGLE_base_vertex_base_instance) \
OP(WEBGL_video_texture) \ OP(WEBGL_video_texture) \
OP(APPLE_clip_distance) OP(APPLE_clip_distance) \
OP(OES_texture_cube_map_array) \
OP(EXT_texture_cube_map_array)
namespace sh namespace sh
{ {
......
...@@ -45,6 +45,8 @@ enum class TExtension : uint8_t ...@@ -45,6 +45,8 @@ enum class TExtension : uint8_t
ANGLE_base_vertex_base_instance, ANGLE_base_vertex_base_instance,
WEBGL_video_texture, WEBGL_video_texture,
APPLE_clip_distance, APPLE_clip_distance,
OES_texture_cube_map_array,
EXT_texture_cube_map_array,
}; };
enum TBehavior : uint8_t enum TBehavior : uint8_t
......
...@@ -117,6 +117,14 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi ...@@ -117,6 +117,14 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{ {
extBehavior[TExtension::APPLE_clip_distance] = EBhUndefined; extBehavior[TExtension::APPLE_clip_distance] = EBhUndefined;
} }
if (resources.OES_texture_cube_map_array)
{
extBehavior[TExtension::OES_texture_cube_map_array] = EBhUndefined;
}
if (resources.EXT_texture_cube_map_array)
{
extBehavior[TExtension::EXT_texture_cube_map_array] = EBhUndefined;
}
} }
void ResetExtensionBehavior(const ShBuiltInResources &resources, void ResetExtensionBehavior(const ShBuiltInResources &resources,
...@@ -137,8 +145,8 @@ void ResetExtensionBehavior(const ShBuiltInResources &resources, ...@@ -137,8 +145,8 @@ void ResetExtensionBehavior(const ShBuiltInResources &resources,
else else
{ {
// Restore ARB_texture_rectangle in case it was removed during an earlier reset. As // Restore ARB_texture_rectangle in case it was removed during an earlier reset. As
// noted above, it doesn't follow the standard for extension directives and is enabled // noted above, it doesn't follow the standard for extension directives and is
// by default. // enabled by default.
extBehavior[TExtension::ARB_texture_rectangle] = EBhEnable; extBehavior[TExtension::ARB_texture_rectangle] = EBhEnable;
} }
} }
......
...@@ -21,67 +21,67 @@ namespace BuiltInGroup ...@@ -21,67 +21,67 @@ namespace BuiltInGroup
bool isTextureOffsetNoBias(const TFunction *func) bool isTextureOffsetNoBias(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3060 && id <= 3129; return id >= 3094 && id <= 3163;
} }
bool isTextureOffsetBias(const TFunction *func) bool isTextureOffsetBias(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3130 && id <= 3149; return id >= 3164 && id <= 3183;
} }
bool isTextureGatherOffsetsComp(const TFunction *func) bool isTextureGatherOffsetsComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3187 && id <= 3199; return id >= 3221 && id <= 3233;
} }
bool isTextureGatherOffsetsNoComp(const TFunction *func) bool isTextureGatherOffsetsNoComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3200 && id <= 3215; return id >= 3234 && id <= 3249;
} }
bool isTextureGatherOffsets(const TFunction *func) bool isTextureGatherOffsets(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3187 && id <= 3215; return id >= 3221 && id <= 3249;
} }
bool isTextureGatherOffsetComp(const TFunction *func) bool isTextureGatherOffsetComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3216 && id <= 3221; return id >= 3250 && id <= 3255;
} }
bool isTextureGatherOffsetNoComp(const TFunction *func) bool isTextureGatherOffsetNoComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3222 && id <= 3229; return id >= 3256 && id <= 3263;
} }
bool isTextureGatherOffset(const TFunction *func) bool isTextureGatherOffset(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3216 && id <= 3229; return id >= 3250 && id <= 3263;
} }
bool isTextureGather(const TFunction *func) bool isTextureGather(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3163 && id <= 3229; return id >= 3197 && id <= 3263;
} }
bool isAtomicMemory(const TFunction *func) bool isAtomicMemory(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3246 && id <= 3263; return id >= 3280 && id <= 3297;
} }
bool isImageLoad(const TFunction *func) bool isImageLoad(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3288 && id <= 3299; return id >= 3328 && id <= 3342;
} }
bool isImageStore(const TFunction *func) bool isImageStore(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3300 && id <= 3311; return id >= 3343 && id <= 3357;
} }
bool isImage(const TFunction *func) bool isImage(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 3264 && id <= 3311; return id >= 3298 && id <= 3357;
} }
} // namespace BuiltInGroup } // namespace BuiltInGroup
......
...@@ -21,67 +21,67 @@ namespace BuiltInGroup ...@@ -21,67 +21,67 @@ namespace BuiltInGroup
bool isTextureOffsetNoBias(const TFunction *func) bool isTextureOffsetNoBias(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1117 && id <= 1263; return id >= 1130 && id <= 1276;
} }
bool isTextureOffsetBias(const TFunction *func) bool isTextureOffsetBias(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1264 && id <= 1298; return id >= 1277 && id <= 1311;
} }
bool isTextureGatherOffsetsComp(const TFunction *func) bool isTextureGatherOffsetsComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1350 && id <= 1365; return id >= 1356 && id <= 1371;
} }
bool isTextureGatherOffsetsNoComp(const TFunction *func) bool isTextureGatherOffsetsNoComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1366 && id <= 1385; return id >= 1372 && id <= 1391;
} }
bool isTextureGatherOffsets(const TFunction *func) bool isTextureGatherOffsets(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1350 && id <= 1385; return id >= 1356 && id <= 1391;
} }
bool isTextureGatherOffsetComp(const TFunction *func) bool isTextureGatherOffsetComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1386 && id <= 1394; return id >= 1392 && id <= 1400;
} }
bool isTextureGatherOffsetNoComp(const TFunction *func) bool isTextureGatherOffsetNoComp(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1395 && id <= 1406; return id >= 1401 && id <= 1412;
} }
bool isTextureGatherOffset(const TFunction *func) bool isTextureGatherOffset(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1386 && id <= 1406; return id >= 1392 && id <= 1412;
} }
bool isTextureGather(const TFunction *func) bool isTextureGather(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1312 && id <= 1406; return id >= 1325 && id <= 1412;
} }
bool isAtomicMemory(const TFunction *func) bool isAtomicMemory(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1468 && id <= 1485; return id >= 1474 && id <= 1491;
} }
bool isImageLoad(const TFunction *func) bool isImageLoad(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 2122 && id <= 2154; return id >= 2128 && id <= 2160;
} }
bool isImageStore(const TFunction *func) bool isImageStore(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 2155 && id <= 2187; return id >= 2161 && id <= 2193;
} }
bool isImage(const TFunction *func) bool isImage(const TFunction *func)
{ {
int id = func->uniqueId().get(); int id = func->uniqueId().get();
return id >= 1486 && id <= 2187; return id >= 1492 && id <= 2193;
} }
} // namespace BuiltInGroup } // namespace BuiltInGroup
......
...@@ -176,6 +176,8 @@ void InitBuiltInResources(ShBuiltInResources *resources) ...@@ -176,6 +176,8 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->ANGLE_base_vertex_base_instance = 0; resources->ANGLE_base_vertex_base_instance = 0;
resources->WEBGL_video_texture = 0; resources->WEBGL_video_texture = 0;
resources->APPLE_clip_distance = 0; resources->APPLE_clip_distance = 0;
resources->OES_texture_cube_map_array = 0;
resources->EXT_texture_cube_map_array = 0;
resources->NV_draw_buffers = 0; resources->NV_draw_buffers = 0;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -254,6 +254,8 @@ void TranslatorGLSL::writeVersion(TIntermNode *root) ...@@ -254,6 +254,8 @@ void TranslatorGLSL::writeVersion(TIntermNode *root)
void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions compileOptions) void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions compileOptions)
{ {
bool usesTextureCubeMapArray = false;
TInfoSinkBase &sink = getInfoSink().obj; TInfoSinkBase &sink = getInfoSink().obj;
const TExtensionBehavior &extBehavior = getExtensionBehavior(); const TExtensionBehavior &extBehavior = getExtensionBehavior();
for (const auto &iter : extBehavior) for (const auto &iter : extBehavior)
...@@ -305,6 +307,13 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions ...@@ -305,6 +307,13 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions
sink << "#extension GL_ARB_texture_multisample : " << GetBehaviorString(iter.second) sink << "#extension GL_ARB_texture_multisample : " << GetBehaviorString(iter.second)
<< "\n"; << "\n";
} }
if ((iter.first == TExtension::OES_texture_cube_map_array ||
iter.first == TExtension::EXT_texture_cube_map_array) &&
(iter.second == EBhRequire || iter.second == EBhEnable))
{
usesTextureCubeMapArray = true;
}
} }
// GLSL ES 3 explicit location qualifiers need to use an extension before GLSL 330 // GLSL ES 3 explicit location qualifiers need to use an extension before GLSL 330
...@@ -326,6 +335,20 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions ...@@ -326,6 +335,20 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions
sink << "#extension GL_EXT_gpu_shader5 : enable\n"; sink << "#extension GL_EXT_gpu_shader5 : enable\n";
} }
if (usesTextureCubeMapArray)
{
if (getOutputType() >= SH_GLSL_COMPATIBILITY_OUTPUT &&
getOutputType() < SH_GLSL_400_CORE_OUTPUT)
{
sink << "#extension GL_ARB_texture_cube_map_array : enable\n";
}
else if (getOutputType() == SH_ESSL_OUTPUT && getShaderVersion() < 320)
{
sink << "#extension GL_OES_texture_cube_map_array : enable\n";
sink << "#extension GL_EXT_texture_cube_map_array : enable\n";
}
}
TExtensionGLSL extensionGLSL(getOutputType()); TExtensionGLSL extensionGLSL(getOutputType());
root->traverse(&extensionGLSL); root->traverse(&extensionGLSL);
......
...@@ -54,6 +54,8 @@ const char *getBasicString(TBasicType t) ...@@ -54,6 +54,8 @@ const char *getBasicString(TBasicType t)
return "sampler2DMS"; return "sampler2DMS";
case EbtSampler2DMSArray: case EbtSampler2DMSArray:
return "sampler2DMSArray"; return "sampler2DMSArray";
case EbtSamplerCubeArray:
return "samplerCubeArray";
case EbtISampler2D: case EbtISampler2D:
return "isampler2D"; return "isampler2D";
case EbtISampler3D: case EbtISampler3D:
...@@ -66,6 +68,8 @@ const char *getBasicString(TBasicType t) ...@@ -66,6 +68,8 @@ const char *getBasicString(TBasicType t)
return "isampler2DMS"; return "isampler2DMS";
case EbtISampler2DMSArray: case EbtISampler2DMSArray:
return "isampler2DMSArray"; return "isampler2DMSArray";
case EbtISamplerCubeArray:
return "isamplerCubeArray";
case EbtUSampler2D: case EbtUSampler2D:
return "usampler2D"; return "usampler2D";
case EbtUSampler3D: case EbtUSampler3D:
...@@ -78,12 +82,16 @@ const char *getBasicString(TBasicType t) ...@@ -78,12 +82,16 @@ const char *getBasicString(TBasicType t)
return "usampler2DMS"; return "usampler2DMS";
case EbtUSampler2DMSArray: case EbtUSampler2DMSArray:
return "usampler2DMSArray"; return "usampler2DMSArray";
case EbtUSamplerCubeArray:
return "usamplerCubeArray";
case EbtSampler2DShadow: case EbtSampler2DShadow:
return "sampler2DShadow"; return "sampler2DShadow";
case EbtSamplerCubeShadow: case EbtSamplerCubeShadow:
return "samplerCubeShadow"; return "samplerCubeShadow";
case EbtSampler2DArrayShadow: case EbtSampler2DArrayShadow:
return "sampler2DArrayShadow"; return "sampler2DArrayShadow";
case EbtSamplerCubeArrayShadow:
return "samplerCubeArrayShadow";
case EbtStruct: case EbtStruct:
return "structure"; return "structure";
case EbtInterfaceBlock: case EbtInterfaceBlock:
...@@ -112,6 +120,12 @@ const char *getBasicString(TBasicType t) ...@@ -112,6 +120,12 @@ const char *getBasicString(TBasicType t)
return "iimageCube"; return "iimageCube";
case EbtUImageCube: case EbtUImageCube:
return "uimageCube"; return "uimageCube";
case EbtImageCubeArray:
return "imageCubeArray";
case EbtIImageCubeArray:
return "iimageCubeArray";
case EbtUImageCubeArray:
return "uimageCubeArray";
case EbtAtomicCounter: case EbtAtomicCounter:
return "atomic_uint"; return "atomic_uint";
case EbtSamplerVideoWEBGL: case EbtSamplerVideoWEBGL:
......
...@@ -649,6 +649,23 @@ GROUP BEGIN TextureSizeMSArrayExt ...@@ -649,6 +649,23 @@ GROUP BEGIN TextureSizeMSArrayExt
ivec3 textureSize(gsampler2DMSArray); ivec3 textureSize(gsampler2DMSArray);
GROUP END TextureSizeMSArrayExt GROUP END TextureSizeMSArrayExt
// These functions are part of OES/EXT_texture_cube_map.
// There's no way to mark alternative extensions for builtins, so these are marked with none.
// TODO(anglebug.com/4589)
GROUP BEGIN OES_cube_map_array
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
ivec3 textureSize(gsamplerCubeArray, int);
ivec3 textureSize(samplerCubeArrayShadow, int);
gvec4 texture(gsamplerCubeArray, vec4);
gvec4 texture(gsamplerCubeArray, vec4, float);
float texture(samplerCubeArrayShadow, vec4, float);
gvec4 textureLod(gsamplerCubeArray, vec4, float);
gvec4 textureGrad(gsamplerCubeArray, vec4, vec3, vec3);
gvec4 textureGather(gsamplerCubeArray, vec4);
gvec4 textureGather(gsamplerCubeArray, vec4, int);
vec4 textureGather(samplerCubeArrayShadow, vec4, float);
GROUP END OES_cube_map_array
GROUP BEGIN TexelFetchMS GROUP BEGIN TexelFetchMS
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 texelFetch(gsampler2DMS, ivec2, int); gvec4 texelFetch(gsampler2DMS, ivec2, int);
...@@ -1001,6 +1018,13 @@ GROUP BEGIN Image {"queryFunction": true} ...@@ -1001,6 +1018,13 @@ GROUP BEGIN Image {"queryFunction": true}
void imageStore(gimage3D, ivec3, gvec4); void imageStore(gimage3D, ivec3, gvec4);
void imageStore(gimage2DArray, ivec3, gvec4); void imageStore(gimage2DArray, ivec3, gvec4);
void imageStore(gimageCube, ivec3, gvec4); void imageStore(gimageCube, ivec3, gvec4);
// These functions are part of OES/EXT_texture_cube_map.
// There's no way to mark alternative extensions for builtins, so these are marked with none.
// TODO(anglebug.com/4589)
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 imageStore(gimageCubeArray, ivec3, gvec4);
DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
void imageStore(writeonly IMAGE_PARAMS, gvec4); void imageStore(writeonly IMAGE_PARAMS, gvec4);
GROUP END Store GROUP END Store
...@@ -1010,6 +1034,13 @@ GROUP BEGIN Image {"queryFunction": true} ...@@ -1010,6 +1034,13 @@ GROUP BEGIN Image {"queryFunction": true}
gvec4 imageLoad(gimage3D, ivec3); gvec4 imageLoad(gimage3D, ivec3);
gvec4 imageLoad(gimage2DArray, ivec3); gvec4 imageLoad(gimage2DArray, ivec3);
gvec4 imageLoad(gimageCube, ivec3); gvec4 imageLoad(gimageCube, ivec3);
// These functions are part of OES/EXT_texture_cube_map.
// There's no way to mark alternative extensions for builtins, so these are marked with none.
// TODO(anglebug.com/4589)
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 imageLoad(gimageCubeArray, ivec3);
DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
gvec4 imageLoad(readonly IMAGE_PARAMS); gvec4 imageLoad(readonly IMAGE_PARAMS);
GROUP END Load GROUP END Load
...@@ -1018,6 +1049,13 @@ GROUP BEGIN Image {"queryFunction": true} ...@@ -1018,6 +1049,13 @@ GROUP BEGIN Image {"queryFunction": true}
ivec3 imageSize(gimage3D); ivec3 imageSize(gimage3D);
ivec3 imageSize(gimage2DArray); ivec3 imageSize(gimage2DArray);
ivec2 imageSize(gimageCube); ivec2 imageSize(gimageCube);
// These functions are part of OES/EXT_texture_cube_map.
// There's no way to mark alternative extensions for builtins, so these are marked with none.
// TODO(anglebug.com/4589)
DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
ivec3 imageSize(gimageCubeArray);
DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"} DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
int imageSize(readonly writeonly gimage1D); int imageSize(readonly writeonly gimage1D);
ivec2 imageSize(readonly writeonly gimage2D); ivec2 imageSize(readonly writeonly gimage2D);
......
...@@ -108,6 +108,7 @@ static int ES3_reserved_ES3_1_extension_ES3_2_keyword(TParseContext *context, TE ...@@ -108,6 +108,7 @@ static int ES3_reserved_ES3_1_extension_ES3_2_keyword(TParseContext *context, TE
static int ES3_reserved_ES3_extension(TParseContext *context, TExtension extension, int token); static int ES3_reserved_ES3_extension(TParseContext *context, TExtension extension, int token);
static int ES3_reserved_ES3_extension_ES3_1_keyword(TParseContext *context, TExtension extension, int token); static int ES3_reserved_ES3_extension_ES3_1_keyword(TParseContext *context, TExtension extension, int token);
static int ES3_1_reserved_ES3_1_extension_ES3_2_keyword(TParseContext *context, TExtension extension, int token); static int ES3_1_reserved_ES3_1_extension_ES3_2_keyword(TParseContext *context, TExtension extension, int token);
static int ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(TParseContext *context, TExtension extension1, TExtension extension2, int token1, int token2);
static int WEBGL_video_texture_extension(TParseContext *context, int token); static int WEBGL_video_texture_extension(TParseContext *context, int token);
static int uint_constant(TParseContext *context); static int uint_constant(TParseContext *context);
static int int_constant(TParseContext *context); static int int_constant(TParseContext *context);
...@@ -231,6 +232,10 @@ O [0-7] ...@@ -231,6 +232,10 @@ O [0-7]
"sampler2DMSArray" { return ES3_reserved_ES3_1_extension_ES3_2_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, SAMPLER2DMSARRAY); } "sampler2DMSArray" { return ES3_reserved_ES3_1_extension_ES3_2_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, SAMPLER2DMSARRAY); }
"isampler2DMSArray" { return ES3_reserved_ES3_1_extension_ES3_2_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, ISAMPLER2DMSARRAY); } "isampler2DMSArray" { return ES3_reserved_ES3_1_extension_ES3_2_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, ISAMPLER2DMSARRAY); }
"usampler2DMSArray" { return ES3_reserved_ES3_1_extension_ES3_2_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, USAMPLER2DMSARRAY); } "usampler2DMSArray" { return ES3_reserved_ES3_1_extension_ES3_2_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, USAMPLER2DMSARRAY); }
"samplerCubeArray" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, SAMPLERCUBEARRAYOES, SAMPLERCUBEARRAYEXT); }
"samplerCubeArrayShadow" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, SAMPLERCUBEARRAYSHADOWOES, SAMPLERCUBEARRAYSHADOWEXT); }
"isamplerCubeArray" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, ISAMPLERCUBEARRAYOES, ISAMPLERCUBEARRAYEXT); }
"usamplerCubeArray" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, USAMPLERCUBEARRAYOES, USAMPLERCUBEARRAYEXT); }
"samplerVideoWEBGL" { return WEBGL_video_texture_extension(context, SAMPLERVIDEOWEBGL); } "samplerVideoWEBGL" { return WEBGL_video_texture_extension(context, SAMPLERVIDEOWEBGL); }
"struct" { return STRUCT; } "struct" { return STRUCT; }
...@@ -253,6 +258,9 @@ O [0-7] ...@@ -253,6 +258,9 @@ O [0-7]
"iimageCube" { return ES3_reserved_ES3_1_keyword(context, IIMAGECUBE); } "iimageCube" { return ES3_reserved_ES3_1_keyword(context, IIMAGECUBE); }
"uimageCube" { return ES3_reserved_ES3_1_keyword(context, UIMAGECUBE); } "uimageCube" { return ES3_reserved_ES3_1_keyword(context, UIMAGECUBE); }
"imageCube" { return ES3_reserved_ES3_1_keyword(context, IMAGECUBE); } "imageCube" { return ES3_reserved_ES3_1_keyword(context, IMAGECUBE); }
"imageCubeArray" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, IMAGECUBEARRAYOES, IMAGECUBEARRAYEXT); }
"iimageCubeArray" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, IIMAGECUBEARRAYOES, IIMAGECUBEARRAYEXT); }
"uimageCubeArray" { return ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(context, TExtension::OES_texture_cube_map_array, TExtension::EXT_texture_cube_map_array, UIMAGECUBEARRAYOES, UIMAGECUBEARRAYEXT); }
"readonly" { return ES3_reserved_ES3_1_keyword(context, READONLY); } "readonly" { return ES3_reserved_ES3_1_keyword(context, READONLY); }
"writeonly" { return ES3_reserved_ES3_1_keyword(context, WRITEONLY); } "writeonly" { return ES3_reserved_ES3_1_keyword(context, WRITEONLY); }
"coherent" { return ES3_reserved_ES3_1_keyword(context, COHERENT); } "coherent" { return ES3_reserved_ES3_1_keyword(context, COHERENT); }
...@@ -711,6 +719,31 @@ static int ES3_1_reserved_ES3_1_extension_ES3_2_keyword(TParseContext *context, ...@@ -711,6 +719,31 @@ static int ES3_1_reserved_ES3_1_extension_ES3_2_keyword(TParseContext *context,
return check_type(yyscanner); return check_type(yyscanner);
} }
static int ES3_1_reserved_ES3_1_extension_ES3_2_keyword_2(TParseContext *context, TExtension extension1, TExtension extension2, int token1, int token2)
{
struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
yyscan_t yyscanner = (yyscan_t) context->getScanner();
// A keyword in GLSL ES 3.20 or GLSL ES 3.10 with enabled extension.
if (is_extension_enabled_or_is_core(context, 310, extension1, 320))
{
return token1;
}
else if (is_extension_enabled_or_is_core(context, 310, extension2, 320))
{
return token2;
}
// A reserved word in GLSL ES 3.10
if (context->getShaderVersion() == 310)
{
return reserved_word(yyscanner);
}
yylval->lex.string = AllocatePoolCharArray(yytext, yyleng);
return check_type(yyscanner);
}
int uint_constant(TParseContext *context) int uint_constant(TParseContext *context)
{ {
struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner(); struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
......
...@@ -173,9 +173,13 @@ extern void yyerror(YYLTYPE* yylloc, TParseContext* context, void *scanner, cons ...@@ -173,9 +173,13 @@ extern void yyerror(YYLTYPE* yylloc, TParseContext* context, void *scanner, cons
%token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS %token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
%token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY %token <lex> SAMPLER2DMSARRAY ISAMPLER2DMSARRAY USAMPLER2DMSARRAY
%token <lex> SAMPLER3D SAMPLER3DRECT SAMPLER2DSHADOW SAMPLERCUBESHADOW SAMPLER2DARRAYSHADOW SAMPLERVIDEOWEBGL %token <lex> SAMPLER3D SAMPLER3DRECT SAMPLER2DSHADOW SAMPLERCUBESHADOW SAMPLER2DARRAYSHADOW SAMPLERVIDEOWEBGL
%token <lex> SAMPLERCUBEARRAYOES SAMPLERCUBEARRAYSHADOWOES ISAMPLERCUBEARRAYOES USAMPLERCUBEARRAYOES
%token <lex> SAMPLERCUBEARRAYEXT SAMPLERCUBEARRAYSHADOWEXT ISAMPLERCUBEARRAYEXT USAMPLERCUBEARRAYEXT
%token <lex> SAMPLEREXTERNAL2DY2YEXT %token <lex> SAMPLEREXTERNAL2DY2YEXT
%token <lex> IMAGE2D IIMAGE2D UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY %token <lex> IMAGE2D IIMAGE2D UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY
%token <lex> IMAGECUBE IIMAGECUBE UIMAGECUBE %token <lex> IMAGECUBE IIMAGECUBE UIMAGECUBE
%token <lex> IMAGECUBEARRAYOES IIMAGECUBEARRAYOES UIMAGECUBEARRAYOES
%token <lex> IMAGECUBEARRAYEXT IIMAGECUBEARRAYEXT UIMAGECUBEARRAYEXT
%token <lex> ATOMICUINT %token <lex> ATOMICUINT
%token <lex> LAYOUT %token <lex> LAYOUT
%token <lex> YUVCSCSTANDARDEXT YUVCSCSTANDARDEXTCONSTANT %token <lex> YUVCSCSTANDARDEXT YUVCSCSTANDARDEXTCONSTANT
...@@ -1102,6 +1106,22 @@ type_specifier_nonarray ...@@ -1102,6 +1106,22 @@ type_specifier_nonarray
| SAMPLER2DMSARRAY { | SAMPLER2DMSARRAY {
$$.initialize(EbtSampler2DMSArray, @1); $$.initialize(EbtSampler2DMSArray, @1);
} }
| SAMPLERCUBEARRAYOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__samplerCubeArray");
}
$$.initialize(EbtSamplerCubeArray, @1);
}
| SAMPLERCUBEARRAYEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__samplerCubeArray");
}
$$.initialize(EbtSamplerCubeArray, @1);
}
| ISAMPLER2D { | ISAMPLER2D {
$$.initialize(EbtISampler2D, @1); $$.initialize(EbtISampler2D, @1);
} }
...@@ -1120,6 +1140,22 @@ type_specifier_nonarray ...@@ -1120,6 +1140,22 @@ type_specifier_nonarray
| ISAMPLER2DMSARRAY { | ISAMPLER2DMSARRAY {
$$.initialize(EbtISampler2DMSArray, @1); $$.initialize(EbtISampler2DMSArray, @1);
} }
| ISAMPLERCUBEARRAYOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__isamplerCubeArray");
}
$$.initialize(EbtISamplerCubeArray, @1);
}
| ISAMPLERCUBEARRAYEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__isamplerCubeArray");
}
$$.initialize(EbtISamplerCubeArray, @1);
}
| USAMPLER2D { | USAMPLER2D {
$$.initialize(EbtUSampler2D, @1); $$.initialize(EbtUSampler2D, @1);
} }
...@@ -1138,6 +1174,22 @@ type_specifier_nonarray ...@@ -1138,6 +1174,22 @@ type_specifier_nonarray
| USAMPLER2DMSARRAY { | USAMPLER2DMSARRAY {
$$.initialize(EbtUSampler2DMSArray, @1); $$.initialize(EbtUSampler2DMSArray, @1);
} }
| USAMPLERCUBEARRAYOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__usamplerCubeArray");
}
$$.initialize(EbtUSamplerCubeArray, @1);
}
| USAMPLERCUBEARRAYEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__usamplerCubeArray");
}
$$.initialize(EbtUSamplerCubeArray, @1);
}
| SAMPLER2DSHADOW { | SAMPLER2DSHADOW {
$$.initialize(EbtSampler2DShadow, @1); $$.initialize(EbtSampler2DShadow, @1);
} }
...@@ -1147,6 +1199,22 @@ type_specifier_nonarray ...@@ -1147,6 +1199,22 @@ type_specifier_nonarray
| SAMPLER2DARRAYSHADOW { | SAMPLER2DARRAYSHADOW {
$$.initialize(EbtSampler2DArrayShadow, @1); $$.initialize(EbtSampler2DArrayShadow, @1);
} }
| SAMPLERCUBEARRAYSHADOWOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__samplerCubeArrayShadow");
}
$$.initialize(EbtSamplerCubeArrayShadow, @1);
}
| SAMPLERCUBEARRAYSHADOWEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__samplerCubeArrayShadow");
}
$$.initialize(EbtSamplerCubeArrayShadow, @1);
}
| SAMPLERVIDEOWEBGL { | SAMPLERVIDEOWEBGL {
if (!context->checkCanUseExtension(@1, TExtension::WEBGL_video_texture)) if (!context->checkCanUseExtension(@1, TExtension::WEBGL_video_texture))
{ {
...@@ -1214,6 +1282,54 @@ type_specifier_nonarray ...@@ -1214,6 +1282,54 @@ type_specifier_nonarray
| UIMAGECUBE { | UIMAGECUBE {
$$.initialize(EbtUImageCube, @1); $$.initialize(EbtUImageCube, @1);
} }
| IMAGECUBEARRAYOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__imageCubeArray");
}
$$.initialize(EbtImageCubeArray, @1);
}
| IMAGECUBEARRAYEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__imageCubeArray");
}
$$.initialize(EbtImageCubeArray, @1);
}
| IIMAGECUBEARRAYOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__iimageCubeArray");
}
$$.initialize(EbtIImageCubeArray, @1);
}
| IIMAGECUBEARRAYEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__iimageCubeArray");
}
$$.initialize(EbtIImageCubeArray, @1);
}
| UIMAGECUBEARRAYOES {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::OES_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__uimageCubeArray");
}
$$.initialize(EbtUImageCubeArray, @1);
}
| UIMAGECUBEARRAYEXT {
if (context->getShaderVersion() < 320
&& !context->checkCanUseExtension(@1, TExtension::EXT_texture_cube_map_array))
{
context->error(@1, "unsupported type", "__uimageCubeArray");
}
$$.initialize(EbtUImageCubeArray, @1);
}
| ATOMICUINT { | ATOMICUINT {
$$.initialize(EbtAtomicCounter, @1); $$.initialize(EbtAtomicCounter, @1);
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -142,75 +142,89 @@ enum yytokentype ...@@ -142,75 +142,89 @@ enum yytokentype
SAMPLERCUBESHADOW = 343, SAMPLERCUBESHADOW = 343,
SAMPLER2DARRAYSHADOW = 344, SAMPLER2DARRAYSHADOW = 344,
SAMPLERVIDEOWEBGL = 345, SAMPLERVIDEOWEBGL = 345,
SAMPLEREXTERNAL2DY2YEXT = 346, SAMPLERCUBEARRAYOES = 346,
IMAGE2D = 347, SAMPLERCUBEARRAYSHADOWOES = 347,
IIMAGE2D = 348, ISAMPLERCUBEARRAYOES = 348,
UIMAGE2D = 349, USAMPLERCUBEARRAYOES = 349,
IMAGE3D = 350, SAMPLERCUBEARRAYEXT = 350,
IIMAGE3D = 351, SAMPLERCUBEARRAYSHADOWEXT = 351,
UIMAGE3D = 352, ISAMPLERCUBEARRAYEXT = 352,
IMAGE2DARRAY = 353, USAMPLERCUBEARRAYEXT = 353,
IIMAGE2DARRAY = 354, SAMPLEREXTERNAL2DY2YEXT = 354,
UIMAGE2DARRAY = 355, IMAGE2D = 355,
IMAGECUBE = 356, IIMAGE2D = 356,
IIMAGECUBE = 357, UIMAGE2D = 357,
UIMAGECUBE = 358, IMAGE3D = 358,
ATOMICUINT = 359, IIMAGE3D = 359,
LAYOUT = 360, UIMAGE3D = 360,
YUVCSCSTANDARDEXT = 361, IMAGE2DARRAY = 361,
YUVCSCSTANDARDEXTCONSTANT = 362, IIMAGE2DARRAY = 362,
IDENTIFIER = 363, UIMAGE2DARRAY = 363,
TYPE_NAME = 364, IMAGECUBE = 364,
FLOATCONSTANT = 365, IIMAGECUBE = 365,
INTCONSTANT = 366, UIMAGECUBE = 366,
UINTCONSTANT = 367, IMAGECUBEARRAYOES = 367,
BOOLCONSTANT = 368, IIMAGECUBEARRAYOES = 368,
FIELD_SELECTION = 369, UIMAGECUBEARRAYOES = 369,
LEFT_OP = 370, IMAGECUBEARRAYEXT = 370,
RIGHT_OP = 371, IIMAGECUBEARRAYEXT = 371,
INC_OP = 372, UIMAGECUBEARRAYEXT = 372,
DEC_OP = 373, ATOMICUINT = 373,
LE_OP = 374, LAYOUT = 374,
GE_OP = 375, YUVCSCSTANDARDEXT = 375,
EQ_OP = 376, YUVCSCSTANDARDEXTCONSTANT = 376,
NE_OP = 377, IDENTIFIER = 377,
AND_OP = 378, TYPE_NAME = 378,
OR_OP = 379, FLOATCONSTANT = 379,
XOR_OP = 380, INTCONSTANT = 380,
MUL_ASSIGN = 381, UINTCONSTANT = 381,
DIV_ASSIGN = 382, BOOLCONSTANT = 382,
ADD_ASSIGN = 383, FIELD_SELECTION = 383,
MOD_ASSIGN = 384, LEFT_OP = 384,
LEFT_ASSIGN = 385, RIGHT_OP = 385,
RIGHT_ASSIGN = 386, INC_OP = 386,
AND_ASSIGN = 387, DEC_OP = 387,
XOR_ASSIGN = 388, LE_OP = 388,
OR_ASSIGN = 389, GE_OP = 389,
SUB_ASSIGN = 390, EQ_OP = 390,
LEFT_PAREN = 391, NE_OP = 391,
RIGHT_PAREN = 392, AND_OP = 392,
LEFT_BRACKET = 393, OR_OP = 393,
RIGHT_BRACKET = 394, XOR_OP = 394,
LEFT_BRACE = 395, MUL_ASSIGN = 395,
RIGHT_BRACE = 396, DIV_ASSIGN = 396,
DOT = 397, ADD_ASSIGN = 397,
COMMA = 398, MOD_ASSIGN = 398,
COLON = 399, LEFT_ASSIGN = 399,
EQUAL = 400, RIGHT_ASSIGN = 400,
SEMICOLON = 401, AND_ASSIGN = 401,
BANG = 402, XOR_ASSIGN = 402,
DASH = 403, OR_ASSIGN = 403,
TILDE = 404, SUB_ASSIGN = 404,
PLUS = 405, LEFT_PAREN = 405,
STAR = 406, RIGHT_PAREN = 406,
SLASH = 407, LEFT_BRACKET = 407,
PERCENT = 408, RIGHT_BRACKET = 408,
LEFT_ANGLE = 409, LEFT_BRACE = 409,
RIGHT_ANGLE = 410, RIGHT_BRACE = 410,
VERTICAL_BAR = 411, DOT = 411,
CARET = 412, COMMA = 412,
AMPERSAND = 413, COLON = 413,
QUESTION = 414 EQUAL = 414,
SEMICOLON = 415,
BANG = 416,
DASH = 417,
TILDE = 418,
PLUS = 419,
STAR = 420,
SLASH = 421,
PERCENT = 422,
LEFT_ANGLE = 423,
RIGHT_ANGLE = 424,
VERTICAL_BAR = 425,
CARET = 426,
AMPERSAND = 427,
QUESTION = 428
}; };
#endif #endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -378,6 +378,8 @@ GLenum GLVariableType(const TType &type) ...@@ -378,6 +378,8 @@ GLenum GLVariableType(const TType &type)
return GL_SAMPLER_2D_MULTISAMPLE; return GL_SAMPLER_2D_MULTISAMPLE;
case EbtSampler2DMSArray: case EbtSampler2DMSArray:
return GL_SAMPLER_2D_MULTISAMPLE_ARRAY; return GL_SAMPLER_2D_MULTISAMPLE_ARRAY;
case EbtSamplerCubeArray:
return GL_SAMPLER_CUBE_MAP_ARRAY;
case EbtISampler2D: case EbtISampler2D:
return GL_INT_SAMPLER_2D; return GL_INT_SAMPLER_2D;
case EbtISampler3D: case EbtISampler3D:
...@@ -390,6 +392,8 @@ GLenum GLVariableType(const TType &type) ...@@ -390,6 +392,8 @@ GLenum GLVariableType(const TType &type)
return GL_INT_SAMPLER_2D_MULTISAMPLE; return GL_INT_SAMPLER_2D_MULTISAMPLE;
case EbtISampler2DMSArray: case EbtISampler2DMSArray:
return GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY; return GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY;
case EbtISamplerCubeArray:
return GL_INT_SAMPLER_CUBE_MAP_ARRAY;
case EbtUSampler2D: case EbtUSampler2D:
return GL_UNSIGNED_INT_SAMPLER_2D; return GL_UNSIGNED_INT_SAMPLER_2D;
case EbtUSampler3D: case EbtUSampler3D:
...@@ -402,12 +406,16 @@ GLenum GLVariableType(const TType &type) ...@@ -402,12 +406,16 @@ GLenum GLVariableType(const TType &type)
return GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE; return GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE;
case EbtUSampler2DMSArray: case EbtUSampler2DMSArray:
return GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY; return GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY;
case EbtUSamplerCubeArray:
return GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY;
case EbtSampler2DShadow: case EbtSampler2DShadow:
return GL_SAMPLER_2D_SHADOW; return GL_SAMPLER_2D_SHADOW;
case EbtSamplerCubeShadow: case EbtSamplerCubeShadow:
return GL_SAMPLER_CUBE_SHADOW; return GL_SAMPLER_CUBE_SHADOW;
case EbtSampler2DArrayShadow: case EbtSampler2DArrayShadow:
return GL_SAMPLER_2D_ARRAY_SHADOW; return GL_SAMPLER_2D_ARRAY_SHADOW;
case EbtSamplerCubeArrayShadow:
return GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW;
case EbtImage2D: case EbtImage2D:
return GL_IMAGE_2D; return GL_IMAGE_2D;
case EbtIImage2D: case EbtIImage2D:
...@@ -432,6 +440,12 @@ GLenum GLVariableType(const TType &type) ...@@ -432,6 +440,12 @@ GLenum GLVariableType(const TType &type)
return GL_INT_IMAGE_CUBE; return GL_INT_IMAGE_CUBE;
case EbtUImageCube: case EbtUImageCube:
return GL_UNSIGNED_INT_IMAGE_CUBE; return GL_UNSIGNED_INT_IMAGE_CUBE;
case EbtImageCubeArray:
return GL_IMAGE_CUBE_MAP_ARRAY;
case EbtIImageCubeArray:
return GL_INT_IMAGE_CUBE_MAP_ARRAY;
case EbtUImageCubeArray:
return GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY;
case EbtAtomicCounter: case EbtAtomicCounter:
return GL_UNSIGNED_INT_ATOMIC_COUNTER; return GL_UNSIGNED_INT_ATOMIC_COUNTER;
case EbtSamplerVideoWEBGL: case EbtSamplerVideoWEBGL:
......
...@@ -123,6 +123,10 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const State &state) ...@@ -123,6 +123,10 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const State &state)
// WEBGL_video_texture // WEBGL_video_texture
mResources.WEBGL_video_texture = extensions.webglVideoTexture; mResources.WEBGL_video_texture = extensions.webglVideoTexture;
// OES_texture_cube_map_array
mResources.OES_texture_cube_map_array = extensions.textureCubeMapArrayOES;
mResources.EXT_texture_cube_map_array = extensions.textureCubeMapArrayEXT;
// GLSL ES 3.0 constants // GLSL ES 3.0 constants
mResources.MaxVertexOutputVectors = caps.maxVertexOutputComponents / 4; mResources.MaxVertexOutputVectors = caps.maxVertexOutputComponents / 4;
mResources.MaxFragmentInputVectors = caps.maxFragmentInputComponents / 4; mResources.MaxFragmentInputVectors = caps.maxFragmentInputComponents / 4;
......
...@@ -1126,6 +1126,22 @@ void GenerateCaps(const FunctionsGL *functions, ...@@ -1126,6 +1126,22 @@ void GenerateCaps(const FunctionsGL *functions,
LimitVersion(maxSupportedESVersion, gl::Version(2, 0)); LimitVersion(maxSupportedESVersion, gl::Version(2, 0));
} }
// GL_OES_texture_cube_map_array
if (functions->isAtLeastGL(gl::Version(4, 0)) ||
functions->hasGLESExtension("GL_OES_texture_cube_map_array") ||
functions->hasGLESExtension("GL_EXT_texture_cube_map_array") ||
functions->hasGLExtension("GL_ARB_texture_cube_map_array") ||
functions->isAtLeastGLES(gl::Version(3, 2)))
{
extensions->textureCubeMapArrayOES = true;
extensions->textureCubeMapArrayEXT = true;
}
else
{
// Can't support ES3.2 without cube map array textures
LimitVersion(maxSupportedESVersion, gl::Version(3, 1));
}
// Extension support // Extension support
extensions->setTextureExtensionSupport(*textureCapsMap); extensions->setTextureExtensionSupport(*textureCapsMap);
extensions->textureCompressionASTCHDRKHR = extensions->textureCompressionASTCHDRKHR =
......
...@@ -80,6 +80,7 @@ angle_unittests_sources = [ ...@@ -80,6 +80,7 @@ angle_unittests_sources = [
"compiler_tests/IntermNode_test.cpp", "compiler_tests/IntermNode_test.cpp",
"compiler_tests/NV_draw_buffers_test.cpp", "compiler_tests/NV_draw_buffers_test.cpp",
"compiler_tests/OES_standard_derivatives_test.cpp", "compiler_tests/OES_standard_derivatives_test.cpp",
"compiler_tests/OES_texture_cube_map_array_test.cpp",
"compiler_tests/OVR_multiview2_test.cpp", "compiler_tests/OVR_multiview2_test.cpp",
"compiler_tests/OVR_multiview_test.cpp", "compiler_tests/OVR_multiview_test.cpp",
"compiler_tests/Pack_Unpack_test.cpp", "compiler_tests/Pack_Unpack_test.cpp",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// OES_texture_cube_map_array_test.cpp:
// Test for the [OES/EXT]_texture_cube_map_array extension
//
#include "GLSLANG/ShaderLang.h"
#include "angle_gl.h"
#include "gtest/gtest.h"
#include "tests/test_utils/ShaderCompileTreeTest.h"
using namespace sh;
class TextureCubeMapArrayTestNoExt : public ShaderCompileTreeTest
{
protected:
::GLenum getShaderType() const override { return GL_FRAGMENT_SHADER; }
ShShaderSpec getShaderSpec() const override { return SH_GLES3_1_SPEC; }
};
class OESTextureCubeMapArrayTest : public TextureCubeMapArrayTestNoExt
{
protected:
void initResources(ShBuiltInResources *resources) override
{
resources->OES_texture_cube_map_array = 1;
}
};
class EXTTextureCubeMapArrayTest : public TextureCubeMapArrayTestNoExt
{
protected:
void initResources(ShBuiltInResources *resources) override
{
resources->EXT_texture_cube_map_array = 1;
}
};
// Check that if the extension is not supported, trying to use the features without having an
// extension directive fails.
TEST_F(TextureCubeMapArrayTestNoExt, MissingExtensionDirective)
{
const std::string &shaderString =
R"(
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension is not supported, trying to use the features without having an
// extension directive fails.
TEST_F(OESTextureCubeMapArrayTest, MissingExtensionDirective)
{
const std::string &shaderString =
R"(
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension is not supported, trying to use the features without having an
// extension directive fails.
TEST_F(EXTTextureCubeMapArrayTest, MissingExtensionDirective)
{
const std::string &shaderString =
R"(
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension is enabled, trying to use the features without the extension
// enabled fails.
TEST_F(TextureCubeMapArrayTestNoExt, ExtensionEnabledOES)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_OES_texture_cube_map_array : enable
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension supported and enabled, using the features succeeds.
TEST_F(OESTextureCubeMapArrayTest, ExtensionEnabledOES)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_OES_texture_cube_map_array : enable
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (!compile(shaderString))
{
FAIL() << "Shader compilation failed, expecting success:\n" << mInfoLog;
}
}
// Check that if the extension is enabled, trying to use the features without the extension
// enabled fails.
TEST_F(EXTTextureCubeMapArrayTest, ExtensionEnabledOES)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_OES_texture_cube_map_array : enable
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension is enabled, trying to use the features without the extension
// enabled fails.
TEST_F(TextureCubeMapArrayTestNoExt, ExtensionEnabledEXT)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_EXT_texture_cube_map_array : enable
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension is enabled, trying to use the features without the extension
// enabled fails.
TEST_F(OESTextureCubeMapArrayTest, ExtensionEnabledEXT)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_EXT_texture_cube_map_array : enable
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (compile(shaderString))
{
FAIL() << "Shader compilation succeeded, expecting failure:\n" << mInfoLog;
}
}
// Check that if the extension supported and enabled, using the features succeeds.
TEST_F(EXTTextureCubeMapArrayTest, ExtensionEnabledEXT)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_EXT_texture_cube_map_array : enable
precision mediump float;
uniform highp isamplerCubeArray u_sampler;
void main()
{
vec4 color = vec4(texture(u_sampler, vec4(0, 0, 0, 0)));
})";
if (!compile(shaderString))
{
FAIL() << "Shader compilation failed, expecting success:\n" << mInfoLog;
}
}
...@@ -147,6 +147,8 @@ ...@@ -147,6 +147,8 @@
1442 OPENGL : dEQP-GLES31.functional.state_query.program_pipeline.* = SKIP 1442 OPENGL : dEQP-GLES31.functional.state_query.program_pipeline.* = SKIP
1442 D3D11 : dEQP-GLES31.functional.state_query.program_pipeline.* = SKIP 1442 D3D11 : dEQP-GLES31.functional.state_query.program_pipeline.* = SKIP
3584 OPENGL : dEQP-GLES31.functional.shaders.opaque_type_indexing.sampler.*samplercubearray* = PASS
// These tests are failing because of compile errors with SSBOs in compute shaders. // These tests are failing because of compile errors with SSBOs in compute shaders.
1442 D3D11 : dEQP-GLES31.functional.stencil_texturing.* = SKIP 1442 D3D11 : dEQP-GLES31.functional.stencil_texturing.* = SKIP
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment