Commit 87de3627 by Jamie Madill

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/257131Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 67102f01
...@@ -1082,6 +1082,11 @@ const PixelPackState &State::getPackState() const ...@@ -1082,6 +1082,11 @@ const PixelPackState &State::getPackState() const
return mPack; return mPack;
} }
PixelPackState &State::getPackState()
{
return mPack;
}
void State::setUnpackAlignment(GLint alignment) void State::setUnpackAlignment(GLint alignment)
{ {
mUnpack.alignment = alignment; mUnpack.alignment = alignment;
......
...@@ -237,6 +237,7 @@ class State ...@@ -237,6 +237,7 @@ class State
void setPackReverseRowOrder(bool reverseRowOrder); void setPackReverseRowOrder(bool reverseRowOrder);
bool getPackReverseRowOrder() const; bool getPackReverseRowOrder() const;
const PixelPackState &getPackState() const; const PixelPackState &getPackState() const;
PixelPackState &getPackState();
// Pixel unpack state manipulation // Pixel unpack state manipulation
void setUnpackAlignment(GLint alignment); void setUnpackAlignment(GLint alignment);
......
...@@ -217,15 +217,24 @@ struct PixelPackState ...@@ -217,15 +217,24 @@ struct PixelPackState
BindingPointer<Buffer> pixelBuffer; BindingPointer<Buffer> pixelBuffer;
GLint alignment; GLint alignment;
bool reverseRowOrder; bool reverseRowOrder;
GLint rowLength;
GLint skipRows;
GLint skipPixels;
PixelPackState() PixelPackState()
: alignment(4), : alignment(4),
reverseRowOrder(false) reverseRowOrder(false),
rowLength(0),
skipRows(0),
skipPixels(0)
{} {}
explicit PixelPackState(GLint alignmentIn, bool reverseRowOrderIn) explicit PixelPackState(GLint alignmentIn, bool reverseRowOrderIn)
: alignment(alignmentIn), : alignment(alignmentIn),
reverseRowOrder(reverseRowOrderIn) reverseRowOrder(reverseRowOrderIn),
rowLength(0),
skipRows(0),
skipPixels(0)
{} {}
}; };
......
...@@ -299,11 +299,19 @@ GLenum FramebufferD3D::getImplementationColorReadType() const ...@@ -299,11 +299,19 @@ GLenum FramebufferD3D::getImplementationColorReadType() const
gl::Error FramebufferD3D::readPixels(const gl::State &state, const gl::Rectangle &area, GLenum format, GLenum type, GLvoid *pixels) const 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); GLenum sizedInternalFormat = gl::GetSizedInternalFormat(format, type);
const gl::InternalFormat &sizedFormatInfo = gl::GetInternalFormatInfo(sizedInternalFormat); 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, gl::Error FramebufferD3D::blit(const gl::State &state, const gl::Rectangle &sourceArea, const gl::Rectangle &destArea,
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "libANGLE/renderer/gl/FramebufferGL.h" #include "libANGLE/renderer/gl/FramebufferGL.h"
#include "common/debug.h" #include "common/debug.h"
#include "libANGLE/State.h"
namespace rx namespace rx
{ {
...@@ -106,6 +107,14 @@ GLenum FramebufferGL::getImplementationColorReadType() const ...@@ -106,6 +107,14 @@ GLenum FramebufferGL::getImplementationColorReadType() const
gl::Error FramebufferGL::readPixels(const gl::State &state, const gl::Rectangle &area, GLenum format, GLenum type, GLvoid *pixels) const gl::Error FramebufferGL::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");
}
UNIMPLEMENTED(); UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION); return gl::Error(GL_INVALID_OPERATION);
} }
......
...@@ -3232,10 +3232,18 @@ void GL_APIENTRY PixelStorei(GLenum pname, GLint param) ...@@ -3232,10 +3232,18 @@ void GL_APIENTRY PixelStorei(GLenum pname, GLint param)
break; break;
case GL_PACK_ROW_LENGTH: case GL_PACK_ROW_LENGTH:
ASSERT(context->getClientVersion() >= 3);
state.getPackState().rowLength = param;
break;
case GL_PACK_SKIP_ROWS: case GL_PACK_SKIP_ROWS:
ASSERT(context->getClientVersion() >= 3);
state.getPackState().skipRows = param;
break;
case GL_PACK_SKIP_PIXELS: case GL_PACK_SKIP_PIXELS:
ASSERT(context->getClientVersion() >= 3); ASSERT(context->getClientVersion() >= 3);
UNIMPLEMENTED(); state.getPackState().skipPixels = param;
break; break;
default: default:
......
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