Commit ea8043b7 by Jamie Madill Committed by Kai Ninomiya

D3D: disable to translate uniform block to StructuredBuffer

Temporarily disables the feature that translate uniform block to StructuredBuffer on D3D backend for a bug. Adapted from a patch by xinghua.cao@intel.com Bug: chromium:1112112 Change-Id: I3419a0eb8ae619e1fa532ffb29f56a9099f04618 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2357752 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> (cherry picked from commit 9ae6d7f2) Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2360409
parent 006ab354
......@@ -2383,11 +2383,7 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps,
bool isIvyBridge = false;
bool isAMD = IsAMD(adapterDesc.VendorId);
bool isFeatureLevel9_3 = (deviceCaps.featureLevel <= D3D_FEATURE_LEVEL_9_3);
#if defined(ANGLE_ENABLE_WINDOWS_UWP)
bool isWin10 = true;
#else
bool isWin10 = IsWindows10OrGreater();
#endif
IntelDriverVersion capsVersion = IntelDriverVersion(0);
if (isIntel)
{
......@@ -2471,9 +2467,9 @@ void InitializeFeatures(const Renderer11DeviceCaps &deviceCaps,
// Intel, they've been blocklisted to the DX9 runtime.
ANGLE_FEATURE_CONDITION(features, allowClearForRobustResourceInit, true);
// Don't translate uniform block to StructuredBuffer on Windows 7 and earlier. This is targeted
// to work around a bug that fails to allocate ShaderResourceView for StructuredBuffer.
ANGLE_FEATURE_CONDITION(features, dontTranslateUniformBlockToStructuredBuffer, !isWin10);
// There is an issue(crbug.com/1112112) when translating uniform block to StructuredBuffer,
// so disable this feature temporarily.
ANGLE_FEATURE_CONDITION(features, dontTranslateUniformBlockToStructuredBuffer, true);
// Call platform hooks for testing overrides.
auto *platform = ANGLEPlatformCurrent();
......
......@@ -2975,6 +2975,38 @@ TEST_P(UniformBufferTest, Std140UniformBlockWithDynamicallyIndexedRowMajorArray)
EXPECT_PIXEL_COLOR_NEAR(0, 0, GLColor(0, 255, 0, 255), 5);
}
// Test to transfer an uniform block large array member as an actual parameter to a function.
TEST_P(UniformBufferTest, UniformBlocklargeArrayMemberAsActualParameter)
{
constexpr char kVS[] = R"(#version 300 es
layout(location=0) in vec3 a_position;
uniform UBO{
mat4x4[90] buf;
} instance;
vec4 test( mat4x4[90] para, vec3 pos ){
return para[ 0 ] * vec4( pos, 1.0 );
}
void main(void){
gl_Position = test( instance.buf, a_position );
})";
constexpr char kFS[] = R"(#version 300 es
precision mediump float;
uniform vec3 u_color;
out vec4 oFragColor;
void main(void){
oFragColor = vec4( u_color, 1.0);
})";
ANGLE_GL_PROGRAM(program, kVS, kFS);
EXPECT_GL_NO_ERROR();
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against.
ANGLE_INSTANTIATE_TEST_ES3(UniformBufferTest);
......
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