Commit f7af13c4 by Qin Jiajia Committed by Commit Bot

Fix the divide by zero exception in BindBufferRange

This bug is caught because we haven't implemented caps.shaderStorageBufferOffsetAlignment on D3D backend. So the default value is 0. This change will set its value for D3D11 backend. BUG=angleproject:2625 TEST=angle_deqp_gles31_tests Change-Id: I03c045c08903e4da41659133e7dbd9c4133186cc Reviewed-on: https://chromium-review.googlesource.com/1088192Reviewed-by: 's avatarYunchao He <yunchao.he@intel.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 096a6c8c
......@@ -1459,6 +1459,13 @@ void GenerateCaps(ID3D11Device *device,
caps->maxCombinedUniformBlocks = caps->maxShaderUniformBlocks[gl::ShaderType::Vertex] +
caps->maxShaderUniformBlocks[gl::ShaderType::Fragment];
// A shader storage block will be translated to a structure in HLSL. So We reference the HLSL
// structure packing rules
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb509632(v=vs.85).aspx. The
// resulting size of any structure will always be evenly divisible by sizeof(four-component
// vector).
caps->shaderStorageBufferOffsetAlignment = 16;
for (gl::ShaderType shaderType : gl::AllShaderTypes())
{
caps->maxCombinedShaderUniformComponents[shaderType] =
......
......@@ -1543,6 +1543,7 @@ static bool ValidateBindBufferCommon(Context *context,
return false;
}
ASSERT(caps.uniformBufferOffsetAlignment);
if (buffer != 0 && (offset % caps.uniformBufferOffsetAlignment) != 0)
{
context->handleError(
......@@ -1589,6 +1590,7 @@ static bool ValidateBindBufferCommon(Context *context,
"indexed binding points.");
return false;
}
ASSERT(caps.shaderStorageBufferOffsetAlignment);
if (buffer != 0 && (offset % caps.shaderStorageBufferOffsetAlignment) != 0)
{
context->handleError(InvalidValue() << "offset must be multiple of value of "
......
......@@ -78,16 +78,16 @@
1442 D3D11 : dEQP-GLES31.functional.state_query.program.compute_work_group_size_get_programiv = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.async.case_4_log = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.async.case_5_callback = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_2 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_3 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_9 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_10 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_27 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_28 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_2 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_3 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_9 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_10 = SKIP
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_2 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_3 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_9 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_10 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_27 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_28 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_2 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_3 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_9 = FAIL
1442 D3D11 : dEQP-GLES31.functional.debug.error_groups.case_10 = FAIL
1442 D3D11 : dEQP-GLES31.functional.state_query.program.active_atomic_counter_buffers_get_programiv = FAIL
1442 D3D11 : dEQP-GLES31.functional.layout_binding.ubo.* = FAIL
1663 D3D11 : dEQP-GLES31.functional.draw_indirect.compute_interop.* = FAIL
......@@ -1569,12 +1569,6 @@
1941 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.log.shader_directive.geometry_shader = FAIL
1941 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.shader_directive.geometry_shader = FAIL
// Crash with a divide by zero exception in BindBufferRange.
2625 D3D11 : dEQP-GLES31.functional.debug.error_filters.case_23 = SKIP
2625 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.callbacks.buffer.bind_buffer_range = SKIP
2625 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.get_error.buffer.bind_buffer_range = SKIP
2625 D3D11 : dEQP-GLES31.functional.debug.negative_coverage.log.buffer.bind_buffer_range = SKIP
// Recetly added tests failing on D3D11 Windows.
2619 D3D11 : dEQP-GLES31.functional.shaders.builtin_functions.uniform.findLSBMinusOne.highp_compute = FAIL
2619 D3D11 : dEQP-GLES31.functional.shaders.builtin_functions.uniform.findLSBMinusOne.lowp_compute = FAIL
......
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