Commit 88e03221 by Stephen Martinis Committed by Commit Bot

Unset conflicting SRVs and UAVs

D3D11 cannot allow the same (sub)-resource bound as both a SRV and an UAV at the same time. Unset conflicting SRVs and UVAs between render pipeline and compute pipeline. Bug: angleproject:3152 TEST=angle_end2end_tests.ComputeShaderTest.* Change-Id: I9cb8b902edbf987166a57af314af6b21a6874998 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1576504Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Xinghua Cao <xinghua.cao@intel.com>
parent 6c824a1b
......@@ -893,6 +893,22 @@ unsigned int ElementTypeSize(GLenum elementType)
}
}
PipelineType GetPipelineType(ShaderType type)
{
switch (type)
{
case ShaderType::Vertex:
case ShaderType::Fragment:
case ShaderType::Geometry:
return PipelineType::GraphicsPipeline;
case ShaderType::Compute:
return PipelineType::ComputePipeline;
default:
UNREACHABLE();
return PipelineType::GraphicsPipeline;
}
}
} // namespace gl
namespace egl
......
......@@ -202,6 +202,14 @@ T GetClampedVertexCount(size_t vertexCount)
static constexpr size_t kMax = static_cast<size_t>(std::numeric_limits<T>::max());
return static_cast<T>(vertexCount > kMax ? kMax : vertexCount);
}
enum class PipelineType
{
GraphicsPipeline = 0,
ComputePipeline = 1,
};
PipelineType GetPipelineType(ShaderType shaderType);
} // namespace gl
namespace egl
......
......@@ -296,10 +296,17 @@ class StateManager11 final : angle::NonCopyable
UINT resourceSlot,
const UAVType *uav);
bool unsetConflictingView(ID3D11View *view);
bool unsetConflictingSRVs(gl::ShaderType shaderType,
void unsetConflictingView(gl::PipelineType pipeline, ID3D11View *view, bool isRenderTarget);
void unsetConflictingSRVs(gl::PipelineType pipeline,
gl::ShaderType shaderType,
uintptr_t resource,
const gl::ImageIndex *index,
bool isRenderTarget);
void unsetConflictingUAVs(gl::PipelineType pipeline,
gl::ShaderType shaderType,
uintptr_t resource,
const gl::ImageIndex *index);
void unsetConflictingAttachmentResources(const gl::FramebufferAttachment &attachment,
ID3D11Resource *resource);
......@@ -428,6 +435,10 @@ class StateManager11 final : angle::NonCopyable
// DIRTY_BIT_SHADERS and DIRTY_BIT_TEXTURE_AND_SAMPLER_STATE should be dealt before
// DIRTY_BIT_PROGRAM_UNIFORM_BUFFERS for update image layers.
DIRTY_BIT_SHADERS,
// DIRTY_BIT_GRAPHICS_SRVUAV_STATE and DIRTY_BIT_COMPUTE_SRVUAV_STATE should be lower
// bits than DIRTY_BIT_TEXTURE_AND_SAMPLER_STATE.
DIRTY_BIT_GRAPHICS_SRVUAV_STATE,
DIRTY_BIT_COMPUTE_SRVUAV_STATE,
DIRTY_BIT_TEXTURE_AND_SAMPLER_STATE,
DIRTY_BIT_PROGRAM_UNIFORMS,
DIRTY_BIT_DRIVER_UNIFORMS,
......@@ -448,6 +459,7 @@ class StateManager11 final : angle::NonCopyable
// Internal dirty bits.
DirtyBits mInternalDirtyBits;
DirtyBits mGraphicsDirtyBitsMask;
DirtyBits mComputeDirtyBitsMask;
// Blend State
......
......@@ -2790,9 +2790,6 @@ void main()
// 2. DrawArrays.
TEST_P(ComputeShaderTest, DispatchDraw)
{
// TODO(xinghua.cao@intel.com): http://anglebug.com/3152
ANGLE_SKIP_TEST_IF(IsD3D11());
const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(rgba32f, binding = 0) writeonly uniform highp image2D image;
......@@ -2860,9 +2857,6 @@ void main(void) {
// 4. DrawArrays.
TEST_P(ComputeShaderTest, DrawDispachDispatchDraw)
{
// TODO(xinghua.cao@intel.com): http://anglebug.com/3152
ANGLE_SKIP_TEST_IF(IsD3D11());
const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(rgba32f, binding = 0) writeonly uniform highp image2D image;
......@@ -2939,9 +2933,6 @@ void main(void) {
// 4. DispatchCompute.
TEST_P(ComputeShaderTest, DispatchDrawDrawDispatch)
{
// TODO(xinghua.cao@intel.com): http://anglebug.com/3152
ANGLE_SKIP_TEST_IF(IsD3D11());
const char kCSSource[] = R"(#version 310 es
layout(local_size_x=1, local_size_y=1, local_size_z=1) in;
layout(rgba32f, binding = 0) writeonly uniform highp image2D image;
......
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