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 @@
// Version number for shader translation API.
// It is incremented every time the API changes.
#define ANGLE_SH_VERSION 197
#define ANGLE_SH_VERSION 198
enum ShShaderSpec
{
......@@ -313,7 +313,7 @@ struct ShBuiltInResources
int OVR_multiview;
int EXT_YUV_target;
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
// with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate
......
......@@ -32,7 +32,7 @@
"DXGI format:src/libANGLE/renderer/d3d/d3d11/gen_dxgi_format_table.py":
"2932a5e1c3c846be0169e29a4f9c72e8",
"ESSL static builtins:src/compiler/translator/builtin_function_declarations.txt":
"36f9636dbfbcd6508a4b76143c5e4540",
"336c2a275fe35bce1adc7e9b5918bdb0",
"ESSL static builtins:src/compiler/translator/builtin_variables.json":
"2c0e86ff9f92f79ada03f04206e63fba",
"ESSL static builtins:src/compiler/translator/gen_builtin_symbols.py":
......
......@@ -13,7 +13,6 @@
#include <string.h>
#define LIST_EXTENSIONS(OP) \
OP(ANGLE_texture_multisample_array) \
OP(ARB_texture_rectangle) \
OP(ARM_shader_framebuffer_fetch) \
OP(EXT_blend_func_extended) \
......@@ -28,6 +27,7 @@
OP(OES_EGL_image_external) \
OP(OES_EGL_image_external_essl3) \
OP(OES_standard_derivatives) \
OP(OES_texture_storage_multisample_2d_array) \
OP(OVR_multiview)
namespace sh
......
......@@ -18,7 +18,6 @@ enum class TExtension
{
UNDEFINED, // Special value used to indicate no extension.
ANGLE_texture_multisample_array,
ARB_texture_rectangle,
ARM_shader_framebuffer_fetch,
EXT_blend_func_extended,
......@@ -33,6 +32,7 @@ enum class TExtension
OES_EGL_image_external,
OES_EGL_image_external_essl3,
OES_standard_derivatives,
OES_texture_storage_multisample_2d_array,
OVR_multiview
};
......
......@@ -73,9 +73,9 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
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;
}
}
......
......@@ -202,7 +202,7 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->OVR_multiview = 0;
resources->EXT_YUV_target = 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;
......
......@@ -8142,7 +8142,7 @@ constexpr const TFunction kFunction_textureSize_0a(
constexpr const TFunction kFunction_textureSize_0P(
BuiltInId::textureSize_Sampler2DMSArray1,
BuiltInName::textureSize,
TExtension::ANGLE_texture_multisample_array,
TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0P2C0C,
1,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(),
......@@ -8151,7 +8151,7 @@ constexpr const TFunction kFunction_textureSize_0P(
constexpr const TFunction kFunction_textureSize_0V(
BuiltInId::textureSize_ISampler2DMSArray1,
BuiltInName::textureSize,
TExtension::ANGLE_texture_multisample_array,
TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0V2C0C,
1,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(),
......@@ -8160,7 +8160,7 @@ constexpr const TFunction kFunction_textureSize_0V(
constexpr const TFunction kFunction_textureSize_0b(
BuiltInId::textureSize_USampler2DMSArray1,
BuiltInName::textureSize,
TExtension::ANGLE_texture_multisample_array,
TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0b2C0C,
1,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 3, 1>(),
......@@ -9384,7 +9384,7 @@ constexpr const TFunction kFunction_texelFetch_0a1C0C(
constexpr const TFunction kFunction_texelFetch_0P2C0C(
BuiltInId::texelFetch_Sampler2DMSArray1_Int3_Int1,
BuiltInName::texelFetch,
TExtension::ANGLE_texture_multisample_array,
TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0P2C0C,
3,
StaticType::Get<EbtFloat, EbpUndefined, EvqGlobal, 4, 1>(),
......@@ -9393,7 +9393,7 @@ constexpr const TFunction kFunction_texelFetch_0P2C0C(
constexpr const TFunction kFunction_texelFetch_0V2C0C(
BuiltInId::texelFetch_ISampler2DMSArray1_Int3_Int1,
BuiltInName::texelFetch,
TExtension::ANGLE_texture_multisample_array,
TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0V2C0C,
3,
StaticType::Get<EbtInt, EbpUndefined, EvqGlobal, 4, 1>(),
......@@ -9402,7 +9402,7 @@ constexpr const TFunction kFunction_texelFetch_0V2C0C(
constexpr const TFunction kFunction_texelFetch_0b2C0C(
BuiltInId::texelFetch_USampler2DMSArray1_Int3_Int1,
BuiltInName::texelFetch,
TExtension::ANGLE_texture_multisample_array,
TExtension::OES_texture_storage_multisample_2d_array,
BuiltInParameters::p0b2C0C,
3,
StaticType::Get<EbtUInt, EbpUndefined, EvqGlobal, 4, 1>(),
......
......@@ -382,7 +382,7 @@ GROUP BEGIN TextureSizeMS
GROUP END TextureSizeMS
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);
GROUP END TextureSizeMSArray
......@@ -478,7 +478,7 @@ GROUP BEGIN TexelFetchMS
GROUP END TexelFetchMS
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);
GROUP END TexelFetchMSArray
......
981c1d80d682250a98834c8c1297e616
\ No newline at end of file
73cc05cec23b85e97dfc3c1b334a927c
\ No newline at end of file
......@@ -204,9 +204,9 @@ O [0-7]
"samplerCubeShadow" { return ES2_ident_ES3_keyword(context, SAMPLERCUBESHADOW); }
"sampler2DArrayShadow" { return ES2_ident_ES3_keyword(context, SAMPLER2DARRAYSHADOW); }
"__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); }
"isampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, ISAMPLER2DMSARRAY); }
"usampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::ANGLE_texture_multisample_array, USAMPLER2DMSARRAY); }
"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::OES_texture_storage_multisample_2d_array, ISAMPLER2DMSARRAY); }
"usampler2DMSArray" { return ES2_ident_ES3_reserved_ES3_1_extension_keyword(context, TExtension::OES_texture_storage_multisample_2d_array, USAMPLER2DMSARRAY); }
"struct" { return STRUCT; }
......
......@@ -2028,15 +2028,15 @@ YY_RULE_SETUP
YY_BREAK
case 83:
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
case 84:
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
case 85:
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
case 86:
YY_RULE_SETUP
......
......@@ -31,7 +31,7 @@ class SamplerMultisampleArrayTest : public ShaderCompileTreeTest
void initResources(ShBuiltInResources *resources) override
{
resources->ANGLE_texture_multisample_array = 1;
resources->OES_texture_storage_multisample_2d_array = 1;
}
protected:
......@@ -238,7 +238,7 @@ TEST_F(SamplerMultisampleArrayTest, TexelFetchSampler2DMSArray)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require
#extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float;
uniform highp sampler2DMSArray s;
uniform highp isampler2DMSArray is;
......@@ -261,7 +261,7 @@ TEST_F(SamplerMultisampleArrayTest, TextureSizeSampler2DMSArray)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require
#extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float;
uniform highp sampler2DMSArray s;
uniform highp isampler2DMSArray is;
......@@ -284,7 +284,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionSampler2DMSArray)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require
#extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float;
uniform sampler2DMSArray s;
......@@ -301,7 +301,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionISampler2DMSArray)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require
#extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float;
uniform isampler2DMSArray s;
......@@ -318,7 +318,7 @@ TEST_F(SamplerMultisampleArrayTest, NoPrecisionUSampler2DMSArray)
{
const std::string &shaderString =
R"(#version 310 es
#extension GL_ANGLE_texture_multisample_array : require
#extension GL_OES_texture_storage_multisample_2d_array : require
precision highp float;
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