|
|
|
@@ -354,6 +354,7 @@ class PixelLocalStorageTest : public ANGLETest<>
|
|
|
|
setConfigGreenBits(8);
|
|
|
|
setConfigGreenBits(8);
|
|
|
|
setConfigBlueBits(8);
|
|
|
|
setConfigBlueBits(8);
|
|
|
|
setConfigAlphaBits(8);
|
|
|
|
setConfigAlphaBits(8);
|
|
|
|
|
|
|
|
setExtensionsEnabled(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void testTearDown() override
|
|
|
|
void testTearDown() override
|
|
|
|
@@ -368,7 +369,7 @@ class PixelLocalStorageTest : public ANGLETest<>
|
|
|
|
|
|
|
|
|
|
|
|
void testSetUp() override
|
|
|
|
void testSetUp() override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
glGetIntegerv(GL_MAX_PIXEL_LOCAL_STORAGE_PLANES_ANGLE, &MAX_PIXEL_LOCAL_STORAGE_PLANES);
|
|
|
|
glGetIntegerv(GL_MAX_PIXEL_LOCAL_STORAGE_PLANES_ANGLE, &MAX_PIXEL_LOCAL_STORAGE_PLANES);
|
|
|
|
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE_ANGLE,
|
|
|
|
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE_ANGLE,
|
|
|
|
@@ -467,7 +468,7 @@ class PixelLocalStorageTest : public ANGLETest<>
|
|
|
|
// Verify conformant implementation-dependent PLS limits.
|
|
|
|
// Verify conformant implementation-dependent PLS limits.
|
|
|
|
TEST_P(PixelLocalStorageTest, ImplementationDependentLimits)
|
|
|
|
TEST_P(PixelLocalStorageTest, ImplementationDependentLimits)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
// Table 6.X: Impementation Dependent Pixel Local Storage Limits.
|
|
|
|
// Table 6.X: Impementation Dependent Pixel Local Storage Limits.
|
|
|
|
EXPECT_TRUE(MAX_PIXEL_LOCAL_STORAGE_PLANES >= 4);
|
|
|
|
EXPECT_TRUE(MAX_PIXEL_LOCAL_STORAGE_PLANES >= 4);
|
|
|
|
@@ -488,7 +489,7 @@ TEST_P(PixelLocalStorageTest, ImplementationDependentLimits)
|
|
|
|
// Verify that rgba8, rgba8i, and rgba8ui pixel local storage behaves as specified.
|
|
|
|
// Verify that rgba8, rgba8i, and rgba8ui pixel local storage behaves as specified.
|
|
|
|
TEST_P(PixelLocalStorageTest, RGBA8)
|
|
|
|
TEST_P(PixelLocalStorageTest, RGBA8)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
layout(binding=0, rgba8) uniform lowp pixelLocalANGLE plane1;
|
|
|
|
layout(binding=0, rgba8) uniform lowp pixelLocalANGLE plane1;
|
|
|
|
@@ -541,7 +542,7 @@ TEST_P(PixelLocalStorageTest, RGBA8)
|
|
|
|
// Verify that r32f and r32ui pixel local storage behaves as specified.
|
|
|
|
// Verify that r32f and r32ui pixel local storage behaves as specified.
|
|
|
|
TEST_P(PixelLocalStorageTest, R32)
|
|
|
|
TEST_P(PixelLocalStorageTest, R32)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
layout(r32f, binding=0) uniform highp pixelLocalANGLE plane1;
|
|
|
|
layout(r32f, binding=0) uniform highp pixelLocalANGLE plane1;
|
|
|
|
@@ -630,7 +631,7 @@ TEST_P(PixelLocalStorageTest, R32)
|
|
|
|
// Check proper functioning of the clear value state.
|
|
|
|
// Check proper functioning of the clear value state.
|
|
|
|
TEST_P(PixelLocalStorageTest, ClearValues_rgba8)
|
|
|
|
TEST_P(PixelLocalStorageTest, ClearValues_rgba8)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex8f(GL_RGBA8, 1, 1);
|
|
|
|
PLSTestTexture tex8f(GL_RGBA8, 1, 1);
|
|
|
|
PLSTestTexture tex8i(GL_RGBA8I, 1, 1);
|
|
|
|
PLSTestTexture tex8i(GL_RGBA8I, 1, 1);
|
|
|
|
@@ -799,7 +800,7 @@ TEST_P(PixelLocalStorageTest, ClearValues_rgba8)
|
|
|
|
// Check clear values for r32f and r32ui PLS format.
|
|
|
|
// Check clear values for r32f and r32ui PLS format.
|
|
|
|
TEST_P(PixelLocalStorageTest, ClearValues_r32)
|
|
|
|
TEST_P(PixelLocalStorageTest, ClearValues_r32)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
|
|
|
@@ -828,7 +829,7 @@ TEST_P(PixelLocalStorageTest, ClearValues_r32)
|
|
|
|
// GL_MAX_LOCAL_STORAGE_PLANES_ANGLE planes.
|
|
|
|
// GL_MAX_LOCAL_STORAGE_PLANES_ANGLE planes.
|
|
|
|
TEST_P(PixelLocalStorageTest, LoadOps)
|
|
|
|
TEST_P(PixelLocalStorageTest, LoadOps)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
std::stringstream fs;
|
|
|
|
std::stringstream fs;
|
|
|
|
for (int i = 0; i < MAX_PIXEL_LOCAL_STORAGE_PLANES; ++i)
|
|
|
|
for (int i = 0; i < MAX_PIXEL_LOCAL_STORAGE_PLANES; ++i)
|
|
|
|
@@ -974,7 +975,7 @@ constexpr static Box FRAG_REJECT_TEST_BOX(FULLSCREEN,
|
|
|
|
// Check that the stencil test prevents stores to PLS.
|
|
|
|
// Check that the stencil test prevents stores to PLS.
|
|
|
|
TEST_P(PixelLocalStorageTest, FragmentReject_stencil)
|
|
|
|
TEST_P(PixelLocalStorageTest, FragmentReject_stencil)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
FragmentRejectTestFBO fbo(tex);
|
|
|
|
FragmentRejectTestFBO fbo(tex);
|
|
|
|
@@ -1028,7 +1029,7 @@ TEST_P(PixelLocalStorageTest, FragmentReject_stencil)
|
|
|
|
// Check that the depth test prevents stores to PLS.
|
|
|
|
// Check that the depth test prevents stores to PLS.
|
|
|
|
TEST_P(PixelLocalStorageTest, FragmentReject_depth)
|
|
|
|
TEST_P(PixelLocalStorageTest, FragmentReject_depth)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
FragmentRejectTestFBO fbo(tex);
|
|
|
|
FragmentRejectTestFBO fbo(tex);
|
|
|
|
@@ -1070,7 +1071,7 @@ TEST_P(PixelLocalStorageTest, FragmentReject_depth)
|
|
|
|
// Check that restricting the viewport also restricts stores to PLS.
|
|
|
|
// Check that restricting the viewport also restricts stores to PLS.
|
|
|
|
TEST_P(PixelLocalStorageTest, FragmentReject_viewport)
|
|
|
|
TEST_P(PixelLocalStorageTest, FragmentReject_viewport)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
FragmentRejectTestFBO fbo(tex);
|
|
|
|
FragmentRejectTestFBO fbo(tex);
|
|
|
|
@@ -1101,7 +1102,7 @@ TEST_P(PixelLocalStorageTest, FragmentReject_viewport)
|
|
|
|
// random or leaked from other contexts when we forget to insert a barrier.
|
|
|
|
// random or leaked from other contexts when we forget to insert a barrier.
|
|
|
|
TEST_P(PixelLocalStorageTest, ForgetBarrier)
|
|
|
|
TEST_P(PixelLocalStorageTest, ForgetBarrier)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
layout(binding=0, r32f) uniform highp pixelLocalANGLE framebuffer;
|
|
|
|
layout(binding=0, r32f) uniform highp pixelLocalANGLE framebuffer;
|
|
|
|
@@ -1210,7 +1211,7 @@ TEST_P(PixelLocalStorageTest, ForgetBarrier)
|
|
|
|
// Check loading and storing from memoryless local storage planes.
|
|
|
|
// Check loading and storing from memoryless local storage planes.
|
|
|
|
TEST_P(PixelLocalStorageTest, MemorylessStorage)
|
|
|
|
TEST_P(PixelLocalStorageTest, MemorylessStorage)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
// Bind the texture, but don't call glTexStorage until after creating the memoryless plane.
|
|
|
|
// Bind the texture, but don't call glTexStorage until after creating the memoryless plane.
|
|
|
|
GLTexture tex;
|
|
|
|
GLTexture tex;
|
|
|
|
@@ -1281,7 +1282,7 @@ TEST_P(PixelLocalStorageTest, MemorylessStorage)
|
|
|
|
//
|
|
|
|
//
|
|
|
|
TEST_P(PixelLocalStorageTest, MaxCombinedDrawBuffersAndPLSPlanes)
|
|
|
|
TEST_P(PixelLocalStorageTest, MaxCombinedDrawBuffersAndPLSPlanes)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
for (int numDrawBuffers : {0, 1, MAX_COMBINED_DRAW_BUFFERS_AND_PIXEL_LOCAL_STORAGE_PLANES - 1})
|
|
|
|
for (int numDrawBuffers : {0, 1, MAX_COMBINED_DRAW_BUFFERS_AND_PIXEL_LOCAL_STORAGE_PLANES - 1})
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@@ -1375,7 +1376,7 @@ TEST_P(PixelLocalStorageTest, MaxCombinedDrawBuffersAndPLSPlanes)
|
|
|
|
// Verifies that program caching works for programs that use pixel local storage.
|
|
|
|
// Verifies that program caching works for programs that use pixel local storage.
|
|
|
|
TEST_P(PixelLocalStorageTest, ProgramCache)
|
|
|
|
TEST_P(PixelLocalStorageTest, ProgramCache)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
|
|
|
@@ -1442,7 +1443,7 @@ TEST_P(PixelLocalStorageTest, ProgramCache)
|
|
|
|
// Also check that a pixelLocalLoadANGLE() of an r32f texture returns (r, 0, 0, 1).
|
|
|
|
// Also check that a pixelLocalLoadANGLE() of an r32f texture returns (r, 0, 0, 1).
|
|
|
|
TEST_P(PixelLocalStorageTest, LoadOnly)
|
|
|
|
TEST_P(PixelLocalStorageTest, LoadOnly)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
|
|
|
|
|
|
|
|
@@ -1580,7 +1581,7 @@ TEST_P(PixelLocalStorageTest, LoadOnly)
|
|
|
|
// Check that stores and loads in a single shader invocation are coherent.
|
|
|
|
// Check that stores and loads in a single shader invocation are coherent.
|
|
|
|
TEST_P(PixelLocalStorageTest, LoadAfterStore)
|
|
|
|
TEST_P(PixelLocalStorageTest, LoadAfterStore)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
// Run a fibonacci loop that stores and loads the same PLS multiple times.
|
|
|
|
// Run a fibonacci loop that stores and loads the same PLS multiple times.
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
@@ -1690,7 +1691,7 @@ TEST_P(PixelLocalStorageTest, LoadAfterStore)
|
|
|
|
// Check that PLS handles can be passed as function arguments.
|
|
|
|
// Check that PLS handles can be passed as function arguments.
|
|
|
|
TEST_P(PixelLocalStorageTest, FunctionArguments)
|
|
|
|
TEST_P(PixelLocalStorageTest, FunctionArguments)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
layout(binding=0, rgba8) uniform lowp pixelLocalANGLE dst;
|
|
|
|
layout(binding=0, rgba8) uniform lowp pixelLocalANGLE dst;
|
|
|
|
@@ -1755,7 +1756,7 @@ TEST_P(PixelLocalStorageTest, FunctionArguments)
|
|
|
|
// Check that if the "_coherent" extension is advertised, PLS operations are ordered and coherent.
|
|
|
|
// Check that if the "_coherent" extension is advertised, PLS operations are ordered and coherent.
|
|
|
|
TEST_P(PixelLocalStorageTest, Coherency)
|
|
|
|
TEST_P(PixelLocalStorageTest, Coherency)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
layout(binding=0, rgba8ui) uniform lowp upixelLocalANGLE framebuffer;
|
|
|
|
layout(binding=0, rgba8ui) uniform lowp upixelLocalANGLE framebuffer;
|
|
|
|
@@ -1863,7 +1864,7 @@ TEST_P(PixelLocalStorageTest, Coherency)
|
|
|
|
// Check that binding mipmap levels to PLS is supported.
|
|
|
|
// Check that binding mipmap levels to PLS is supported.
|
|
|
|
TEST_P(PixelLocalStorageTest, MipMapLevels)
|
|
|
|
TEST_P(PixelLocalStorageTest, MipMapLevels)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile(R"(
|
|
|
|
mProgram.compile(R"(
|
|
|
|
layout(binding=0, rgba8) uniform lowp pixelLocalANGLE pls;
|
|
|
|
layout(binding=0, rgba8) uniform lowp pixelLocalANGLE pls;
|
|
|
|
@@ -1924,7 +1925,7 @@ TEST_P(PixelLocalStorageTest, MipMapLevels)
|
|
|
|
|
|
|
|
|
|
|
|
void PixelLocalStorageTest::doStateRestorationTest()
|
|
|
|
void PixelLocalStorageTest::doStateRestorationTest()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
// Setup state.
|
|
|
|
// Setup state.
|
|
|
|
PLSTestTexture plsTex(GL_RGBA8UI, 32, 33);
|
|
|
|
PLSTestTexture plsTex(GL_RGBA8UI, 32, 33);
|
|
|
|
@@ -2092,14 +2093,14 @@ void PixelLocalStorageTest::doStateRestorationTest()
|
|
|
|
// Check that application-facing ES3 state is not perturbed by pixel local storage.
|
|
|
|
// Check that application-facing ES3 state is not perturbed by pixel local storage.
|
|
|
|
TEST_P(PixelLocalStorageTest, StateRestoration)
|
|
|
|
TEST_P(PixelLocalStorageTest, StateRestoration)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
doStateRestorationTest();
|
|
|
|
doStateRestorationTest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void PixelLocalStorageTest::doDrawStateTest()
|
|
|
|
void PixelLocalStorageTest::doDrawStateTest()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
glEnable(GL_BLEND);
|
|
|
|
glBlendFunc(GL_ZERO, GL_ONE);
|
|
|
|
glBlendFunc(GL_ZERO, GL_ONE);
|
|
|
|
@@ -2176,7 +2177,7 @@ void PixelLocalStorageTest::doDrawStateTest()
|
|
|
|
// EXT_shader_pixel_local_storage, where they are implemented as fullscreen draws.
|
|
|
|
// EXT_shader_pixel_local_storage, where they are implemented as fullscreen draws.
|
|
|
|
TEST_P(PixelLocalStorageTest, DrawStateReset)
|
|
|
|
TEST_P(PixelLocalStorageTest, DrawStateReset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
doDrawStateTest();
|
|
|
|
doDrawStateTest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -2185,7 +2186,7 @@ TEST_P(PixelLocalStorageTest, DrawStateReset)
|
|
|
|
// affect blend or color mask on the application's draw buffers.
|
|
|
|
// affect blend or color mask on the application's draw buffers.
|
|
|
|
TEST_P(PixelLocalStorageTest, BlendAndColorMask)
|
|
|
|
TEST_P(PixelLocalStorageTest, BlendAndColorMask)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex1(GL_RGBA8);
|
|
|
|
PLSTestTexture tex1(GL_RGBA8);
|
|
|
|
PLSTestTexture tex2(GL_RGBA8);
|
|
|
|
PLSTestTexture tex2(GL_RGBA8);
|
|
|
|
@@ -2302,8 +2303,8 @@ TEST_P(PixelLocalStorageTest, BlendAndColorMask)
|
|
|
|
// Check that PLS and EXT_shader_framebuffer_fetch can be used together.
|
|
|
|
// Check that PLS and EXT_shader_framebuffer_fetch can be used together.
|
|
|
|
TEST_P(PixelLocalStorageTest, ParallelFramebufferFetch)
|
|
|
|
TEST_P(PixelLocalStorageTest, ParallelFramebufferFetch)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_EXT_shader_framebuffer_fetch"));
|
|
|
|
ANGLE_SKIP_TEST_IF(MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE == 0);
|
|
|
|
ANGLE_SKIP_TEST_IF(MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE == 0);
|
|
|
|
|
|
|
|
|
|
|
|
mProgram.compile("#extension GL_EXT_shader_framebuffer_fetch : require", R"(
|
|
|
|
mProgram.compile("#extension GL_EXT_shader_framebuffer_fetch : require", R"(
|
|
|
|
@@ -2344,7 +2345,7 @@ TEST_P(PixelLocalStorageTest, ParallelFramebufferFetch)
|
|
|
|
// Check that PLS gets properly cleaned up when its framebuffer and textures are never deleted.
|
|
|
|
// Check that PLS gets properly cleaned up when its framebuffer and textures are never deleted.
|
|
|
|
TEST_P(PixelLocalStorageTest, LeakFramebufferAndTexture)
|
|
|
|
TEST_P(PixelLocalStorageTest, LeakFramebufferAndTexture)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
GLuint fbo;
|
|
|
|
GLuint fbo;
|
|
|
|
glGenFramebuffers(1, &fbo);
|
|
|
|
glGenFramebuffers(1, &fbo);
|
|
|
|
@@ -2372,7 +2373,7 @@ TEST_P(PixelLocalStorageTest, LeakFramebufferAndTexture)
|
|
|
|
// Check that sampler, texture, and PLS bindings all work when they are used in the same shader.
|
|
|
|
// Check that sampler, texture, and PLS bindings all work when they are used in the same shader.
|
|
|
|
TEST_P(PixelLocalStorageTest, PLSWithSamplers)
|
|
|
|
TEST_P(PixelLocalStorageTest, PLSWithSamplers)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
|
|
|
|
@@ -2505,27 +2506,29 @@ GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PixelLocalStorageTest);
|
|
|
|
.enable(Feature::DisableDrawBuffersIndexed), \
|
|
|
|
.enable(Feature::DisableDrawBuffersIndexed), \
|
|
|
|
__VA_ARGS__)
|
|
|
|
__VA_ARGS__)
|
|
|
|
|
|
|
|
|
|
|
|
#define PLS_INSTANTIATE_RENDERING_TEST(TEST, API) PLS_INSTANTIATE_RENDERING_TEST_AND(TEST, API)
|
|
|
|
#define PLS_INSTANTIATE_RENDERING_TEST_ES3(TEST) \
|
|
|
|
|
|
|
|
PLS_INSTANTIATE_RENDERING_TEST_AND( \
|
|
|
|
|
|
|
|
TEST, ES3, /* Metal, coherent (in tiled memory on Apple Silicon).*/ \
|
|
|
|
|
|
|
|
ES3_METAL().enable(Feature::EmulatePixelLocalStorage), /* Metal, coherent via raster order \
|
|
|
|
|
|
|
|
groups + read_write textures.*/ \
|
|
|
|
|
|
|
|
ES3_METAL() \
|
|
|
|
|
|
|
|
.enable(Feature::EmulatePixelLocalStorage) \
|
|
|
|
|
|
|
|
.enable(Feature::DisableProgrammableBlending), /* Metal, coherent, r32 packed \
|
|
|
|
|
|
|
|
read_write texture formats.*/ \
|
|
|
|
|
|
|
|
ES3_METAL() \
|
|
|
|
|
|
|
|
.enable(Feature::EmulatePixelLocalStorage) \
|
|
|
|
|
|
|
|
.enable(Feature::DisableProgrammableBlending) \
|
|
|
|
|
|
|
|
.enable(Feature::DisableRWTextureTier2Support), /* Metal, noncoherent if not on Apple \
|
|
|
|
|
|
|
|
Silicon. (Apple GPUs don't support \
|
|
|
|
|
|
|
|
fragment-to-fragment memory \
|
|
|
|
|
|
|
|
barriers.)*/ \
|
|
|
|
|
|
|
|
ES3_METAL() \
|
|
|
|
|
|
|
|
.enable(Feature::EmulatePixelLocalStorage) \
|
|
|
|
|
|
|
|
.enable(Feature::DisableRasterOrderGroups))
|
|
|
|
|
|
|
|
|
|
|
|
PLS_INSTANTIATE_RENDERING_TEST_AND(
|
|
|
|
#define PLS_INSTANTIATE_RENDERING_TEST_ES31(TEST) PLS_INSTANTIATE_RENDERING_TEST_AND(TEST, ES31)
|
|
|
|
PixelLocalStorageTest,
|
|
|
|
|
|
|
|
ES3,
|
|
|
|
PLS_INSTANTIATE_RENDERING_TEST_ES3(PixelLocalStorageTest);
|
|
|
|
// Metal, coherent (in tiled memory on Apple Silicon).
|
|
|
|
|
|
|
|
ES3_METAL().enable(Feature::EmulatePixelLocalStorage),
|
|
|
|
|
|
|
|
// Metal, coherent via raster order groups + read_write textures.
|
|
|
|
|
|
|
|
ES3_METAL()
|
|
|
|
|
|
|
|
.enable(Feature::EmulatePixelLocalStorage)
|
|
|
|
|
|
|
|
.enable(Feature::DisableProgrammableBlending),
|
|
|
|
|
|
|
|
// Metal, coherent, r32 packed read_write texture formats.
|
|
|
|
|
|
|
|
ES3_METAL()
|
|
|
|
|
|
|
|
.enable(Feature::EmulatePixelLocalStorage)
|
|
|
|
|
|
|
|
.enable(Feature::DisableProgrammableBlending)
|
|
|
|
|
|
|
|
.enable(Feature::DisableRWTextureTier2Support),
|
|
|
|
|
|
|
|
// Metal, noncoherent if not on Apple Silicon.
|
|
|
|
|
|
|
|
// (Apple GPUs don't support fragment-to-fragment memory barriers.)
|
|
|
|
|
|
|
|
ES3_METAL()
|
|
|
|
|
|
|
|
.enable(Feature::EmulatePixelLocalStorage)
|
|
|
|
|
|
|
|
.enable(Feature::DisableRasterOrderGroups));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PixelLocalStorageTestES31 : public PixelLocalStorageTest
|
|
|
|
class PixelLocalStorageTestES31 : public PixelLocalStorageTest
|
|
|
|
{};
|
|
|
|
{};
|
|
|
|
@@ -2533,7 +2536,7 @@ class PixelLocalStorageTestES31 : public PixelLocalStorageTest
|
|
|
|
// Check that early_fragment_tests are not triggered when PLS uniforms are not declared.
|
|
|
|
// Check that early_fragment_tests are not triggered when PLS uniforms are not declared.
|
|
|
|
TEST_P(PixelLocalStorageTestES31, EarlyFragmentTests)
|
|
|
|
TEST_P(PixelLocalStorageTestES31, EarlyFragmentTests)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
PLSTestTexture tex(GL_RGBA8);
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
GLFramebuffer fbo;
|
|
|
|
@@ -2626,7 +2629,7 @@ TEST_P(PixelLocalStorageTestES31, EarlyFragmentTests)
|
|
|
|
// Check that application-facing ES31 state is not perturbed by pixel local storage.
|
|
|
|
// Check that application-facing ES31 state is not perturbed by pixel local storage.
|
|
|
|
TEST_P(PixelLocalStorageTestES31, StateRestoration)
|
|
|
|
TEST_P(PixelLocalStorageTestES31, StateRestoration)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
doStateRestorationTest();
|
|
|
|
doStateRestorationTest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -2635,20 +2638,212 @@ TEST_P(PixelLocalStorageTestES31, StateRestoration)
|
|
|
|
// EXT_shader_pixel_local_storage, where they are implemented as fullscreen draws.
|
|
|
|
// EXT_shader_pixel_local_storage, where they are implemented as fullscreen draws.
|
|
|
|
TEST_P(PixelLocalStorageTestES31, DrawStateReset)
|
|
|
|
TEST_P(PixelLocalStorageTestES31, DrawStateReset)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ANGLE_SKIP_TEST_IF(!EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
doDrawStateTest();
|
|
|
|
doDrawStateTest();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PixelLocalStorageTestES31);
|
|
|
|
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PixelLocalStorageTestES31);
|
|
|
|
PLS_INSTANTIATE_RENDERING_TEST(PixelLocalStorageTestES31, ES31);
|
|
|
|
PLS_INSTANTIATE_RENDERING_TEST_ES31(PixelLocalStorageTestES31);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PixelLocalStorageRequestableExtensionTest : public ANGLETest<>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
PixelLocalStorageRequestableExtensionTest() { setExtensionsEnabled(false); }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void do_implicitly_enabled_extensions_test(const char *plsExtensionToRequest)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
bool hasDrawBuffersIndexedOES = IsGLExtensionRequestable("GL_OES_draw_buffers_indexed");
|
|
|
|
|
|
|
|
bool hasDrawBuffersIndexedEXT = IsGLExtensionRequestable("GL_EXT_draw_buffers_indexed");
|
|
|
|
|
|
|
|
bool hasColorBufferFloat = IsGLExtensionRequestable("GL_EXT_color_buffer_float");
|
|
|
|
|
|
|
|
bool hasColorBufferHalfFloat = IsGLExtensionRequestable("GL_EXT_color_buffer_half_float");
|
|
|
|
|
|
|
|
bool hasCoherent = IsGLExtensionRequestable("GL_ANGLE_shader_pixel_local_storage_coherent");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_OES_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_EXT_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_EXT_color_buffer_float"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_EXT_color_buffer_half_float"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glRequestExtensionANGLE(plsExtensionToRequest);
|
|
|
|
|
|
|
|
EXPECT_GL_NO_ERROR();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasDrawBuffersIndexedOES)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_OES_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasDrawBuffersIndexedEXT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasColorBufferFloat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_color_buffer_float"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasColorBufferHalfFloat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_color_buffer_half_float"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasCoherent)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasDrawBuffersIndexedOES)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// If OES_draw_buffers_indexed ever becomes disablable, it will have to implicitly disable
|
|
|
|
|
|
|
|
// ANGLE_shader_pixel_local_storage.
|
|
|
|
|
|
|
|
glDisableExtensionANGLE("GL_OES_draw_buffers_indexed");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_OES_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasDrawBuffersIndexedEXT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// If EXT_draw_buffers_indexed ever becomes disablable, it will have to implicitly disable
|
|
|
|
|
|
|
|
// ANGLE_shader_pixel_local_storage.
|
|
|
|
|
|
|
|
glDisableExtensionANGLE("GL_EXT_draw_buffers_indexed");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasColorBufferFloat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// If EXT_color_buffer_float ever becomes disablable, it will have to implicitly disable
|
|
|
|
|
|
|
|
// ANGLE_shader_pixel_local_storage.
|
|
|
|
|
|
|
|
glDisableExtensionANGLE("GL_EXT_color_buffer_float");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_color_buffer_float"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasColorBufferHalfFloat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// If EXT_color_buffer_half_float ever becomes disablable, it will have to implicitly
|
|
|
|
|
|
|
|
// disable ANGLE_shader_pixel_local_storage.
|
|
|
|
|
|
|
|
glDisableExtensionANGLE("GL_EXT_color_buffer_half_float");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_color_buffer_half_float"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (hasCoherent)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// ANGLE_shader_pixel_local_storage_coherent is not disablable.
|
|
|
|
|
|
|
|
glDisableExtensionANGLE("GL_ANGLE_shader_pixel_local_storage_coherent");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ANGLE_shader_pixel_local_storage is not disablable.
|
|
|
|
|
|
|
|
glDisableExtensionANGLE("GL_ANGLE_shader_pixel_local_storage");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// All dependency extensions should have remained enabled.
|
|
|
|
|
|
|
|
if (hasDrawBuffersIndexedOES)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_OES_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasDrawBuffersIndexedEXT)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasColorBufferFloat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_color_buffer_float"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasColorBufferHalfFloat)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_EXT_color_buffer_half_float"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasCoherent)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check that ANGLE_shader_pixel_local_storage implicitly enables its dependency extensions.
|
|
|
|
|
|
|
|
TEST_P(PixelLocalStorageRequestableExtensionTest, ImplicitlyEnabledExtensions)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsEGLDisplayExtensionEnabled(getEGLWindow()->getDisplay(),
|
|
|
|
|
|
|
|
"EGL_ANGLE_create_context_extensions_enabled"));
|
|
|
|
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionRequestable("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
do_implicitly_enabled_extensions_test("GL_ANGLE_shader_pixel_local_storage");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check that ANGLE_shader_pixel_local_storage_coherent implicitly enables its
|
|
|
|
|
|
|
|
// dependency extensions.
|
|
|
|
|
|
|
|
TEST_P(PixelLocalStorageRequestableExtensionTest, ImplicitlyEnabledExtensionsCoherent)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsEGLDisplayExtensionEnabled(getEGLWindow()->getDisplay(),
|
|
|
|
|
|
|
|
"EGL_ANGLE_create_context_extensions_enabled"));
|
|
|
|
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionRequestable("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
if (!IsGLExtensionRequestable("GL_ANGLE_shader_pixel_local_storage_coherent"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// Requesting GL_ANGLE_shader_pixel_local_storage_coherent should not implicitly enable any
|
|
|
|
|
|
|
|
// other extensions if the extension itself is not supported.
|
|
|
|
|
|
|
|
glRequestExtensionANGLE("GL_ANGLE_shader_pixel_local_storage_coherent");
|
|
|
|
|
|
|
|
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_OES_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_EXT_draw_buffers_indexed"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_EXT_color_buffer_float"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_EXT_color_buffer_half_float"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
do_implicitly_enabled_extensions_test("GL_ANGLE_shader_pixel_local_storage_coherent");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Check that the dependency extensions of ANGLE_shader_pixel_local_storage do not enable it.
|
|
|
|
|
|
|
|
TEST_P(PixelLocalStorageRequestableExtensionTest, ANGLEShaderPixelLocalStorageNotImplicitlyEnabled)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsEGLDisplayExtensionEnabled(getEGLWindow()->getDisplay(),
|
|
|
|
|
|
|
|
"EGL_ANGLE_create_context_extensions_enabled"));
|
|
|
|
|
|
|
|
ANGLE_SKIP_TEST_IF(!IsGLExtensionRequestable("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EnsureGLExtensionEnabled("GL_OES_draw_buffers_indexed");
|
|
|
|
|
|
|
|
EnsureGLExtensionEnabled("GL_EXT_draw_buffers_indexed");
|
|
|
|
|
|
|
|
EnsureGLExtensionEnabled("GL_EXT_color_buffer_float");
|
|
|
|
|
|
|
|
EnsureGLExtensionEnabled("GL_EXT_color_buffer_half_float");
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(!IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsGLExtensionRequestable("GL_ANGLE_shader_pixel_local_storage_coherent"))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
glRequestExtensionANGLE("GL_ANGLE_shader_pixel_local_storage_coherent");
|
|
|
|
|
|
|
|
EXPECT_GL_NO_ERROR();
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
glRequestExtensionANGLE("GL_ANGLE_shader_pixel_local_storage");
|
|
|
|
|
|
|
|
EXPECT_GL_NO_ERROR();
|
|
|
|
|
|
|
|
EXPECT_TRUE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PLS_INSTANTIATE_RENDERING_TEST_ES3(PixelLocalStorageRequestableExtensionTest);
|
|
|
|
|
|
|
|
|
|
|
|
class PixelLocalStorageValidationTest : public ANGLETest<>
|
|
|
|
class PixelLocalStorageValidationTest : public ANGLETest<>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PixelLocalStorageValidationTest() { setExtensionsEnabled(false); }
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
void testSetUp() override
|
|
|
|
void testSetUp() override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ASSERT(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ASSERT(EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
glGetIntegerv(GL_MAX_PIXEL_LOCAL_STORAGE_PLANES_ANGLE, &MAX_PIXEL_LOCAL_STORAGE_PLANES);
|
|
|
|
glGetIntegerv(GL_MAX_PIXEL_LOCAL_STORAGE_PLANES_ANGLE, &MAX_PIXEL_LOCAL_STORAGE_PLANES);
|
|
|
|
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE_ANGLE,
|
|
|
|
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE_ANGLE,
|
|
|
|
&MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE);
|
|
|
|
&MAX_COLOR_ATTACHMENTS_WITH_ACTIVE_PIXEL_LOCAL_STORAGE);
|
|
|
|
@@ -3926,25 +4121,25 @@ TEST_P(PixelLocalStorageValidationTest, BannedCommands)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_BANNED_CAP(GL_SAMPLE_MASK);
|
|
|
|
EXPECT_BANNED_CAP(GL_SAMPLE_MASK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IsGLExtensionEnabled("GL_EXT_multisample_compatibility"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_EXT_multisample_compatibility"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_BANNED_CAP(GL_MULTISAMPLE_EXT);
|
|
|
|
EXPECT_BANNED_CAP(GL_MULTISAMPLE_EXT);
|
|
|
|
EXPECT_BANNED_CAP(GL_SAMPLE_ALPHA_TO_ONE_EXT);
|
|
|
|
EXPECT_BANNED_CAP(GL_SAMPLE_ALPHA_TO_ONE_EXT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IsGLExtensionEnabled("GL_KHR_debug"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_KHR_debug"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_BANNED_CAP(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
|
|
|
EXPECT_BANNED_CAP(GL_DEBUG_OUTPUT_SYNCHRONOUS);
|
|
|
|
EXPECT_BANNED_CAP(GL_DEBUG_OUTPUT);
|
|
|
|
EXPECT_BANNED_CAP(GL_DEBUG_OUTPUT);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IsGLExtensionEnabled("GL_OES_sample_shading"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_OES_sample_shading"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_BANNED_CAP(GL_SAMPLE_SHADING);
|
|
|
|
EXPECT_BANNED_CAP(GL_SAMPLE_SHADING);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IsGLExtensionEnabled("GL_QCOM_shading_rate"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_QCOM_shading_rate"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_BANNED_CAP(GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM);
|
|
|
|
EXPECT_BANNED_CAP(GL_SHADING_RATE_PRESERVE_ASPECT_RATIO_QCOM);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (IsGLExtensionEnabled("GL_ANGLE_logic_op"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_ANGLE_logic_op"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_BANNED_CAP(GL_COLOR_LOGIC_OP);
|
|
|
|
EXPECT_BANNED_CAP(GL_COLOR_LOGIC_OP);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@@ -3995,7 +4190,7 @@ TEST_P(PixelLocalStorageValidationTest, BannedCommands)
|
|
|
|
glClearBufferiv(GL_STENCIL, 0, cleari);
|
|
|
|
glClearBufferiv(GL_STENCIL, 0, cleari);
|
|
|
|
EXPECT_GL_NO_ERROR();
|
|
|
|
EXPECT_GL_NO_ERROR();
|
|
|
|
|
|
|
|
|
|
|
|
if (IsGLExtensionEnabled("GL_OES_draw_buffers_indexed"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_OES_draw_buffers_indexed"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// INVALID_OPERATION is generated by Enablei*(), Disablei*() if and any
|
|
|
|
// INVALID_OPERATION is generated by Enablei*(), Disablei*() if and any
|
|
|
|
// of the following are true:
|
|
|
|
// of the following are true:
|
|
|
|
@@ -4183,10 +4378,13 @@ ANGLE_INSTANTIATE_TEST(PixelLocalStorageValidationTest,
|
|
|
|
|
|
|
|
|
|
|
|
class PixelLocalStorageCompilerTest : public ANGLETest<>
|
|
|
|
class PixelLocalStorageCompilerTest : public ANGLETest<>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PixelLocalStorageCompilerTest() { setExtensionsEnabled(false); }
|
|
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
protected:
|
|
|
|
void testSetUp() override
|
|
|
|
void testSetUp() override
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ASSERT(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
ASSERT(EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
|
|
|
|
|
|
|
|
// INVALID_OPERATION is generated if DITHER is enabled.
|
|
|
|
// INVALID_OPERATION is generated if DITHER is enabled.
|
|
|
|
glDisable(GL_DITHER);
|
|
|
|
glDisable(GL_DITHER);
|
|
|
|
@@ -4787,7 +4985,7 @@ TEST_P(PixelLocalStorageCompilerTest, FragmentTestVariables)
|
|
|
|
})";
|
|
|
|
})";
|
|
|
|
EXPECT_TRUE(log.compileFragmentShader(kReadFragDepth));
|
|
|
|
EXPECT_TRUE(log.compileFragmentShader(kReadFragDepth));
|
|
|
|
|
|
|
|
|
|
|
|
if (IsGLExtensionEnabled("GL_OES_sample_variables"))
|
|
|
|
if (EnsureGLExtensionEnabled("GL_OES_sample_variables"))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// gl_SampleMask is not assignable when pixel local storage has been declared. The shader
|
|
|
|
// gl_SampleMask is not assignable when pixel local storage has been declared. The shader
|
|
|
|
// image polyfill requires early_fragment_tests, which causes gl_SampleMask to be ignored.
|
|
|
|
// image polyfill requires early_fragment_tests, which causes gl_SampleMask to be ignored.
|
|
|
|
@@ -4915,7 +5113,10 @@ ANGLE_INSTANTIATE_TEST(PixelLocalStorageCompilerTest,
|
|
|
|
.enable(Feature::DisableDrawBuffersIndexed));
|
|
|
|
.enable(Feature::DisableDrawBuffersIndexed));
|
|
|
|
|
|
|
|
|
|
|
|
class PixelLocalStorageTestPreES3 : public ANGLETest<>
|
|
|
|
class PixelLocalStorageTestPreES3 : public ANGLETest<>
|
|
|
|
{};
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
PixelLocalStorageTestPreES3() { setExtensionsEnabled(false); }
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Check that GL_ANGLE_shader_pixel_local_storage is not advertised before ES 3.1.
|
|
|
|
// Check that GL_ANGLE_shader_pixel_local_storage is not advertised before ES 3.1.
|
|
|
|
//
|
|
|
|
//
|
|
|
|
@@ -4923,8 +5124,8 @@ class PixelLocalStorageTestPreES3 : public ANGLETest<>
|
|
|
|
// are inside ANGLE.
|
|
|
|
// are inside ANGLE.
|
|
|
|
TEST_P(PixelLocalStorageTestPreES3, UnsupportedClientVersion)
|
|
|
|
TEST_P(PixelLocalStorageTestPreES3, UnsupportedClientVersion)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
EXPECT_FALSE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
EXPECT_FALSE(EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage"));
|
|
|
|
EXPECT_FALSE(IsGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
EXPECT_FALSE(EnsureGLExtensionEnabled("GL_ANGLE_shader_pixel_local_storage_coherent"));
|
|
|
|
|
|
|
|
|
|
|
|
ShaderInfoLog log;
|
|
|
|
ShaderInfoLog log;
|
|
|
|
|
|
|
|
|
|
|
|
|