Commit f0d0408a by Olli Etuaho Committed by Commit Bot

Use OES_texture_storage_multisample_2d_array

There's an OES extension for multisample texture arrays, OES_texture_storage_multisample_2d_array. Change references from ANGLE_texture_multisample_array to the native extension in the shader compiler. ANGLE still needs to have robust behavior for out-of-range texel fetches that's not found in the original extension, but this does not need to be spelled out in the extension spec. BUG=angleproject:2775 TEST=angle_unittests Change-Id: Ie80ae767cc92ccaf7389af28789f45547f86978f Reviewed-on: https://chromium-review.googlesource.com/1193266 Commit-Queue: Olli Etuaho <oetuaho@nvidia.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent ddc41208
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
// Version number for shader translation API. // Version number for shader translation API.
// It is incremented every time the API changes. // It is incremented every time the API changes.
#define ANGLE_SH_VERSION 197 #define ANGLE_SH_VERSION 198
enum ShShaderSpec enum ShShaderSpec
{ {
...@@ -313,7 +313,7 @@ struct ShBuiltInResources ...@@ -313,7 +313,7 @@ struct ShBuiltInResources
int OVR_multiview; int OVR_multiview;
int EXT_YUV_target; int EXT_YUV_target;
int EXT_geometry_shader; int EXT_geometry_shader;
int ANGLE_texture_multisample_array; int OES_texture_storage_multisample_2d_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
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
"DXGI format:src/libANGLE/renderer/d3d/d3d11/gen_dxgi_format_table.py": "DXGI format:src/libANGLE/renderer/d3d/d3d11/gen_dxgi_format_table.py":
"2932a5e1c3c846be0169e29a4f9c72e8", "2932a5e1c3c846be0169e29a4f9c72e8",
"ESSL static builtins:src/compiler/translator/builtin_function_declarations.txt": "ESSL static builtins:src/compiler/translator/builtin_function_declarations.txt":
"36f9636dbfbcd6508a4b76143c5e4540", "336c2a275fe35bce1adc7e9b5918bdb0",
"ESSL static builtins:src/compiler/translator/builtin_variables.json": "ESSL static builtins:src/compiler/translator/builtin_variables.json":
"2c0e86ff9f92f79ada03f04206e63fba", "2c0e86ff9f92f79ada03f04206e63fba",
"ESSL static builtins:src/compiler/translator/gen_builtin_symbols.py": "ESSL static builtins:src/compiler/translator/gen_builtin_symbols.py":
......
...@@ -12,22 +12,22 @@ ...@@ -12,22 +12,22 @@
#include <string.h> #include <string.h>
#define LIST_EXTENSIONS(OP) \ #define LIST_EXTENSIONS(OP) \
OP(ANGLE_texture_multisample_array) \ OP(ARB_texture_rectangle) \
OP(ARB_texture_rectangle) \ OP(ARM_shader_framebuffer_fetch) \
OP(ARM_shader_framebuffer_fetch) \ OP(EXT_blend_func_extended) \
OP(EXT_blend_func_extended) \ OP(EXT_draw_buffers) \
OP(EXT_draw_buffers) \ OP(EXT_frag_depth) \
OP(EXT_frag_depth) \ OP(EXT_geometry_shader) \
OP(EXT_geometry_shader) \ OP(EXT_shader_framebuffer_fetch) \
OP(EXT_shader_framebuffer_fetch) \ OP(EXT_shader_texture_lod) \
OP(EXT_shader_texture_lod) \ OP(EXT_YUV_target) \
OP(EXT_YUV_target) \ OP(NV_EGL_stream_consumer_external) \
OP(NV_EGL_stream_consumer_external) \ OP(NV_shader_framebuffer_fetch) \
OP(NV_shader_framebuffer_fetch) \ OP(OES_EGL_image_external) \
OP(OES_EGL_image_external) \ OP(OES_EGL_image_external_essl3) \
OP(OES_EGL_image_external_essl3) \ OP(OES_standard_derivatives) \
OP(OES_standard_derivatives) \ OP(OES_texture_storage_multisample_2d_array) \
OP(OVR_multiview) OP(OVR_multiview)
namespace sh namespace sh
......
...@@ -18,7 +18,6 @@ enum class TExtension ...@@ -18,7 +18,6 @@ enum class TExtension
{ {
UNDEFINED, // Special value used to indicate no extension. UNDEFINED, // Special value used to indicate no extension.
ANGLE_texture_multisample_array,
ARB_texture_rectangle, ARB_texture_rectangle,
ARM_shader_framebuffer_fetch, ARM_shader_framebuffer_fetch,
EXT_blend_func_extended, EXT_blend_func_extended,
...@@ -33,6 +32,7 @@ enum class TExtension ...@@ -33,6 +32,7 @@ enum class TExtension
OES_EGL_image_external, OES_EGL_image_external,
OES_EGL_image_external_essl3, OES_EGL_image_external_essl3,
OES_standard_derivatives, OES_standard_derivatives,
OES_texture_storage_multisample_2d_array,
OVR_multiview OVR_multiview
}; };
......
...@@ -73,9 +73,9 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi ...@@ -73,9 +73,9 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{ {
extBehavior[TExtension::EXT_geometry_shader] = EBhUndefined; extBehavior[TExtension::EXT_geometry_shader] = EBhUndefined;
} }
if (resources.ANGLE_texture_multisample_array) if (resources.OES_texture_storage_multisample_2d_array)
{ {
extBehavior[TExtension::ANGLE_texture_multisample_array] = EBhUndefined; extBehavior[TExtension::OES_texture_storage_multisample_2d_array] = EBhUndefined;
} }
} }
......
...@@ -186,23 +186,23 @@ void InitBuiltInResources(ShBuiltInResources *resources) ...@@ -186,23 +186,23 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->MaxDrawBuffers = 1; resources->MaxDrawBuffers = 1;
// Extensions. // Extensions.
resources->OES_standard_derivatives = 0; resources->OES_standard_derivatives = 0;
resources->OES_EGL_image_external = 0; resources->OES_EGL_image_external = 0;
resources->OES_EGL_image_external_essl3 = 0; resources->OES_EGL_image_external_essl3 = 0;
resources->NV_EGL_stream_consumer_external = 0; resources->NV_EGL_stream_consumer_external = 0;
resources->ARB_texture_rectangle = 0; resources->ARB_texture_rectangle = 0;
resources->EXT_blend_func_extended = 0; resources->EXT_blend_func_extended = 0;
resources->EXT_draw_buffers = 0; resources->EXT_draw_buffers = 0;
resources->EXT_frag_depth = 0; resources->EXT_frag_depth = 0;
resources->EXT_shader_texture_lod = 0; resources->EXT_shader_texture_lod = 0;
resources->WEBGL_debug_shader_precision = 0; resources->WEBGL_debug_shader_precision = 0;
resources->EXT_shader_framebuffer_fetch = 0; resources->EXT_shader_framebuffer_fetch = 0;
resources->NV_shader_framebuffer_fetch = 0; resources->NV_shader_framebuffer_fetch = 0;
resources->ARM_shader_framebuffer_fetch = 0; resources->ARM_shader_framebuffer_fetch = 0;
resources->OVR_multiview = 0; resources->OVR_multiview = 0;
resources->EXT_YUV_target = 0; resources->EXT_YUV_target = 0;
resources->EXT_geometry_shader = 0; resources->EXT_geometry_shader = 0;
resources->ANGLE_texture_multisample_array = 0; resources->OES_texture_storage_multisample_2d_array = 0;
resources->NV_draw_buffers = 0; resources->NV_draw_buffers = 0;
......
...@@ -8142,7 +8142,7 @@ constexpr const TFunction kFunction_textureSize_0a( ...@@ -8142,7 +8142,7 @@ constexpr const TFunction kFunction_textureSize_0a(
constexpr const TFunction kFunction_textureSize_0P( constexpr const TFunction kFunction_textureSize_0P(
BuiltInId::textureSize_Sampler2DMSArray1, BuiltInId::textureSize_Sampler2DMSArray1,
BuiltInName::textureSize, BuiltInName::textureSize,
TExtension::ANGLE_texture_multisample_array, TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0P2C0C, BuiltInParameters::p0P2C0C,
1, 1,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(), StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(),
...@@ -8151,7 +8151,7 @@ constexpr const TFunction kFunction_textureSize_0P( ...@@ -8151,7 +8151,7 @@ constexpr const TFunction kFunction_textureSize_0P(
constexpr const TFunction kFunction_textureSize_0V( constexpr const TFunction kFunction_textureSize_0V(
BuiltInId::textureSize_ISampler2DMSArray1, BuiltInId::textureSize_ISampler2DMSArray1,
BuiltInName::textureSize, BuiltInName::textureSize,
TExtension::ANGLE_texture_multisample_array, TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0V2C0C, BuiltInParameters::p0V2C0C,
1, 1,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(), StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(),
...@@ -8160,7 +8160,7 @@ constexpr const TFunction kFunction_textureSize_0V( ...@@ -8160,7 +8160,7 @@ constexpr const TFunction kFunction_textureSize_0V(
constexpr const TFunction kFunction_textureSize_0b( constexpr const TFunction kFunction_textureSize_0b(
BuiltInId::textureSize_USampler2DMSArray1, BuiltInId::textureSize_USampler2DMSArray1,
BuiltInName::textureSize, BuiltInName::textureSize,
TExtension::ANGLE_texture_multisample_array, TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0b2C0C, BuiltInParameters::p0b2C0C,
1, 1,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(), StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(),
...@@ -9384,7 +9384,7 @@ constexpr const TFunction kFunction_texelFetch_0a1C0C( ...@@ -9384,7 +9384,7 @@ constexpr const TFunction kFunction_texelFetch_0a1C0C(
constexpr const TFunction kFunction_texelFetch_0P2C0C( constexpr const TFunction kFunction_texelFetch_0P2C0C(
BuiltInId::texelFetch_Sampler2DMSArray1_Int3_Int1, BuiltInId::texelFetch_Sampler2DMSArray1_Int3_Int1,
BuiltInName::texelFetch, BuiltInName::texelFetch,
TExtension::ANGLE_texture_multisample_array, TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0P2C0C, BuiltInParameters::p0P2C0C,
3, 3,
StaticType::Get<EbtFloat, EbpUndefined, EvqGlobal, 4, 1>(), StaticType::Get<EbtFloat, EbpUndefined, EvqGlobal, 4, 1>(),
...@@ -9393,7 +9393,7 @@ constexpr const TFunction kFunction_texelFetch_0P2C0C( ...@@ -9393,7 +9393,7 @@ constexpr const TFunction kFunction_texelFetch_0P2C0C(
constexpr const TFunction kFunction_texelFetch_0V2C0C( constexpr const TFunction kFunction_texelFetch_0V2C0C(
BuiltInId::texelFetch_ISampler2DMSArray1_Int3_Int1, BuiltInId::texelFetch_ISampler2DMSArray1_Int3_Int1,
BuiltInName::texelFetch, BuiltInName::texelFetch,
TExtension::ANGLE_texture_multisample_array, TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0V2C0C, BuiltInParameters::p0V2C0C,
3, 3,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 4, 1>(), StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 4, 1>(),
...@@ -9402,7 +9402,7 @@ constexpr const TFunction kFunction_texelFetch_0V2C0C( ...@@ -9402,7 +9402,7 @@ constexpr const TFunction kFunction_texelFetch_0V2C0C(
constexpr const TFunction kFunction_texelFetch_0b2C0C( constexpr const TFunction kFunction_texelFetch_0b2C0C(
BuiltInId::texelFetch_USampler2DMSArray1_Int3_Int1, BuiltInId::texelFetch_USampler2DMSArray1_Int3_Int1,
BuiltInName::texelFetch, BuiltInName::texelFetch,
TExtension::ANGLE_texture_multisample_array, TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0b2C0C, BuiltInParameters::p0b2C0C,
3, 3,
StaticType::Get<EbtUInt, EbpUndefined, EvqGlobal, 4, 1>(), StaticType::Get<EbtUInt, EbpUndefined, EvqGlobal, 4, 1>(),
......
...@@ -382,7 +382,7 @@ GROUP BEGIN TextureSizeMS ...@@ -382,7 +382,7 @@ GROUP BEGIN TextureSizeMS
GROUP END TextureSizeMS GROUP END TextureSizeMS
GROUP BEGIN TextureSizeMSArray GROUP BEGIN TextureSizeMSArray
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "ANGLE_texture_multisample_array"} DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_storage_multisample_2d_array"}
ivec3 textureSize(gsampler2DMSArray); ivec3 textureSize(gsampler2DMSArray);
GROUP END TextureSizeMSArray GROUP END TextureSizeMSArray
...@@ -478,7 +478,7 @@ GROUP BEGIN TexelFetchMS ...@@ -478,7 +478,7 @@ GROUP BEGIN TexelFetchMS
GROUP END TexelFetchMS GROUP END TexelFetchMS
GROUP BEGIN TexelFetchMSArray GROUP BEGIN TexelFetchMSArray
DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "ANGLE_texture_multisample_array"} DEFAULT METADATA {"level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "extension": "OES_texture_storage_multisample_2d_array"}
gvec4 texelFetch(gsampler2DMSArray, ivec3, int); gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
GROUP END TexelFetchMSArray GROUP END TexelFetchMSArray
......
981c1d80d682250a98834c8c1297e616 73cc05cec23b85e97dfc3c1b334a927c
\ No newline at end of file \ No newline at end of file
...@@ -204,9 +204,9 @@ O [0-7] ...@@ -204,9 +204,9 @@ O [0-7]
"samplerCubeShadow" { return ES2_ident_ES3_keyword(context, SAMPLERCUBESHADOW); } "samplerCubeShadow" { return ES2_ident_ES3_keyword(context, SAMPLERCUBESHADOW); }
"sampler2DArrayShadow" { return ES2_ident_ES3_keyword(context, SAMPLER2DARRAYSHADOW); } "sampler2DArrayShadow" { return ES2_ident_ES3_keyword(context, SAMPLER2DARRAYSHADOW); }
"__samplerExternal2DY2YEXT" { return ES3_extension_keyword_else_ident(context, TExtension::EXT_YUV_target, SAMPLEREXTERNAL2DY2YEXT); } "__samplerExternal2DY2YEXT" { return ES3_extension_keyword_else_ident(context, TExtension::EXT_YUV_target, SAMPLEREXTERNAL2DY2YEXT); }
"sampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, SAMPLER2DMSARRAY); } "sampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, SAMPLER2DMSARRAY); }
"isampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, ISAMPLER2DMSARRAY); } "isampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, ISAMPLER2DMSARRAY); }
"usampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, USAMPLER2DMSARRAY); } "usampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, USAMPLER2DMSARRAY); }
"struct" { return STRUCT; } "struct" { return STRUCT; }
......
...@@ -2028,15 +2028,15 @@ YY_RULE_SETUP ...@@ -2028,15 +2028,15 @@ YY_RULE_SETUP
YY_BREAK YY_BREAK
case 83: case 83:
YY_RULE_SETUP YY_RULE_SETUP
{ return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, SAMPLER2DMSARRAY); } { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, SAMPLER2DMSARRAY); }
YY_BREAK YY_BREAK
case 84: case 84:
YY_RULE_SETUP YY_RULE_SETUP
{ return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, ISAMPLER2DMSARRAY); } { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, ISAMPLER2DMSARRAY); }
YY_BREAK YY_BREAK
case 85: case 85:
YY_RULE_SETUP YY_RULE_SETUP
{ return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, USAMPLER2DMSARRAY); } { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, USAMPLER2DMSARRAY); }
YY_BREAK YY_BREAK
case 86: case 86:
YY_RULE_SETUP YY_RULE_SETUP
......
...@@ -31,7 +31,7 @@ class SamplerMultisampleArrayTest : public ShaderCompileTreeTest ...@@ -31,7 +31,7 @@ class SamplerMultisampleArrayTest : public ShaderCompileTreeTest
void initResources(ShBuiltInResources *resources) override void initResources(ShBuiltInResources *resources) override
{ {
resources->ANGLE_texture_multisample_array = 1; resources->OES_texture_storage_multisample_2d_array = 1;
} }
protected: protected:
...@@ -238,7 +238,7 @@ TEST_F(SamplerMultisampleArrayTest, TexelFetchSampler2DMSArray) ...@@ -238,7 +238,7 @@ TEST_F(SamplerMultisampleArrayTest, TexelFetchSampler2DMSArray)
{ {
const std::string &shaderString = const std::string &shaderString =
R"(#version 310 es R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require #extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float; precision highp float;
uniform highp sampler2DMSArray s; uniform highp sampler2DMSArray s;
uniform highp isampler2DMSArray is; uniform highp isampler2DMSArray is;
...@@ -261,7 +261,7 @@ TEST_F(SamplerMultisampleArrayTest, TextureSizeSampler2DMSArray) ...@@ -261,7 +261,7 @@ TEST_F(SamplerMultisampleArrayTest, TextureSizeSampler2DMSArray)
{ {
const std::string &shaderString = const std::string &shaderString =
R"(#version 310 es R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require #extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float; precision highp float;
uniform highp sampler2DMSArray s; uniform highp sampler2DMSArray s;
uniform highp isampler2DMSArray is; uniform highp isampler2DMSArray is;
...@@ -284,7 +284,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionSampler2DMSArray) ...@@ -284,7 +284,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionSampler2DMSArray)
{ {
const std::string &shaderString = const std::string &shaderString =
R"(#version 310 es R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require #extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float; precision highp float;
uniform sampler2DMSArray s; uniform sampler2DMSArray s;
...@@ -301,7 +301,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionISampler2DMSArray) ...@@ -301,7 +301,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionISampler2DMSArray)
{ {
const std::string &shaderString = const std::string &shaderString =
R"(#version 310 es R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require #extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float; precision highp float;
uniform isampler2DMSArray s; uniform isampler2DMSArray s;
...@@ -318,7 +318,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionUSampler2DMSArray) ...@@ -318,7 +318,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionUSampler2DMSArray)
{ {
const std::string &shaderString = const std::string &shaderString =
R"(#version 310 es R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require #extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float; precision highp float;
uniform usampler2DMSArray s; uniform usampler2DMSArray s;
......
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