Commit e13f7ebe by Olli Etuaho Committed by Commit Bot

Make NVIDIA constant register zero skip specific to VS

It was found that the driver issue only affects vertex shaders, so the workaround can be simplified to affect only vertex shaders. BUG=angleproject:2294 TEST=WebGL conformance tests on passthrough command buffer, angle_end2end_tests Change-Id: Ie7fb4e75a3999e1de3d5c20d3de21e7ebb08f148 Reviewed-on: https://chromium-review.googlesource.com/889099Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
parent 199f4294
...@@ -124,10 +124,10 @@ struct WorkaroundsD3D ...@@ -124,10 +124,10 @@ struct WorkaroundsD3D
// So we add a dummy texture as render target in such case. See http://anglebug.com/2152 // So we add a dummy texture as render target in such case. See http://anglebug.com/2152
bool addDummyTextureNoRenderTarget = false; bool addDummyTextureNoRenderTarget = false;
// Don't use D3D constant register zero when allocating space for uniforms. This is targeted to // Don't use D3D constant register zero when allocating space for uniforms in the vertex shader.
// work around a bug in NVIDIA D3D driver version 388.59 where in very specific cases the driver // This is targeted to work around a bug in NVIDIA D3D driver version 388.59 where in very
// would not handle constant register zero correctly. // specific cases the driver would not handle constant register zero correctly.
bool skipConstantRegisterZero = false; bool skipVSConstantRegisterZero = false;
}; };
} // namespace angle } // namespace angle
......
...@@ -48,7 +48,7 @@ ShaderD3D::ShaderD3D(const gl::ShaderState &data, ...@@ -48,7 +48,7 @@ ShaderD3D::ShaderD3D(const gl::ShaderState &data,
{ {
mAdditionalOptions |= SH_EMULATE_ISNAN_FLOAT_FUNCTION; mAdditionalOptions |= SH_EMULATE_ISNAN_FLOAT_FUNCTION;
} }
if (workarounds.skipConstantRegisterZero) if (workarounds.skipVSConstantRegisterZero && mData.getShaderType() == GL_VERTEX_SHADER)
{ {
mAdditionalOptions |= SH_SKIP_D3D_CONSTANT_REGISTER_ZERO; mAdditionalOptions |= SH_SKIP_D3D_CONSTANT_REGISTER_ZERO;
} }
......
...@@ -1352,7 +1352,7 @@ void GenerateCaps(ID3D11Device *device, ...@@ -1352,7 +1352,7 @@ void GenerateCaps(ID3D11Device *device,
caps->maxVertexAttributes = static_cast<GLuint>(GetMaximumVertexInputSlots(featureLevel)); caps->maxVertexAttributes = static_cast<GLuint>(GetMaximumVertexInputSlots(featureLevel));
caps->maxVertexUniformVectors = caps->maxVertexUniformVectors =
static_cast<GLuint>(GetMaximumVertexUniformVectors(featureLevel)); static_cast<GLuint>(GetMaximumVertexUniformVectors(featureLevel));
if (workarounds.skipConstantRegisterZero) if (workarounds.skipVSConstantRegisterZero)
{ {
caps->maxVertexUniformVectors -= 1; caps->maxVertexUniformVectors -= 1;
} }
...@@ -1374,10 +1374,6 @@ void GenerateCaps(ID3D11Device *device, ...@@ -1374,10 +1374,6 @@ void GenerateCaps(ID3D11Device *device,
// Fragment shader limits // Fragment shader limits
caps->maxFragmentUniformVectors = caps->maxFragmentUniformVectors =
static_cast<GLuint>(GetMaximumPixelUniformVectors(featureLevel)); static_cast<GLuint>(GetMaximumPixelUniformVectors(featureLevel));
if (workarounds.skipConstantRegisterZero)
{
caps->maxFragmentUniformVectors -= 1;
}
caps->maxFragmentUniformComponents = caps->maxFragmentUniformVectors * 4; caps->maxFragmentUniformComponents = caps->maxFragmentUniformVectors * 4;
caps->maxFragmentUniformBlocks = caps->maxFragmentUniformBlocks =
static_cast<GLuint>(GetMaximumPixelUniformBlocks(featureLevel)); static_cast<GLuint>(GetMaximumPixelUniformBlocks(featureLevel));
...@@ -1394,10 +1390,6 @@ void GenerateCaps(ID3D11Device *device, ...@@ -1394,10 +1390,6 @@ void GenerateCaps(ID3D11Device *device,
static_cast<GLuint>(GetMaxComputeWorkGroupInvocations(featureLevel)); static_cast<GLuint>(GetMaxComputeWorkGroupInvocations(featureLevel));
caps->maxComputeUniformComponents = caps->maxComputeUniformComponents =
static_cast<GLuint>(GetMaximumComputeUniformVectors(featureLevel)) * 4; static_cast<GLuint>(GetMaximumComputeUniformVectors(featureLevel)) * 4;
if (workarounds.skipConstantRegisterZero)
{
caps->maxComputeUniformComponents -= 4;
}
caps->maxComputeUniformBlocks = caps->maxComputeUniformBlocks =
static_cast<GLuint>(GetMaximumComputeUniformBlocks(featureLevel)); static_cast<GLuint>(GetMaximumComputeUniformBlocks(featureLevel));
caps->maxComputeTextureImageUnits = caps->maxComputeTextureImageUnits =
...@@ -2214,7 +2206,7 @@ angle::WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps ...@@ -2214,7 +2206,7 @@ angle::WorkaroundsD3D GenerateWorkarounds(const Renderer11DeviceCaps &deviceCaps
workarounds.flushAfterEndingTransformFeedback = IsNvidia(adapterDesc.VendorId); workarounds.flushAfterEndingTransformFeedback = IsNvidia(adapterDesc.VendorId);
workarounds.getDimensionsIgnoresBaseLevel = IsNvidia(adapterDesc.VendorId); workarounds.getDimensionsIgnoresBaseLevel = IsNvidia(adapterDesc.VendorId);
workarounds.skipConstantRegisterZero = IsNvidia(adapterDesc.VendorId); workarounds.skipVSConstantRegisterZero = IsNvidia(adapterDesc.VendorId);
if (IsIntel(adapterDesc.VendorId)) if (IsIntel(adapterDesc.VendorId))
{ {
......
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