Commit 3f23406a by Geoff Lang Committed by Commit Bot

Compute row pitch using the size of the input pixel, not the format pixel.

For formats that can be loaded with data that has a different size pixel than the internal format (UNSIGNED_INT -> GL_DEPTH_COMPONENT_24) the row length would be computed as rowLength * 3 which is incorrect. BUG=angleproject:1095 Change-Id: I0f60a3bb9bb387d475ddda1389a3b4b6f4973922 Reviewed-on: https://chromium-review.googlesource.com/360214Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent b741c761
......@@ -712,21 +712,11 @@ gl::ErrorOrResult<GLuint> InternalFormat::computeRowPitch(GLenum formatType,
return computeCompressedImageSize(formatType, gl::Extents(width, 1, 1));
}
CheckedNumeric<GLuint> checkedRowBytes(0);
if (rowLength > 0)
{
CheckedNumeric<GLuint> checkePixelBytes(pixelBytes);
checkedRowBytes = checkePixelBytes * rowLength;
}
else
{
CheckedNumeric<GLuint> checkedWidth(width);
const auto &typeInfo = GetTypeInfo(formatType);
CheckedNumeric<GLuint> checkedComponents(typeInfo.specialInterpretation ? 1u
: componentCount);
CheckedNumeric<GLuint> checkedTypeBytes(typeInfo.bytes);
checkedRowBytes = checkedWidth * checkedComponents * checkedTypeBytes;
}
const auto &typeInfo = GetTypeInfo(formatType);
CheckedNumeric<GLuint> checkedComponents(typeInfo.specialInterpretation ? 1u : componentCount);
CheckedNumeric<GLuint> checkedTypeBytes(typeInfo.bytes);
CheckedNumeric<GLuint> checkedWidth(rowLength > 0 ? rowLength : width);
CheckedNumeric<GLuint> checkedRowBytes = checkedWidth * checkedComponents * checkedTypeBytes;
ASSERT(alignment > 0 && isPow2(alignment));
CheckedNumeric<GLuint> checkedAlignment(alignment);
......
......@@ -109,7 +109,6 @@
1436 WIN : dEQP-GLES3.functional.shaders.texture_functions.textureprojgrad.sampler2dshadow_fragment = FAIL
1436 WIN : dEQP-GLES3.functional.shaders.texture_functions.textureprojgradoffset.sampler2dshadow_vertex = FAIL
1436 WIN : dEQP-GLES3.functional.shaders.texture_functions.textureprojgradoffset.sampler2dshadow_fragment = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage2d_depth_pbo.depth_component24 = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.2d_rgba = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.2d_alpha = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.2d_luminance_alpha = FAIL
......@@ -118,7 +117,6 @@
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.cube_alpha = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.cube_luminance_alpha = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.basic_copytexsubimage2d.cube_rgb = FAIL
1095 WIN : dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth_component24_2d_array = FAIL
1096 WIN : dEQP-GLES3.functional.fragment_ops.depth_stencil.stencil_depth_funcs.stencil_* = FAIL
1096 WIN : dEQP-GLES3.functional.fragment_ops.depth_stencil.stencil_ops.* = FAIL
1096 WIN : dEQP-GLES3.functional.fragment_ops.depth_stencil.write_mask.* = 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