Commit 2e43b0f5 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Implement memory barriers

Bug: angleproject:3574 Change-Id: I13d8f4fcd6f1bf9bf3496c91c2c697076e2491bd Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1699005Reviewed-by: 's avatarTobin Ehlis <tobine@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent 7a5f35c4
...@@ -112,6 +112,8 @@ const char *GetResourceTypeName(CommandGraphResourceType resourceType, ...@@ -112,6 +112,8 @@ const char *GetResourceTypeName(CommandGraphResourceType resourceType,
UNREACHABLE(); UNREACHABLE();
return "FenceSync"; return "FenceSync";
} }
case CommandGraphResourceType::GraphBarrier:
return "GraphBarrier";
case CommandGraphResourceType::DebugMarker: case CommandGraphResourceType::DebugMarker:
switch (function) switch (function)
{ {
...@@ -355,6 +357,7 @@ CommandGraphNode::CommandGraphNode(CommandGraphNodeFunction function, ...@@ -355,6 +357,7 @@ CommandGraphNode::CommandGraphNode(CommandGraphNodeFunction function,
mVisitedState(VisitedState::Unvisited), mVisitedState(VisitedState::Unvisited),
mGlobalMemoryBarrierSrcAccess(0), mGlobalMemoryBarrierSrcAccess(0),
mGlobalMemoryBarrierDstAccess(0), mGlobalMemoryBarrierDstAccess(0),
mGlobalMemoryBarrierStages(0),
mRenderPassOwner(nullptr) mRenderPassOwner(nullptr)
{} {}
...@@ -529,26 +532,24 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context, ...@@ -529,26 +532,24 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context,
RenderPassCache *renderPassCache, RenderPassCache *renderPassCache,
PrimaryCommandBuffer *primaryCommandBuffer) PrimaryCommandBuffer *primaryCommandBuffer)
{ {
// Record the deferred pipeline barrier if necessary.
ASSERT((mGlobalMemoryBarrierDstAccess == 0) == (mGlobalMemoryBarrierSrcAccess == 0));
if (mGlobalMemoryBarrierSrcAccess)
{
VkMemoryBarrier memoryBarrier = {};
memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
memoryBarrier.srcAccessMask = mGlobalMemoryBarrierSrcAccess;
memoryBarrier.dstAccessMask = mGlobalMemoryBarrierDstAccess;
primaryCommandBuffer->memoryBarrier(mGlobalMemoryBarrierStages, mGlobalMemoryBarrierStages,
&memoryBarrier);
}
switch (mFunction) switch (mFunction)
{ {
case CommandGraphNodeFunction::Generic: case CommandGraphNodeFunction::Generic:
ASSERT(mQueryPool == VK_NULL_HANDLE && mFenceSyncEvent == VK_NULL_HANDLE); ASSERT(mQueryPool == VK_NULL_HANDLE && mFenceSyncEvent == VK_NULL_HANDLE);
// Record the deferred pipeline barrier if necessary.
ASSERT((mGlobalMemoryBarrierDstAccess == 0) == (mGlobalMemoryBarrierSrcAccess == 0));
if (mGlobalMemoryBarrierSrcAccess)
{
VkMemoryBarrier memoryBarrier = {};
memoryBarrier.sType = VK_STRUCTURE_TYPE_MEMORY_BARRIER;
memoryBarrier.srcAccessMask = mGlobalMemoryBarrierSrcAccess;
memoryBarrier.dstAccessMask = mGlobalMemoryBarrierDstAccess;
// Use the all pipe stage to keep the state management simple.
primaryCommandBuffer->memoryBarrier(VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
&memoryBarrier);
}
if (mOutsideRenderPassCommands.valid()) if (mOutsideRenderPassCommands.valid())
{ {
ANGLE_VK_TRY(context, mOutsideRenderPassCommands.end()); ANGLE_VK_TRY(context, mOutsideRenderPassCommands.end());
...@@ -639,6 +640,11 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context, ...@@ -639,6 +640,11 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context,
break; break;
case CommandGraphNodeFunction::GraphBarrier:
// Nothing to do. The memory barrier, if any, is already handled above through global
// memory barrier flags.
break;
case CommandGraphNodeFunction::InsertDebugMarker: case CommandGraphNodeFunction::InsertDebugMarker:
ASSERT(!mOutsideRenderPassCommands.valid() && !mInsideRenderPassCommands.valid()); ASSERT(!mOutsideRenderPassCommands.valid() && !mInsideRenderPassCommands.valid());
...@@ -707,6 +713,13 @@ void CommandGraphNode::setDiagnosticInfo(CommandGraphResourceType resourceType, ...@@ -707,6 +713,13 @@ void CommandGraphNode::setDiagnosticInfo(CommandGraphResourceType resourceType,
mResourceID = resourceID; mResourceID = resourceID;
} }
bool CommandGraphNode::hasDiagnosticID() const
{
// All nodes have diagnostic IDs to differentiate them except the following select few.
return mResourceType != CommandGraphResourceType::HostAvailabilityOperation &&
mResourceType != CommandGraphResourceType::GraphBarrier;
}
std::string CommandGraphNode::dumpCommandsForDiagnostics(const char *separator) const std::string CommandGraphNode::dumpCommandsForDiagnostics(const char *separator) const
{ {
std::string result; std::string result;
...@@ -989,6 +1002,13 @@ void CommandGraph::waitFenceSync(const vk::Event &event) ...@@ -989,6 +1002,13 @@ void CommandGraph::waitFenceSync(const vk::Event &event)
newNode->setFenceSync(event); newNode->setFenceSync(event);
} }
void CommandGraph::memoryBarrier(VkFlags srcAccess, VkFlags dstAccess, VkPipelineStageFlags stages)
{
CommandGraphNode *newNode = allocateBarrierNode(CommandGraphNodeFunction::GraphBarrier,
CommandGraphResourceType::GraphBarrier, 0);
newNode->addGlobalMemoryBarrier(srcAccess, dstAccess, stages);
}
void CommandGraph::insertDebugMarker(GLenum source, std::string &&marker) void CommandGraph::insertDebugMarker(GLenum source, std::string &&marker)
{ {
CommandGraphNode *newNode = allocateBarrierNode(CommandGraphNodeFunction::InsertDebugMarker, CommandGraphNode *newNode = allocateBarrierNode(CommandGraphNodeFunction::InsertDebugMarker,
...@@ -1078,10 +1098,9 @@ void CommandGraph::dumpGraphDotFile(std::ostream &out) const ...@@ -1078,10 +1098,9 @@ void CommandGraph::dumpGraphDotFile(std::ostream &out) const
strstr << id; strstr << id;
} }
} }
else if (node->getResourceTypeForDiagnostics() == else if (!node->hasDiagnosticID())
CommandGraphResourceType::HostAvailabilityOperation)
{ {
// Nothing to append for this special node. The name is sufficient. // Nothing to append for these special nodes. The name is sufficient.
} }
else else
{ {
......
...@@ -37,6 +37,7 @@ enum class CommandGraphResourceType ...@@ -37,6 +37,7 @@ enum class CommandGraphResourceType
// VK_EXT_transform_feedback), but still need to generate a command graph barrier node. // VK_EXT_transform_feedback), but still need to generate a command graph barrier node.
EmulatedQuery, EmulatedQuery,
FenceSync, FenceSync,
GraphBarrier,
DebugMarker, DebugMarker,
HostAvailabilityOperation, HostAvailabilityOperation,
}; };
...@@ -53,6 +54,7 @@ enum class CommandGraphNodeFunction ...@@ -53,6 +54,7 @@ enum class CommandGraphNodeFunction
EndTransformFeedbackQuery, EndTransformFeedbackQuery,
SetFenceSync, SetFenceSync,
WaitFenceSync, WaitFenceSync,
GraphBarrier,
InsertDebugMarker, InsertDebugMarker,
PushDebugMarker, PushDebugMarker,
PopDebugMarker, PopDebugMarker,
...@@ -178,6 +180,7 @@ class CommandGraphNode final : angle::NonCopyable ...@@ -178,6 +180,7 @@ class CommandGraphNode final : angle::NonCopyable
CommandGraphResourceType getResourceTypeForDiagnostics() const { return mResourceType; } CommandGraphResourceType getResourceTypeForDiagnostics() const { return mResourceType; }
uintptr_t getResourceIDForDiagnostics() const { return mResourceID; } uintptr_t getResourceIDForDiagnostics() const { return mResourceID; }
bool hasDiagnosticID() const;
std::string dumpCommandsForDiagnostics(const char *separator) const; std::string dumpCommandsForDiagnostics(const char *separator) const;
const gl::Rectangle &getRenderPassRenderArea() const { return mRenderPassRenderArea; } const gl::Rectangle &getRenderPassRenderArea() const { return mRenderPassRenderArea; }
...@@ -191,10 +194,13 @@ class CommandGraphNode final : angle::NonCopyable ...@@ -191,10 +194,13 @@ class CommandGraphNode final : angle::NonCopyable
void setDebugMarker(GLenum source, std::string &&marker); void setDebugMarker(GLenum source, std::string &&marker);
const std::string &getDebugMarker() const { return mDebugMarker; } const std::string &getDebugMarker() const { return mDebugMarker; }
ANGLE_INLINE void addGlobalMemoryBarrier(VkFlags srcAccess, VkFlags dstAccess) ANGLE_INLINE void addGlobalMemoryBarrier(VkFlags srcAccess,
VkFlags dstAccess,
VkPipelineStageFlags stages)
{ {
mGlobalMemoryBarrierSrcAccess |= srcAccess; mGlobalMemoryBarrierSrcAccess |= srcAccess;
mGlobalMemoryBarrierDstAccess |= dstAccess; mGlobalMemoryBarrierDstAccess |= dstAccess;
mGlobalMemoryBarrierStages |= stages;
} }
// This can only be set for RenderPass nodes. Each RenderPass node can have at most one owner. // This can only be set for RenderPass nodes. Each RenderPass node can have at most one owner.
...@@ -257,6 +263,7 @@ class CommandGraphNode final : angle::NonCopyable ...@@ -257,6 +263,7 @@ class CommandGraphNode final : angle::NonCopyable
// For global memory barriers. // For global memory barriers.
VkFlags mGlobalMemoryBarrierSrcAccess; VkFlags mGlobalMemoryBarrierSrcAccess;
VkFlags mGlobalMemoryBarrierDstAccess; VkFlags mGlobalMemoryBarrierDstAccess;
VkPipelineStageFlags mGlobalMemoryBarrierStages;
// Render pass command buffer notifications. // Render pass command buffer notifications.
RenderPassOwner *mRenderPassOwner; RenderPassOwner *mRenderPassOwner;
...@@ -401,10 +408,10 @@ class CommandGraphResource : angle::NonCopyable ...@@ -401,10 +408,10 @@ class CommandGraphResource : angle::NonCopyable
void finishCurrentCommands(ContextVk *contextVk); void finishCurrentCommands(ContextVk *contextVk);
// Store a deferred memory barrier. Will be recorded into a primary command buffer at submit. // Store a deferred memory barrier. Will be recorded into a primary command buffer at submit.
void addGlobalMemoryBarrier(VkFlags srcAccess, VkFlags dstAccess) void addGlobalMemoryBarrier(VkFlags srcAccess, VkFlags dstAccess, VkPipelineStageFlags stages)
{ {
ASSERT(mCurrentWritingNode); ASSERT(mCurrentWritingNode);
mCurrentWritingNode->addGlobalMemoryBarrier(srcAccess, dstAccess); mCurrentWritingNode->addGlobalMemoryBarrier(srcAccess, dstAccess, stages);
} }
protected: protected:
...@@ -490,6 +497,8 @@ class CommandGraph final : angle::NonCopyable ...@@ -490,6 +497,8 @@ class CommandGraph final : angle::NonCopyable
// GLsync and EGLSync: // GLsync and EGLSync:
void setFenceSync(const vk::Event &event); void setFenceSync(const vk::Event &event);
void waitFenceSync(const vk::Event &event); void waitFenceSync(const vk::Event &event);
// Memory barriers:
void memoryBarrier(VkFlags srcAccess, VkFlags dstAccess, VkPipelineStageFlags stages);
// Debug markers: // Debug markers:
void insertDebugMarker(GLenum source, std::string &&marker); void insertDebugMarker(GLenum source, std::string &&marker);
void pushDebugMarker(GLenum source, std::string &&marker); void pushDebugMarker(GLenum source, std::string &&marker);
......
...@@ -2010,14 +2010,36 @@ angle::Result ContextVk::dispatchComputeIndirect(const gl::Context *context, GLi ...@@ -2010,14 +2010,36 @@ angle::Result ContextVk::dispatchComputeIndirect(const gl::Context *context, GLi
angle::Result ContextVk::memoryBarrier(const gl::Context *context, GLbitfield barriers) angle::Result ContextVk::memoryBarrier(const gl::Context *context, GLbitfield barriers)
{ {
ANGLE_VK_UNREACHABLE(this); // Note: most of the barriers specified here don't require us to issue a memory barrier, as the
return angle::Result::Stop; // relevant resources already insert the appropriate barriers. They do however require the
// resource writing nodes to finish so future buffer barriers are placed correctly, as well as
// resource dependencies not creating a graph loop. This is done by inserting a command graph
// barrier that does nothing!
VkAccessFlags srcAccess = 0;
VkAccessFlags dstAccess = 0;
if ((barriers & GL_COMMAND_BARRIER_BIT) != 0)
{
srcAccess |= VK_ACCESS_SHADER_WRITE_BIT;
dstAccess |= VK_ACCESS_INDIRECT_COMMAND_READ_BIT;
}
mCommandGraph.memoryBarrier(srcAccess, dstAccess, VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT);
return angle::Result::Continue;
} }
angle::Result ContextVk::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers) angle::Result ContextVk::memoryBarrierByRegion(const gl::Context *context, GLbitfield barriers)
{ {
ANGLE_VK_UNREACHABLE(this); // There aren't any barrier bits here that aren't otherwise automatically handled. We only
return angle::Result::Stop; // need to make sure writer resources (framebuffers and the dispatcher) start a new node.
//
// Note: memoryBarrierByRegion is expected to affect only the fragment pipeline. Specifying
// that here is currently unnecessary, but is a reminder of this fact in case we do need to
// especially handle some future barrier bit.
mCommandGraph.memoryBarrier(0, 0, VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT);
return angle::Result::Continue;
} }
vk::DynamicQueryPool *ContextVk::getQueryPool(gl::QueryType queryType) vk::DynamicQueryPool *ContextVk::getQueryPool(gl::QueryType queryType)
......
...@@ -1322,7 +1322,7 @@ void BufferHelper::onWriteAccess(ContextVk *contextVk, ...@@ -1322,7 +1322,7 @@ void BufferHelper::onWriteAccess(ContextVk *contextVk,
VkAccessFlags barrierSrc, barrierDst; VkAccessFlags barrierSrc, barrierDst;
if (needsOnWriteBarrier(readAccessType, writeAccessType, &barrierSrc, &barrierDst)) if (needsOnWriteBarrier(readAccessType, writeAccessType, &barrierSrc, &barrierDst))
{ {
addGlobalMemoryBarrier(barrierSrc, barrierDst); addGlobalMemoryBarrier(barrierSrc, barrierDst, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
} }
bool hostVisible = mMemoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT; bool hostVisible = mMemoryPropertyFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
......
...@@ -555,7 +555,8 @@ class BufferHelper final : public CommandGraphResource ...@@ -555,7 +555,8 @@ class BufferHelper final : public CommandGraphResource
VkAccessFlags barrierSrc, barrierDst; VkAccessFlags barrierSrc, barrierDst;
if (needsOnReadBarrier(readAccessType, &barrierSrc, &barrierDst)) if (needsOnReadBarrier(readAccessType, &barrierSrc, &barrierDst))
{ {
reader->addGlobalMemoryBarrier(barrierSrc, barrierDst); reader->addGlobalMemoryBarrier(barrierSrc, barrierDst,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT);
} }
} }
bool needsOnWriteBarrier(VkAccessFlags readAccessType, bool needsOnWriteBarrier(VkAccessFlags readAccessType,
......
...@@ -632,10 +632,6 @@ ...@@ -632,10 +632,6 @@
3520 VULKAN : dEQP-GLES31.functional.program_interface_query.program_*.resource_list.compute.empty = FAIL 3520 VULKAN : dEQP-GLES31.functional.program_interface_query.program_*.resource_list.compute.empty = FAIL
3520 VULKAN : dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.* = FAIL 3520 VULKAN : dEQP-GLES31.functional.program_interface_query.shader_storage_block.buffer_data_size.* = FAIL
// glMemoryBarrier support:
3574 VULKAN : dEQP-GLES31.functional.compute.*barrier* = SKIP
3574 VULKAN : dEQP-GLES31.functional.synchronization.*memory_barrier* = SKIP
// Indirect dispatch: // Indirect dispatch:
3601 VULKAN : dEQP-GLES31.functional.compute.*indirect* = SKIP 3601 VULKAN : dEQP-GLES31.functional.compute.*indirect* = SKIP
......
...@@ -36,12 +36,11 @@ ...@@ -36,12 +36,11 @@
// General Vulkan expectations // General Vulkan expectations
// Limits: // Limits:
// GL_MIN/MAX_PROGRAM_TEXTURE_GATHER_OFFSET not set. Also crashes on memory barrier support missing. // GL_MIN/MAX_PROGRAM_TEXTURE_GATHER_OFFSET not set.
3605 VULKAN : KHR-GLES31.core.texture_gather.* = SKIP 3605 VULKAN : KHR-GLES31.core.texture_gather.* = FAIL
// Memory barriers // Dispatch indirect:
3574 VULKAN : KHR-GLES31.core.compute_shader* = SKIP 3601 VULKAN : KHR-GLES31.core.compute_shader* = SKIP
3574 VULKAN : KHR-GLES31.core.shader_atomic_counters.basic-glsl-built-in = SKIP
// Multisampled textures: // Multisampled textures:
3565 VULKAN : KHR-GLES31.core.texture_storage_multisample.* = SKIP 3565 VULKAN : KHR-GLES31.core.texture_storage_multisample.* = SKIP
......
...@@ -150,6 +150,9 @@ void main() ...@@ -150,6 +150,9 @@ void main()
// make sure that uniforms and uniform samplers get recorded // make sure that uniforms and uniform samplers get recorded
TEST_P(ComputeShaderTest, LinkComputeProgramWithUniforms) TEST_P(ComputeShaderTest, LinkComputeProgramWithUniforms)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
precision mediump sampler2D; precision mediump sampler2D;
layout(local_size_x=1) in; layout(local_size_x=1) in;
...@@ -328,6 +331,9 @@ void main() {})"; ...@@ -328,6 +331,9 @@ void main() {})";
// Access all compute shader special variables. // Access all compute shader special variables.
TEST_P(ComputeShaderTest, AccessAllSpecialVariables) TEST_P(ComputeShaderTest, AccessAllSpecialVariables)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=4, local_size_y=3, local_size_z=2) in; layout(local_size_x=4, local_size_y=3, local_size_z=2) in;
layout(rgba32ui) uniform highp writeonly uimage2D imageOut; layout(rgba32ui) uniform highp writeonly uimage2D imageOut;
...@@ -348,6 +354,9 @@ void main() ...@@ -348,6 +354,9 @@ void main()
// Access part compute shader special variables. // Access part compute shader special variables.
TEST_P(ComputeShaderTest, AccessPartSpecialVariables) TEST_P(ComputeShaderTest, AccessPartSpecialVariables)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=4, local_size_y=3, local_size_z=2) in; layout(local_size_x=4, local_size_y=3, local_size_z=2) in;
layout(rgba32ui) uniform highp writeonly uimage2D imageOut; layout(rgba32ui) uniform highp writeonly uimage2D imageOut;
...@@ -365,6 +374,9 @@ void main() ...@@ -365,6 +374,9 @@ void main()
// Use glDispatchCompute to define work group count. // Use glDispatchCompute to define work group count.
TEST_P(ComputeShaderTest, DispatchCompute) TEST_P(ComputeShaderTest, DispatchCompute)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=4, local_size_y=3, local_size_z=2) in; layout(local_size_x=4, local_size_y=3, local_size_z=2) in;
layout(rgba32ui) uniform highp writeonly uimage2D imageOut; layout(rgba32ui) uniform highp writeonly uimage2D imageOut;
...@@ -385,6 +397,9 @@ void main() ...@@ -385,6 +397,9 @@ void main()
// buffer again. The test runs well. // buffer again. The test runs well.
TEST_P(ComputeShaderTest, BufferImageBuffer) TEST_P(ComputeShaderTest, BufferImageBuffer)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// See http://anglebug.com/3536 // See http://anglebug.com/3536
ANGLE_SKIP_TEST_IF(IsOpenGL() && IsIntel() && IsWindows()); ANGLE_SKIP_TEST_IF(IsOpenGL() && IsIntel() && IsWindows());
...@@ -453,6 +468,9 @@ void main() ...@@ -453,6 +468,9 @@ void main()
// runs well. // runs well.
TEST_P(ComputeShaderTest, ImageAtomicCounterBuffer) TEST_P(ComputeShaderTest, ImageAtomicCounterBuffer)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// Flaky hang. http://anglebug.com/3636 // Flaky hang. http://anglebug.com/3636
ANGLE_SKIP_TEST_IF(IsWindows() && IsNVIDIA() && IsDesktopOpenGL()); ANGLE_SKIP_TEST_IF(IsWindows() && IsNVIDIA() && IsDesktopOpenGL());
...@@ -508,6 +526,9 @@ void main() ...@@ -508,6 +526,9 @@ void main()
// runs well. // runs well.
TEST_P(ComputeShaderTest, ImageShaderStorageBuffer) TEST_P(ComputeShaderTest, ImageShaderStorageBuffer)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS0[] = R"(#version 310 es constexpr char kCS0[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(r32ui, binding = 0) writeonly uniform highp uimage2D uImage[2]; layout(r32ui, binding = 0) writeonly uniform highp uimage2D uImage[2];
...@@ -565,6 +586,9 @@ void main() ...@@ -565,6 +586,9 @@ void main()
// Basic test for DispatchComputeIndirect. // Basic test for DispatchComputeIndirect.
TEST_P(ComputeShaderTest, DispatchComputeIndirect) TEST_P(ComputeShaderTest, DispatchComputeIndirect)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// Flaky crash on teardown, see http://anglebug.com/3349 // Flaky crash on teardown, see http://anglebug.com/3349
ANGLE_SKIP_TEST_IF(IsD3D11() && IsIntel() && IsWindows()); ANGLE_SKIP_TEST_IF(IsD3D11() && IsIntel() && IsWindows());
...@@ -623,6 +647,9 @@ void main() ...@@ -623,6 +647,9 @@ void main()
// Use image uniform to write texture in compute shader, and verify the content is expected. // Use image uniform to write texture in compute shader, and verify the content is expected.
TEST_P(ComputeShaderTest, BindImageTexture) TEST_P(ComputeShaderTest, BindImageTexture)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture mTexture[2]; GLTexture mTexture[2];
GLFramebuffer mFramebuffer; GLFramebuffer mFramebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -690,6 +717,9 @@ void main() ...@@ -690,6 +717,9 @@ void main()
// When declare a image array without a binding qualifier, all elements are bound to unit zero. // When declare a image array without a binding qualifier, all elements are bound to unit zero.
TEST_P(ComputeShaderTest, ImageArrayWithoutBindingQualifier) TEST_P(ComputeShaderTest, ImageArrayWithoutBindingQualifier)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
ANGLE_SKIP_TEST_IF(IsD3D11()); ANGLE_SKIP_TEST_IF(IsD3D11());
// TODO(xinghua.cao@intel.com): On AMD desktop OpenGL, bind two image variables to unit 0, // TODO(xinghua.cao@intel.com): On AMD desktop OpenGL, bind two image variables to unit 0,
...@@ -742,6 +772,9 @@ void main() ...@@ -742,6 +772,9 @@ void main()
// imageLoad functions // imageLoad functions
TEST_P(ComputeShaderTest, ImageLoad) TEST_P(ComputeShaderTest, ImageLoad)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=8) in; layout(local_size_x=8) in;
layout(rgba8) uniform highp readonly image2D mImage2DInput; layout(rgba8) uniform highp readonly image2D mImage2DInput;
...@@ -763,6 +796,9 @@ void main() ...@@ -763,6 +796,9 @@ void main()
// imageStore functions // imageStore functions
TEST_P(ComputeShaderTest, ImageStore) TEST_P(ComputeShaderTest, ImageStore)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=8) in; layout(local_size_x=8) in;
layout(rgba16f) uniform highp writeonly imageCube mImageCubeOutput; layout(rgba16f) uniform highp writeonly imageCube mImageCubeOutput;
...@@ -782,6 +818,9 @@ void main() ...@@ -782,6 +818,9 @@ void main()
// imageSize functions // imageSize functions
TEST_P(ComputeShaderTest, ImageSize) TEST_P(ComputeShaderTest, ImageSize)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=8) in; layout(local_size_x=8) in;
layout(rgba8) uniform highp readonly imageCube mImageCubeInput; layout(rgba8) uniform highp readonly imageCube mImageCubeInput;
...@@ -941,6 +980,9 @@ void main() ...@@ -941,6 +980,9 @@ void main()
// Test mixed use of sampler and image. // Test mixed use of sampler and image.
TEST_P(ComputeShaderTest, SamplingAndImageReadWrite) TEST_P(ComputeShaderTest, SamplingAndImageReadWrite)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[3]; GLTexture texture[3];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1010,6 +1052,9 @@ void main() ...@@ -1010,6 +1052,9 @@ void main()
// Use image uniform to read and write Texture2D in compute shader, and verify the contents. // Use image uniform to read and write Texture2D in compute shader, and verify the contents.
TEST_P(ComputeShaderTest, BindImageTextureWithTexture2D) TEST_P(ComputeShaderTest, BindImageTextureWithTexture2D)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1069,6 +1114,9 @@ void main() ...@@ -1069,6 +1114,9 @@ void main()
// Use image uniform to read and write Texture2DArray in compute shader, and verify the contents. // Use image uniform to read and write Texture2DArray in compute shader, and verify the contents.
TEST_P(ComputeShaderTest, BindImageTextureWithTexture2DArray) TEST_P(ComputeShaderTest, BindImageTextureWithTexture2DArray)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1136,6 +1184,9 @@ void main() ...@@ -1136,6 +1184,9 @@ void main()
// Use image uniform to read and write Texture3D in compute shader, and verify the contents. // Use image uniform to read and write Texture3D in compute shader, and verify the contents.
TEST_P(ComputeShaderTest, BindImageTextureWithTexture3D) TEST_P(ComputeShaderTest, BindImageTextureWithTexture3D)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1203,6 +1254,9 @@ void main() ...@@ -1203,6 +1254,9 @@ void main()
// Use image uniform to read and write TextureCube in compute shader, and verify the contents. // Use image uniform to read and write TextureCube in compute shader, and verify the contents.
TEST_P(ComputeShaderTest, BindImageTextureWithTextureCube) TEST_P(ComputeShaderTest, BindImageTextureWithTextureCube)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1278,6 +1332,9 @@ void main() ...@@ -1278,6 +1332,9 @@ void main()
// contents. // contents.
TEST_P(ComputeShaderTest, BindImageTextureWithOneLayerTexture2DArray) TEST_P(ComputeShaderTest, BindImageTextureWithOneLayerTexture2DArray)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1345,6 +1402,9 @@ void main() ...@@ -1345,6 +1402,9 @@ void main()
// contents. // contents.
TEST_P(ComputeShaderTest, BindImageTextureWithOneLayerTexture3D) TEST_P(ComputeShaderTest, BindImageTextureWithOneLayerTexture3D)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1412,6 +1472,9 @@ void main() ...@@ -1412,6 +1472,9 @@ void main()
// contents. // contents.
TEST_P(ComputeShaderTest, BindImageTextureWithOneLayerTextureCube) TEST_P(ComputeShaderTest, BindImageTextureWithOneLayerTextureCube)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -1494,6 +1557,9 @@ void main() ...@@ -1494,6 +1557,9 @@ void main()
// level or a single layer or face of the face level. // level or a single layer or face of the face level.
TEST_P(ComputeShaderTest, BindImageTextureWithMixTextureTypes) TEST_P(ComputeShaderTest, BindImageTextureWithMixTextureTypes)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[4]; GLTexture texture[4];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
const char csSource[] = const char csSource[] =
...@@ -1636,6 +1702,9 @@ void main() ...@@ -1636,6 +1702,9 @@ void main()
// order of multiple shader invocations in compute shader. // order of multiple shader invocations in compute shader.
TEST_P(ComputeShaderTest, groupMemoryBarrierAndBarrierTest) TEST_P(ComputeShaderTest, groupMemoryBarrierAndBarrierTest)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// TODO(xinghua.cao@intel.com): Figure out why we get this error message // TODO(xinghua.cao@intel.com): Figure out why we get this error message
// that shader uses features not recognized by this D3D version. // that shader uses features not recognized by this D3D version.
ANGLE_SKIP_TEST_IF((IsAMD() || IsNVIDIA()) && IsD3D11()); ANGLE_SKIP_TEST_IF((IsAMD() || IsNVIDIA()) && IsD3D11());
...@@ -1706,6 +1775,9 @@ void main() ...@@ -1706,6 +1775,9 @@ void main()
// active shader storage blocks in a compute shader exceeds GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES. // active shader storage blocks in a compute shader exceeds GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES.
TEST_P(ComputeShaderTest, ExceedCombinedShaderOutputResourcesInCS) TEST_P(ComputeShaderTest, ExceedCombinedShaderOutputResourcesInCS)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLint maxCombinedShaderOutputResources; GLint maxCombinedShaderOutputResources;
GLint maxComputeShaderStorageBlocks; GLint maxComputeShaderStorageBlocks;
GLint maxComputeImageUniforms; GLint maxComputeImageUniforms;
...@@ -1770,6 +1842,9 @@ TEST_P(ComputeShaderTest, ExceedCombinedShaderOutputResourcesInCS) ...@@ -1770,6 +1842,9 @@ TEST_P(ComputeShaderTest, ExceedCombinedShaderOutputResourcesInCS)
// Test that uniform block with struct member in compute shader is supported. // Test that uniform block with struct member in compute shader is supported.
TEST_P(ComputeShaderTest, UniformBlockWithStructMember) TEST_P(ComputeShaderTest, UniformBlockWithStructMember)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=8) in; layout(local_size_x=8) in;
layout(rgba8) uniform highp readonly image2D mImage2DInput; layout(rgba8) uniform highp readonly image2D mImage2DInput;
...@@ -1796,6 +1871,9 @@ void main() ...@@ -1796,6 +1871,9 @@ void main()
// Verify shared non-array variables can work correctly. // Verify shared non-array variables can work correctly.
TEST_P(ComputeShaderTest, NonArraySharedVariable) TEST_P(ComputeShaderTest, NonArraySharedVariable)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSShader[] = R"(#version 310 es const char kCSShader[] = R"(#version 310 es
layout (local_size_x = 2, local_size_y = 2, local_size_z = 1) in; layout (local_size_x = 2, local_size_y = 2, local_size_z = 1) in;
layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage; layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage;
...@@ -1829,6 +1907,9 @@ void main() ...@@ -1829,6 +1907,9 @@ void main()
// Verify shared non-struct array variables can work correctly. // Verify shared non-struct array variables can work correctly.
TEST_P(ComputeShaderTest, NonStructArrayAsSharedVariable) TEST_P(ComputeShaderTest, NonStructArrayAsSharedVariable)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSShader[] = R"(#version 310 es const char kCSShader[] = R"(#version 310 es
layout (local_size_x = 2, local_size_y = 2, local_size_z = 1) in; layout (local_size_x = 2, local_size_y = 2, local_size_z = 1) in;
layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage; layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage;
...@@ -1853,6 +1934,9 @@ void main() ...@@ -1853,6 +1934,9 @@ void main()
// Verify shared struct array variables work correctly. // Verify shared struct array variables work correctly.
TEST_P(ComputeShaderTest, StructArrayAsSharedVariable) TEST_P(ComputeShaderTest, StructArrayAsSharedVariable)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSShader[] = R"(#version 310 es const char kCSShader[] = R"(#version 310 es
layout (local_size_x = 2, local_size_y = 2, local_size_z = 1) in; layout (local_size_x = 2, local_size_y = 2, local_size_z = 1) in;
layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage; layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage;
...@@ -1881,6 +1965,9 @@ void main() ...@@ -1881,6 +1965,9 @@ void main()
// Verify using atomic functions without return value can work correctly. // Verify using atomic functions without return value can work correctly.
TEST_P(ComputeShaderTest, AtomicFunctionsNoReturnValue) TEST_P(ComputeShaderTest, AtomicFunctionsNoReturnValue)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// TODO(jiawei.shao@intel.com): find out why this shader causes a link error on Android Nexus 5 // TODO(jiawei.shao@intel.com): find out why this shader causes a link error on Android Nexus 5
// bot. // bot.
ANGLE_SKIP_TEST_IF(IsAndroid()); ANGLE_SKIP_TEST_IF(IsAndroid());
...@@ -1943,6 +2030,9 @@ void main() ...@@ -1943,6 +2030,9 @@ void main()
// Verify using atomic functions in a non-initializer single assignment can work correctly. // Verify using atomic functions in a non-initializer single assignment can work correctly.
TEST_P(ComputeShaderTest, AtomicFunctionsInNonInitializerSingleAssignment) TEST_P(ComputeShaderTest, AtomicFunctionsInNonInitializerSingleAssignment)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSShader[] = R"(#version 310 es const char kCSShader[] = R"(#version 310 es
layout (local_size_x = 9, local_size_y = 1, local_size_z = 1) in; layout (local_size_x = 9, local_size_y = 1, local_size_z = 1) in;
layout (r32i, binding = 0) readonly uniform highp iimage2D srcImage; layout (r32i, binding = 0) readonly uniform highp iimage2D srcImage;
...@@ -1989,6 +2079,9 @@ void main() ...@@ -1989,6 +2079,9 @@ void main()
// Verify using atomic functions in an initializers and using unsigned int works correctly. // Verify using atomic functions in an initializers and using unsigned int works correctly.
TEST_P(ComputeShaderTest, AtomicFunctionsInitializerWithUnsigned) TEST_P(ComputeShaderTest, AtomicFunctionsInitializerWithUnsigned)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCShader[] = R"(#version 310 es constexpr char kCShader[] = R"(#version 310 es
layout (local_size_x = 9, local_size_y = 1, local_size_z = 1) in; layout (local_size_x = 9, local_size_y = 1, local_size_z = 1) in;
layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage; layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage;
...@@ -2046,6 +2139,9 @@ void main() ...@@ -2046,6 +2139,9 @@ void main()
// Verify using atomic functions inside expressions as unsigned int. // Verify using atomic functions inside expressions as unsigned int.
TEST_P(ComputeShaderTest, AtomicFunctionsReturnWithUnsigned) TEST_P(ComputeShaderTest, AtomicFunctionsReturnWithUnsigned)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCShader[] = R"(#version 310 es constexpr char kCShader[] = R"(#version 310 es
layout (local_size_x = 9, local_size_y = 1, local_size_z = 1) in; layout (local_size_x = 9, local_size_y = 1, local_size_z = 1) in;
layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage; layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage;
...@@ -2093,6 +2189,9 @@ void main() ...@@ -2093,6 +2189,9 @@ void main()
// Verify using nested atomic functions in expressions. // Verify using nested atomic functions in expressions.
TEST_P(ComputeShaderTest, AtomicFunctionsReturnWithMultipleTypes) TEST_P(ComputeShaderTest, AtomicFunctionsReturnWithMultipleTypes)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCShader[] = R"(#version 310 es constexpr char kCShader[] = R"(#version 310 es
layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in; layout (local_size_x = 4, local_size_y = 1, local_size_z = 1) in;
layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage; layout (r32ui, binding = 0) readonly uniform highp uimage2D srcImage;
...@@ -2138,6 +2237,9 @@ void main() ...@@ -2138,6 +2237,9 @@ void main()
// Basic uniform buffer functionality. // Basic uniform buffer functionality.
TEST_P(ComputeShaderTest, UniformBuffer) TEST_P(ComputeShaderTest, UniformBuffer)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture; GLTexture texture;
GLBuffer buffer; GLBuffer buffer;
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
...@@ -2199,6 +2301,9 @@ void main() ...@@ -2199,6 +2301,9 @@ void main()
// Test that storing data to image and then loading the same image data works correctly. // Test that storing data to image and then loading the same image data works correctly.
TEST_P(ComputeShaderTest, StoreImageThenLoad) TEST_P(ComputeShaderTest, StoreImageThenLoad)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(r32ui, binding = 0) readonly uniform highp uimage2D uImage_1; layout(r32ui, binding = 0) readonly uniform highp uimage2D uImage_1;
...@@ -2256,6 +2361,9 @@ void main() ...@@ -2256,6 +2361,9 @@ void main()
// Test that loading image data and then storing data to the same image works correctly. // Test that loading image data and then storing data to the same image works correctly.
TEST_P(ComputeShaderTest, LoadImageThenStore) TEST_P(ComputeShaderTest, LoadImageThenStore)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(r32ui, binding = 0) readonly uniform highp uimage2D uImage_1; layout(r32ui, binding = 0) readonly uniform highp uimage2D uImage_1;
...@@ -2439,6 +2547,9 @@ void main() ...@@ -2439,6 +2547,9 @@ void main()
// Test that shader storage blocks only in assignment right is supported. // Test that shader storage blocks only in assignment right is supported.
TEST_P(ComputeShaderTest, ShaderStorageBlocksInAssignmentRight) TEST_P(ComputeShaderTest, ShaderStorageBlocksInAssignmentRight)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=8) in; layout(local_size_x=8) in;
layout(std140, binding = 0) buffer blockA { layout(std140, binding = 0) buffer blockA {
...@@ -2594,6 +2705,9 @@ TEST_P(ComputeShaderTestES3, NotSupported) ...@@ -2594,6 +2705,9 @@ TEST_P(ComputeShaderTestES3, NotSupported)
// The contents of shared variables should be cleared to zero at the beginning of shader execution. // The contents of shared variables should be cleared to zero at the beginning of shader execution.
TEST_P(WebGL2ComputeTest, sharedVariablesShouldBeZero) TEST_P(WebGL2ComputeTest, sharedVariablesShouldBeZero)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// http://anglebug.com/3226 // http://anglebug.com/3226
ANGLE_SKIP_TEST_IF(IsD3D11()); ANGLE_SKIP_TEST_IF(IsD3D11());
const char kCSShader[] = R"(#version 310 es const char kCSShader[] = R"(#version 310 es
...@@ -2636,6 +2750,9 @@ void main() ...@@ -2636,6 +2750,9 @@ void main()
// Test uniform dirty in compute shader, and verify the contents. // Test uniform dirty in compute shader, and verify the contents.
TEST_P(ComputeShaderTest, UniformDirty) TEST_P(ComputeShaderTest, UniformDirty)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
GLTexture texture[2]; GLTexture texture[2];
GLFramebuffer framebuffer; GLFramebuffer framebuffer;
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
...@@ -2789,6 +2906,9 @@ void main() ...@@ -2789,6 +2906,9 @@ void main()
// Test imageSize to access mipmap slice. // Test imageSize to access mipmap slice.
TEST_P(ComputeShaderTest, ImageSizeMipmapSlice) TEST_P(ComputeShaderTest, ImageSizeMipmapSlice)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// TODO(xinghua.cao@intel.com): http://anglebug.com/3101 // TODO(xinghua.cao@intel.com): http://anglebug.com/3101
ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux()); ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux());
...@@ -2847,6 +2967,9 @@ void main() ...@@ -2847,6 +2967,9 @@ void main()
// Test imageLoad to access mipmap slice. // Test imageLoad to access mipmap slice.
TEST_P(ComputeShaderTest, ImageLoadMipmapSlice) TEST_P(ComputeShaderTest, ImageLoadMipmapSlice)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// TODO(xinghua.cao@intel.com): http://anglebug.com/3101 // TODO(xinghua.cao@intel.com): http://anglebug.com/3101
ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux()); ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux());
...@@ -2906,6 +3029,9 @@ void main() ...@@ -2906,6 +3029,9 @@ void main()
// Test imageStore to access mipmap slice. // Test imageStore to access mipmap slice.
TEST_P(ComputeShaderTest, ImageStoreMipmapSlice) TEST_P(ComputeShaderTest, ImageStoreMipmapSlice)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
// TODO(xinghua.cao@intel.com): http://anglebug.com/3101 // TODO(xinghua.cao@intel.com): http://anglebug.com/3101
ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux()); ANGLE_SKIP_TEST_IF(IsIntel() && IsLinux());
...@@ -2966,6 +3092,9 @@ void main() ...@@ -2966,6 +3092,9 @@ void main()
// pipeline input. It works well. See http://anglebug.com/3658 // pipeline input. It works well. See http://anglebug.com/3658
TEST_P(ComputeShaderTest, DrawTexture1DispatchTexture2) TEST_P(ComputeShaderTest, DrawTexture1DispatchTexture2)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
precision highp sampler2D; precision highp sampler2D;
...@@ -3069,6 +3198,9 @@ void main(void) { ...@@ -3069,6 +3198,9 @@ void main(void) {
// 2. DrawArrays. // 2. DrawArrays.
TEST_P(ComputeShaderTest, DispatchDraw) TEST_P(ComputeShaderTest, DispatchDraw)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(rgba32f, binding = 0) writeonly uniform highp image2D image; layout(rgba32f, binding = 0) writeonly uniform highp image2D image;
...@@ -3136,6 +3268,9 @@ void main(void) { ...@@ -3136,6 +3268,9 @@ void main(void) {
// 4. DrawArrays. // 4. DrawArrays.
TEST_P(ComputeShaderTest, DrawDispachDispatchDraw) TEST_P(ComputeShaderTest, DrawDispachDispatchDraw)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(rgba32f, binding = 0) writeonly uniform highp image2D image; layout(rgba32f, binding = 0) writeonly uniform highp image2D image;
...@@ -3212,6 +3347,9 @@ void main(void) { ...@@ -3212,6 +3347,9 @@ void main(void) {
// 4. DispatchCompute. // 4. DispatchCompute.
TEST_P(ComputeShaderTest, DispatchDrawDrawDispatch) TEST_P(ComputeShaderTest, DispatchDrawDrawDispatch)
{ {
// Missing image support in Vulkan. http://anglebug.com/3563
ANGLE_SKIP_TEST_IF(IsVulkan());
const char kCSSource[] = R"(#version 310 es const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(rgba32f, binding = 0) writeonly uniform highp image2D image; layout(rgba32f, binding = 0) writeonly uniform highp image2D image;
...@@ -3294,7 +3432,11 @@ TEST_P(ComputeShaderTest, InvalidMemoryBarrier) ...@@ -3294,7 +3432,11 @@ TEST_P(ComputeShaderTest, InvalidMemoryBarrier)
EXPECT_GL_ERROR(GL_INVALID_VALUE); EXPECT_GL_ERROR(GL_INVALID_VALUE);
} }
ANGLE_INSTANTIATE_TEST(ComputeShaderTest, ES31_OPENGL(), ES31_OPENGLES(), ES31_D3D11()); ANGLE_INSTANTIATE_TEST(ComputeShaderTest,
ANGLE_INSTANTIATE_TEST(ComputeShaderTestES3, ES3_OPENGL(), ES3_OPENGLES()); ES31_OPENGL(),
ANGLE_INSTANTIATE_TEST(WebGL2ComputeTest, ES31_D3D11()); ES31_OPENGLES(),
ES31_D3D11(),
ES31_VULKAN());
ANGLE_INSTANTIATE_TEST(ComputeShaderTestES3, ES3_OPENGL(), ES3_OPENGLES(), ES3_VULKAN());
ANGLE_INSTANTIATE_TEST(WebGL2ComputeTest, ES31_D3D11(), ES31_VULKAN());
} // namespace } // namespace
...@@ -315,7 +315,7 @@ TEST_P(ShaderStorageBufferTest31, ShaderStorageBufferReadWrite) ...@@ -315,7 +315,7 @@ TEST_P(ShaderStorageBufferTest31, ShaderStorageBufferReadWrite)
// Tests modifying an existing shader storage buffer // Tests modifying an existing shader storage buffer
TEST_P(ShaderStorageBufferTest31, ShaderStorageBufferReadWriteSame) TEST_P(ShaderStorageBufferTest31, ShaderStorageBufferReadWriteSame)
{ {
// Vulkan doesn't support memory barriers yet. http://anglebug.com/3574 // Missing PBO support in Vulkan. http://anglebug.com/3210
ANGLE_SKIP_TEST_IF(IsVulkan()); ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kComputeShaderSource[] = constexpr char kComputeShaderSource[] =
...@@ -413,9 +413,6 @@ void main() ...@@ -413,9 +413,6 @@ void main()
// Tests reading and writing to a shader storage buffer bound at an offset. // Tests reading and writing to a shader storage buffer bound at an offset.
TEST_P(ShaderStorageBufferTest31, ShaderStorageBufferReadWriteOffset) TEST_P(ShaderStorageBufferTest31, ShaderStorageBufferReadWriteOffset)
{ {
// Vulkan doesn't support memory barriers yet. http://anglebug.com/3574
ANGLE_SKIP_TEST_IF(IsVulkan());
constexpr char kCS[] = R"(#version 310 es constexpr char kCS[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in; layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
......
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