Implement pass-through pack state params.
Same as for unpack, this allows us to pass through the state reset
code of dEQP without UNIMPLEMENTED errors, while still throwing
asserts if they are set to non-default values.
BUG=angleproject:901,angleproject:512
Change-Id: I0ce0258b0e91eb83c066c241693aaa5c164b2989
Reviewed-on: https://chromium-review.googlesource.com/257131
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 7ef36ea..5bb9681 100644
--- a/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -299,11 +299,19 @@
gl::Error FramebufferD3D::readPixels(const gl::State &state, const gl::Rectangle &area, GLenum format, GLenum type, GLvoid *pixels) const
{
+ const gl::PixelPackState &packState = state.getPackState();
+
+ if (packState.rowLength != 0 || packState.skipRows != 0 || packState.skipPixels != 0)
+ {
+ UNIMPLEMENTED();
+ return gl::Error(GL_INVALID_OPERATION, "invalid pixel store parameters in readPixels");
+ }
+
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(format, type);
const gl::InternalFormat &sizedFormatInfo = gl::GetInternalFormatInfo(sizedInternalFormat);
- GLuint outputPitch = sizedFormatInfo.computeRowPitch(type, area.width, state.getPackAlignment(), 0);
+ GLuint outputPitch = sizedFormatInfo.computeRowPitch(type, area.width, packState.alignment, 0);
- return readPixels(area, format, type, outputPitch, state.getPackState(), reinterpret_cast<uint8_t*>(pixels));
+ return readPixels(area, format, type, outputPitch, packState, reinterpret_cast<uint8_t*>(pixels));
}
gl::Error FramebufferD3D::blit(const gl::State &state, const gl::Rectangle &sourceArea, const gl::Rectangle &destArea,