Commit 1fdf6ca5 by Xinghua Cao Committed by Commit Bot

D3D11: Restrict to translate uniform block to StructuredBuffer

Only translate uniform block to StructuredBuffer when system is Windows 10 and later. Bug: angleproject:3682 Change-Id: I27e3f4503392791883a44e1d486ffe9512e04bd8 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1984863 Commit-Queue: Xinghua Cao <xinghua.cao@intel.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org>
parent cbbfa2f2
...@@ -315,7 +315,7 @@ const ShCompileOptions SH_ADD_BASE_VERTEX_TO_VERTEX_ID = UINT64_C(1) << 48; ...@@ -315,7 +315,7 @@ const ShCompileOptions SH_ADD_BASE_VERTEX_TO_VERTEX_ID = UINT64_C(1) << 48;
const ShCompileOptions SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR = UINT64_C(1) << 49; const ShCompileOptions SH_REMOVE_DYNAMIC_INDEXING_OF_SWIZZLED_VECTOR = UINT64_C(1) << 49;
// This flag works a driver bug that fails to allocate ShaderResourceView for StructuredBuffer // This flag works a driver bug that fails to allocate ShaderResourceView for StructuredBuffer
// on old Windows system with AMD driver. // on Windows 7 and earlier.
const ShCompileOptions SH_DONT_TRANSLATE_UNIFORM_BLOCK_TO_STRUCTUREDBUFFER = UINT64_C(1) << 50; const ShCompileOptions SH_DONT_TRANSLATE_UNIFORM_BLOCK_TO_STRUCTUREDBUFFER = UINT64_C(1) << 50;
// Defines alternate strategies for implementing array index clamping. // Defines alternate strategies for implementing array index clamping.
......
...@@ -207,9 +207,8 @@ struct FeaturesD3D : FeatureSetBase ...@@ -207,9 +207,8 @@ struct FeaturesD3D : FeatureSetBase
"Some drivers corrupt texture data when clearing for robust resource initialization.", "Some drivers corrupt texture data when clearing for robust resource initialization.",
&members, "http://crbug.com/941620"}; &members, "http://crbug.com/941620"};
// Don't translate uniform block to StructuredBuffer on old Windows system with AMD driver. // Don't translate uniform block to StructuredBuffer on Windows 7 and earlier. This is targeted
// This is targeted to work around a bug in AMD D3D driver that fails to allocate // to work around a bug that fails to allocate ShaderResourceView for StructuredBuffer.
// ShaderResourceView for StructuredBuffer.
Feature dontTranslateUniformBlockToStructuredBuffer = { Feature dontTranslateUniformBlockToStructuredBuffer = {
"dont_translate_uniform_block_to_structured_buffer", FeatureCategory::D3DWorkarounds, "dont_translate_uniform_block_to_structured_buffer", FeatureCategory::D3DWorkarounds,
"Fails to allocate ShaderResourceView for StructuredBuffer on some drivers", &members}; "Fails to allocate ShaderResourceView for StructuredBuffer on some drivers", &members};
......
...@@ -2445,11 +2445,10 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps, ...@@ -2445,11 +2445,10 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps,
// Never clear for robust resource init. This matches Chrome's texture clearning behaviour. // Never clear for robust resource init. This matches Chrome's texture clearning behaviour.
ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, false); ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, false);
// Don't translate uniform block to StructuredBuffer on old Windows system with AMD driver. // Don't translate uniform block to StructuredBuffer on Windows 7 and earlier. This is targeted
// This is targeted to work around a bug in AMD D3D driver that fails to allocate // to work around a bug that fails to allocate ShaderResourceView for StructuredBuffer.
// ShaderResourceView for StructuredBuffer.
ANGLE_FEATURE_CONDITION(features, dontTranslateUniformBlockToStructuredBuffer, ANGLE_FEATURE_CONDITION(features, dontTranslateUniformBlockToStructuredBuffer,
isAMD && !IsWindows10OrGreater()); !IsWindows10OrGreater());
// Call platform hooks for testing overrides. // Call platform hooks for testing overrides.
auto *platform = ANGLEPlatformCurrent(); auto *platform = ANGLEPlatformCurrent();
......
...@@ -1636,9 +1636,6 @@ TEST_P(UniformBufferTest, LargeArrayOfStructs) ...@@ -1636,9 +1636,6 @@ TEST_P(UniformBufferTest, LargeArrayOfStructs)
// member. // member.
TEST_P(UniformBufferTest, UniformBlockWithOneLargeStructArray) TEST_P(UniformBufferTest, UniformBlockWithOneLargeStructArray)
{ {
// TODO(crbug.com/1037644): Re-enable this test on this config.
ANGLE_SKIP_TEST_IF(IsWindows7() && IsNVIDIA() && IsD3D11());
GLint64 maxUniformBlockSize; GLint64 maxUniformBlockSize;
glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize); glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize);
std::ostringstream stream; std::ostringstream stream;
...@@ -1751,9 +1748,6 @@ TEST_P(UniformBufferTest, UniformBlockWithOneLargeStructArray) ...@@ -1751,9 +1748,6 @@ TEST_P(UniformBufferTest, UniformBlockWithOneLargeStructArray)
// a mat4 member and a float member. // a mat4 member and a float member.
TEST_P(UniformBufferTest, UniformBlockWithOneLargeMixStructArray) TEST_P(UniformBufferTest, UniformBlockWithOneLargeMixStructArray)
{ {
// TODO(crbug.com/1037644): Re-enable this test on this config.
ANGLE_SKIP_TEST_IF(IsWindows7() && IsNVIDIA() && IsD3D11());
GLint64 maxUniformBlockSize; GLint64 maxUniformBlockSize;
glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize); glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize);
std::ostringstream stream; std::ostringstream stream;
...@@ -1884,9 +1878,6 @@ TEST_P(UniformBufferTest, UniformBlockWithOneLargeMixStructArray) ...@@ -1884,9 +1878,6 @@ TEST_P(UniformBufferTest, UniformBlockWithOneLargeMixStructArray)
// struct array member in the same program, and they share a uniform buffer. // struct array member in the same program, and they share a uniform buffer.
TEST_P(UniformBufferTest, UniformBlocksInSameProgramShareUniformBuffer) TEST_P(UniformBufferTest, UniformBlocksInSameProgramShareUniformBuffer)
{ {
// TODO(crbug.com/1037644): Re-enable this test on this config.
ANGLE_SKIP_TEST_IF(IsWindows7() && IsNVIDIA() && IsD3D11());
GLint64 maxUniformBlockSize; GLint64 maxUniformBlockSize;
glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize); glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize);
std::ostringstream stream; std::ostringstream stream;
...@@ -2016,9 +2007,6 @@ TEST_P(UniformBufferTest, UniformBlocksInSameProgramShareUniformBuffer) ...@@ -2016,9 +2007,6 @@ TEST_P(UniformBufferTest, UniformBlocksInSameProgramShareUniformBuffer)
// struct array member in the different programs, and they share a uniform buffer. // struct array member in the different programs, and they share a uniform buffer.
TEST_P(UniformBufferTest, UniformBlocksInDiffProgramShareUniformBuffer) TEST_P(UniformBufferTest, UniformBlocksInDiffProgramShareUniformBuffer)
{ {
// TODO(crbug.com/1037644): Re-enable this test on this config.
ANGLE_SKIP_TEST_IF(IsWindows7() && IsNVIDIA() && IsD3D11());
GLint64 maxUniformBlockSize; GLint64 maxUniformBlockSize;
glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize); glGetInteger64v(GL_MAX_UNIFORM_BLOCK_SIZE, &maxUniformBlockSize);
std::ostringstream stream1; std::ostringstream stream1;
......
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