Commit c7473924 by Jamie Madill

Revert "Implements more pack/unpack states. Pack: row length, skip rows, skip…

Revert "Implements more pack/unpack states. Pack: row length, skip rows, skip pixels. Unpack: image height, skip images, skip rows, skip pixels. Note that PBOs are not covered by this change." Expectations still not correct. This removes suppressions for two failing tests: functional.texture.specification.teximage3d_depth_pbo.depth_component32f_2d_array dEQP-GLES3.functional.texture.specification.teximage3d_depth_pbo.depth32f_stencil8_2d_array BUG=angleproject:512 BUG=angleproject:1095 This reverts commit 72e7013e. Change-Id: Id81b6e616e61535b8504890ce57591813e22af69 Reviewed-on: https://chromium-review.googlesource.com/305521Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent a6996685
......@@ -1106,7 +1106,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_PACK_ROW_LENGTH:
case GL_PACK_SKIP_ROWS:
case GL_PACK_SKIP_PIXELS:
if ((mClientVersion < 3) && !mExtensions.packSubimage)
if (!mExtensions.packSubimage)
{
return false;
}
......@@ -1116,7 +1116,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_UNPACK_ROW_LENGTH:
case GL_UNPACK_SKIP_ROWS:
case GL_UNPACK_SKIP_PIXELS:
if ((mClientVersion < 3) && !mExtensions.unpackSubimage)
if (!mExtensions.unpackSubimage)
{
return false;
}
......@@ -1237,8 +1237,6 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu
case GL_PACK_SKIP_ROWS:
case GL_PACK_SKIP_PIXELS:
case GL_UNPACK_ROW_LENGTH:
case GL_UNPACK_IMAGE_HEIGHT:
case GL_UNPACK_SKIP_IMAGES:
case GL_UNPACK_SKIP_ROWS:
case GL_UNPACK_SKIP_PIXELS:
{
......
......@@ -28,16 +28,9 @@ State::State()
// TODO(jmadill): additional ES3 state
mUnpackStateBitMask.set(DIRTY_BIT_UNPACK_ALIGNMENT);
mUnpackStateBitMask.set(DIRTY_BIT_UNPACK_ROW_LENGTH);
mUnpackStateBitMask.set(DIRTY_BIT_UNPACK_IMAGE_HEIGHT);
mUnpackStateBitMask.set(DIRTY_BIT_UNPACK_SKIP_IMAGES);
mUnpackStateBitMask.set(DIRTY_BIT_UNPACK_SKIP_ROWS);
mUnpackStateBitMask.set(DIRTY_BIT_UNPACK_SKIP_PIXELS);
mPackStateBitMask.set(DIRTY_BIT_PACK_ALIGNMENT);
mPackStateBitMask.set(DIRTY_BIT_PACK_REVERSE_ROW_ORDER);
mPackStateBitMask.set(DIRTY_BIT_PACK_ROW_LENGTH);
mPackStateBitMask.set(DIRTY_BIT_PACK_SKIP_ROWS);
mPackStateBitMask.set(DIRTY_BIT_PACK_SKIP_PIXELS);
mClearStateBitMask.set(DIRTY_BIT_RASTERIZER_DISCARD_ENABLED);
mClearStateBitMask.set(DIRTY_BIT_SCISSOR_TEST_ENABLED);
......@@ -1123,39 +1116,6 @@ bool State::getPackReverseRowOrder() const
return mPack.reverseRowOrder;
}
void State::setPackRowLength(GLint rowLength)
{
mPack.rowLength = rowLength;
mDirtyBits.set(DIRTY_BIT_PACK_ROW_LENGTH);
}
GLint State::getPackRowLength() const
{
return mPack.rowLength;
}
void State::setPackSkipRows(GLint skipRows)
{
mPack.skipRows = skipRows;
mDirtyBits.set(DIRTY_BIT_PACK_SKIP_ROWS);
}
GLint State::getPackSkipRows() const
{
return mPack.skipRows;
}
void State::setPackSkipPixels(GLint skipPixels)
{
mPack.skipPixels = skipPixels;
mDirtyBits.set(DIRTY_BIT_PACK_SKIP_PIXELS);
}
GLint State::getPackSkipPixels() const
{
return mPack.skipPixels;
}
const PixelPackState &State::getPackState() const
{
return mPack;
......@@ -1188,50 +1148,6 @@ GLint State::getUnpackRowLength() const
return mUnpack.rowLength;
}
void State::setUnpackImageHeight(GLint imageHeight)
{
mUnpack.imageHeight = imageHeight;
mDirtyBits.set(DIRTY_BIT_UNPACK_IMAGE_HEIGHT);
}
GLint State::getUnpackImageHeight() const
{
return mUnpack.imageHeight;
}
void State::setUnpackSkipImages(GLint skipImages)
{
mUnpack.skipImages = skipImages;
mDirtyBits.set(DIRTY_BIT_UNPACK_SKIP_IMAGES);
}
GLint State::getUnpackSkipImages() const
{
return mUnpack.skipImages;
}
void State::setUnpackSkipRows(GLint skipRows)
{
mUnpack.skipRows = skipRows;
mDirtyBits.set(DIRTY_BIT_UNPACK_SKIP_ROWS);
}
GLint State::getUnpackSkipRows() const
{
return mUnpack.skipRows;
}
void State::setUnpackSkipPixels(GLint skipPixels)
{
mUnpack.skipPixels = skipPixels;
mDirtyBits.set(DIRTY_BIT_UNPACK_SKIP_PIXELS);
}
GLint State::getUnpackSkipPixels() const
{
return mUnpack.skipPixels;
}
const PixelUnpackState &State::getUnpackState() const
{
return mUnpack;
......@@ -1334,29 +1250,8 @@ void State::getIntegerv(const gl::Data &data, GLenum pname, GLint *params)
case GL_CURRENT_PROGRAM: *params = mProgram ? mProgram->id() : 0; break;
case GL_PACK_ALIGNMENT: *params = mPack.alignment; break;
case GL_PACK_REVERSE_ROW_ORDER_ANGLE: *params = mPack.reverseRowOrder; break;
case GL_PACK_ROW_LENGTH:
*params = mPack.rowLength;
break;
case GL_PACK_SKIP_ROWS:
*params = mPack.skipRows;
break;
case GL_PACK_SKIP_PIXELS:
*params = mPack.skipPixels;
break;
case GL_UNPACK_ALIGNMENT: *params = mUnpack.alignment; break;
case GL_UNPACK_ROW_LENGTH: *params = mUnpack.rowLength; break;
case GL_UNPACK_IMAGE_HEIGHT:
*params = mUnpack.imageHeight;
break;
case GL_UNPACK_SKIP_IMAGES:
*params = mUnpack.skipImages;
break;
case GL_UNPACK_SKIP_ROWS:
*params = mUnpack.skipRows;
break;
case GL_UNPACK_SKIP_PIXELS:
*params = mUnpack.skipPixels;
break;
case GL_GENERATE_MIPMAP_HINT: *params = mGenerateMipmapHint; break;
case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: *params = mFragmentShaderDerivativeHint; break;
case GL_ACTIVE_TEXTURE:
......
......@@ -232,12 +232,6 @@ class State : angle::NonCopyable
GLint getPackAlignment() const;
void setPackReverseRowOrder(bool reverseRowOrder);
bool getPackReverseRowOrder() const;
void setPackRowLength(GLint rowLength);
GLint getPackRowLength() const;
void setPackSkipRows(GLint skipRows);
GLint getPackSkipRows() const;
void setPackSkipPixels(GLint skipPixels);
GLint getPackSkipPixels() const;
const PixelPackState &getPackState() const;
PixelPackState &getPackState();
......@@ -246,14 +240,6 @@ class State : angle::NonCopyable
GLint getUnpackAlignment() const;
void setUnpackRowLength(GLint rowLength);
GLint getUnpackRowLength() const;
void setUnpackImageHeight(GLint imageHeight);
GLint getUnpackImageHeight() const;
void setUnpackSkipImages(GLint skipImages);
GLint getUnpackSkipImages() const;
void setUnpackSkipRows(GLint skipRows);
GLint getUnpackSkipRows() const;
void setUnpackSkipPixels(GLint skipPixels);
GLint getUnpackSkipPixels() const;
const PixelUnpackState &getUnpackState() const;
PixelUnpackState &getUnpackState();
......@@ -303,15 +289,8 @@ class State : angle::NonCopyable
DIRTY_BIT_CLEAR_STENCIL,
DIRTY_BIT_UNPACK_ALIGNMENT,
DIRTY_BIT_UNPACK_ROW_LENGTH,
DIRTY_BIT_UNPACK_IMAGE_HEIGHT,
DIRTY_BIT_UNPACK_SKIP_IMAGES,
DIRTY_BIT_UNPACK_SKIP_ROWS,
DIRTY_BIT_UNPACK_SKIP_PIXELS,
DIRTY_BIT_PACK_ALIGNMENT,
DIRTY_BIT_PACK_REVERSE_ROW_ORDER,
DIRTY_BIT_PACK_ROW_LENGTH,
DIRTY_BIT_PACK_SKIP_ROWS,
DIRTY_BIT_PACK_SKIP_PIXELS,
DIRTY_BIT_DITHER_ENABLED,
DIRTY_BIT_GENERATE_MIPMAP_HINT,
DIRTY_BIT_SHADER_DERIVATIVE_HINT,
......
......@@ -589,23 +589,9 @@ GLuint InternalFormat::computeRowPitch(GLenum formatType, GLsizei width, GLint a
return rx::roundUp(rowBytes, static_cast<GLuint>(alignment));
}
GLuint InternalFormat::computeDepthPitch(GLenum formatType,
GLsizei width,
GLsizei height,
GLint alignment,
GLint rowLength,
GLint imageHeight) const
GLuint InternalFormat::computeDepthPitch(GLenum formatType, GLsizei width, GLsizei height, GLint alignment, GLint rowLength) const
{
GLuint rows;
if (imageHeight > 0)
{
rows = imageHeight;
}
else
{
rows = height;
}
return computeRowPitch(formatType, width, alignment, rowLength) * rows;
return computeRowPitch(formatType, width, alignment, rowLength) * height;
}
GLuint InternalFormat::computeBlockSize(GLenum formatType, GLsizei width, GLsizei height) const
......@@ -630,15 +616,6 @@ GLuint InternalFormat::computeBlockSize(GLenum formatType, GLsizei width, GLsize
}
}
GLuint InternalFormat::computeSkipPixels(GLint rowPitch,
GLint depthPitch,
GLint skipImages,
GLint skipRows,
GLint skipPixels) const
{
return skipImages * depthPitch + skipRows * rowPitch + skipPixels * pixelBytes;
}
GLenum GetSizedInternalFormat(GLenum internalFormat, GLenum type)
{
const InternalFormat& formatInfo = GetInternalFormatInfo(internalFormat);
......
......@@ -66,18 +66,8 @@ struct InternalFormat
SupportCheckFunction filterSupport;
GLuint computeRowPitch(GLenum formatType, GLsizei width, GLint alignment, GLint rowLength) const;
GLuint computeDepthPitch(GLenum formatType,
GLsizei width,
GLsizei height,
GLint alignment,
GLint rowLength,
GLint imageHeight) const;
GLuint computeDepthPitch(GLenum formatType, GLsizei width, GLsizei height, GLint alignment, GLint rowLength) const;
GLuint computeBlockSize(GLenum formatType, GLsizei width, GLsizei height) const;
GLuint computeSkipPixels(GLint rowPitch,
GLint depthPitch,
GLint skipImages,
GLint skipRows,
GLint skipPixels) const;
};
const InternalFormat &GetInternalFormatInfo(GLenum internalFormat);
......
......@@ -250,15 +250,17 @@ gl::Error FramebufferD3D::readPixels(const gl::State &state, const gl::Rectangle
{
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, packState.alignment, packState.rowLength);
GLsizei outputSkipBytes = sizedFormatInfo.computeSkipPixels(
outputPitch, 0, 0, packState.skipRows, packState.skipPixels);
GLuint outputPitch = sizedFormatInfo.computeRowPitch(type, area.width, packState.alignment, 0);
return readPixelsImpl(area, format, type, outputPitch, packState,
reinterpret_cast<uint8_t *>(pixels) + outputSkipBytes);
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,
......
......@@ -91,12 +91,8 @@ class FramebufferD3D : public FramebufferImpl
private:
virtual gl::Error clear(const gl::State &state, const ClearParameters &clearParams) = 0;
virtual gl::Error readPixelsImpl(const gl::Rectangle &area,
GLenum format,
GLenum type,
size_t outputPitch,
const gl::PixelPackState &pack,
uint8_t *pixels) const = 0;
virtual gl::Error readPixels(const gl::Rectangle &area, GLenum format, GLenum type, size_t outputPitch,
const gl::PixelPackState &pack, uint8_t *pixels) const = 0;
virtual gl::Error blit(const gl::Rectangle &sourceArea, const gl::Rectangle &destArea, const gl::Rectangle *scissor,
bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter,
......
......@@ -165,6 +165,14 @@ gl::Error TextureD3D::setImageImpl(const gl::ImageIndex &index,
const uint8_t *pixels,
ptrdiff_t layerOffset)
{
if (unpack.skipRows != 0 || unpack.skipPixels != 0 || unpack.imageHeight != 0 || unpack.skipImages != 0)
{
// TODO(jmadill): additional unpack parameters
// return no error here to work around dEQP-GLES3 failing to state reset.
UNIMPLEMENTED();
return gl::Error(GL_NO_ERROR);
}
ImageD3D *image = getImage(index);
ASSERT(image);
......@@ -250,6 +258,12 @@ gl::Error TextureD3D::setCompressedImageImpl(const gl::ImageIndex &index,
const uint8_t *pixels,
ptrdiff_t layerOffset)
{
if (unpack.skipRows != 0 || unpack.skipPixels != 0 || unpack.imageHeight != 0 || unpack.skipImages != 0)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION, "unimplemented pixel store state");
}
// We no longer need the "GLenum format" parameter to TexImage to determine what data format "pixels" contains.
// From our image internal format we know how many channels to expect, and "type" gives the format of pixel's components.
const uint8_t *pixelData = NULL;
......@@ -281,6 +295,12 @@ gl::Error TextureD3D::subImageCompressed(const gl::ImageIndex &index, const gl::
const gl::PixelUnpackState &unpack, const uint8_t *pixels,
ptrdiff_t layerOffset)
{
if (unpack.skipRows != 0 || unpack.skipPixels != 0 || unpack.imageHeight != 0 || unpack.skipImages != 0)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION, "unimplemented pixel store state");
}
const uint8_t *pixelData = NULL;
gl::Error error = GetUnpackPointer(unpack, pixels, layerOffset, &pixelData);
if (error.isError())
......@@ -313,15 +333,6 @@ bool TextureD3D::isFastUnpackable(const gl::PixelUnpackState &unpack, GLenum siz
gl::Error TextureD3D::fastUnpackPixels(const gl::PixelUnpackState &unpack, const uint8_t *pixels, const gl::Box &destArea,
GLenum sizedInternalFormat, GLenum type, RenderTargetD3D *destRenderTarget)
{
if (unpack.skipRows != 0 || unpack.skipPixels != 0 || unpack.imageHeight != 0 ||
unpack.skipImages != 0)
{
// TODO(jmadill): additional unpack parameters
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION,
"Unimplemented pixel store parameters in fastUnpackPixels");
}
// No-op
if (destArea.width <= 0 && destArea.height <= 0 && destArea.depth <= 0)
{
......@@ -754,6 +765,12 @@ gl::Error TextureD3D_2D::setSubImage(GLenum target,
{
ASSERT(target == GL_TEXTURE_2D && area.depth == 1 && area.z == 0);
if (unpack.skipRows != 0 || unpack.skipPixels != 0 || unpack.imageHeight != 0 || unpack.skipImages != 0)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION, "unimplemented pixel store state");
}
GLint level = static_cast<GLint>(imageLevel);
gl::ImageIndex index = gl::ImageIndex::Make2D(level);
if (isFastUnpackable(unpack, getInternalFormat(level)) && isLevelComplete(level))
......@@ -2546,8 +2563,7 @@ gl::Error TextureD3D_2DArray::setImage(GLenum target,
redefineImage(level, sizedInternalFormat, size);
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(sizedInternalFormat);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(
type, size.width, size.height, unpack.alignment, unpack.rowLength, unpack.imageHeight);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(type, size.width, size.height, unpack.alignment, unpack.rowLength);
for (int i = 0; i < size.depth; i++)
{
......@@ -2574,8 +2590,7 @@ gl::Error TextureD3D_2DArray::setSubImage(GLenum target,
ASSERT(target == GL_TEXTURE_2D_ARRAY);
GLint level = static_cast<GLint>(imageLevel);
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(getInternalFormat(level));
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(
type, area.width, area.height, unpack.alignment, unpack.rowLength, unpack.imageHeight);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(type, area.width, area.height, unpack.alignment, unpack.rowLength);
for (int i = 0; i < area.depth; i++)
{
......@@ -2610,8 +2625,7 @@ gl::Error TextureD3D_2DArray::setCompressedImage(GLenum target,
redefineImage(level, internalFormat, size);
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(internalFormat);
GLsizei inputDepthPitch =
formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, size.width, size.height, 1, 0, 0);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, size.width, size.height, 1, 0);
for (int i = 0; i < size.depth; i++)
{
......@@ -2634,8 +2648,7 @@ gl::Error TextureD3D_2DArray::setCompressedSubImage(GLenum target, size_t level,
ASSERT(target == GL_TEXTURE_2D_ARRAY);
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(format);
GLsizei inputDepthPitch =
formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, area.width, area.height, 1, 0, 0);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, area.width, area.height, 1, 0);
for (int i = 0; i < area.depth; i++)
{
......
......@@ -289,12 +289,7 @@ gl::Error Framebuffer11::invalidateSub(size_t, const GLenum *, const gl::Rectang
return gl::Error(GL_NO_ERROR);
}
gl::Error Framebuffer11::readPixelsImpl(const gl::Rectangle &area,
GLenum format,
GLenum type,
size_t outputPitch,
const gl::PixelPackState &pack,
uint8_t *pixels) const
gl::Error Framebuffer11::readPixels(const gl::Rectangle &area, GLenum format, GLenum type, size_t outputPitch, const gl::PixelPackState &pack, uint8_t *pixels) const
{
ID3D11Texture2D *colorBufferTexture = nullptr;
unsigned int subresourceIndex = 0;
......@@ -311,13 +306,6 @@ gl::Error Framebuffer11::readPixelsImpl(const gl::Rectangle &area,
gl::Buffer *packBuffer = pack.pixelBuffer.get();
if (packBuffer != nullptr)
{
if (pack.rowLength != 0 || pack.skipRows != 0 || pack.skipPixels != 0)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION,
"Unimplemented pixel store parameters in readPixelsImpl");
}
Buffer11 *packBufferStorage = GetImplAs<Buffer11>(packBuffer);
PackPixelsParams packParams(area, format, type, static_cast<GLuint>(outputPitch), pack,
reinterpret_cast<ptrdiff_t>(pixels));
......
......@@ -31,12 +31,8 @@ class Framebuffer11 : public FramebufferD3D
private:
gl::Error clear(const gl::State &state, const ClearParameters &clearParams) override;
gl::Error readPixelsImpl(const gl::Rectangle &area,
GLenum format,
GLenum type,
size_t outputPitch,
const gl::PixelPackState &pack,
uint8_t *pixels) const override;
gl::Error readPixels(const gl::Rectangle &area, GLenum format, GLenum type, size_t outputPitch,
const gl::PixelPackState &pack, uint8_t *pixels) const override;
gl::Error blit(const gl::Rectangle &sourceArea, const gl::Rectangle &destArea, const gl::Rectangle *scissor,
bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter,
......
......@@ -247,10 +247,7 @@ gl::Error Image11::loadData(const gl::Box &area, const gl::PixelUnpackState &unp
{
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(mInternalFormat);
GLsizei inputRowPitch = formatInfo.computeRowPitch(type, area.width, unpack.alignment, unpack.rowLength);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(
type, area.width, area.height, unpack.alignment, unpack.rowLength, unpack.imageHeight);
GLsizei inputSkipBytes = formatInfo.computeSkipPixels(
inputRowPitch, inputDepthPitch, unpack.skipImages, unpack.skipRows, unpack.skipPixels);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(type, area.width, area.height, unpack.alignment, unpack.rowLength);
const d3d11::DXGIFormat &dxgiFormatInfo = d3d11::GetDXGIFormatInfo(mDXGIFormat);
GLuint outputPixelSize = dxgiFormatInfo.pixelBytes;
......@@ -267,8 +264,8 @@ gl::Error Image11::loadData(const gl::Box &area, const gl::PixelUnpackState &unp
uint8_t *offsetMappedData = (reinterpret_cast<uint8_t*>(mappedImage.pData) + (area.y * mappedImage.RowPitch + area.x * outputPixelSize + area.z * mappedImage.DepthPitch));
loadFunction(area.width, area.height, area.depth,
reinterpret_cast<const uint8_t *>(input) + inputSkipBytes, inputRowPitch,
inputDepthPitch, offsetMappedData, mappedImage.RowPitch, mappedImage.DepthPitch);
reinterpret_cast<const uint8_t*>(input), inputRowPitch, inputDepthPitch,
offsetMappedData, mappedImage.RowPitch, mappedImage.DepthPitch);
unmap();
......@@ -279,8 +276,7 @@ gl::Error Image11::loadCompressedData(const gl::Box &area, const void *input)
{
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(mInternalFormat);
GLsizei inputRowPitch = formatInfo.computeRowPitch(GL_UNSIGNED_BYTE, area.width, 1, 0);
GLsizei inputDepthPitch =
formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, area.width, area.height, 1, 0, 0);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, area.width, area.height, 1, 0);
const d3d11::DXGIFormat &dxgiFormatInfo = d3d11::GetDXGIFormatInfo(mDXGIFormat);
GLuint outputPixelSize = dxgiFormatInfo.pixelBytes;
......
......@@ -649,10 +649,7 @@ gl::Error TextureStorage11::setData(const gl::ImageIndex &index, ImageD3D *image
int height = destBox ? destBox->height : static_cast<int>(image->getHeight());
int depth = destBox ? destBox->depth : static_cast<int>(image->getDepth());
UINT srcRowPitch = internalFormatInfo.computeRowPitch(type, width, unpack.alignment, unpack.rowLength);
UINT srcDepthPitch = internalFormatInfo.computeDepthPitch(type, width, height, unpack.alignment,
unpack.rowLength, unpack.imageHeight);
GLsizei srcSkipBytes = internalFormatInfo.computeSkipPixels(
srcRowPitch, srcDepthPitch, unpack.skipImages, unpack.skipRows, unpack.skipPixels);
UINT srcDepthPitch = internalFormatInfo.computeDepthPitch(type, width, height, unpack.alignment, unpack.rowLength);
const d3d11::TextureFormat &d3d11Format = d3d11::GetTextureFormatInfo(image->getInternalFormat(), mRenderer->getRenderer11DeviceCaps());
const d3d11::DXGIFormat &dxgiFormatInfo = d3d11::GetDXGIFormatInfo(d3d11Format.texFormat);
......@@ -672,7 +669,8 @@ gl::Error TextureStorage11::setData(const gl::ImageIndex &index, ImageD3D *image
// TODO: fast path
LoadImageFunction loadFunction = d3d11Format.loadFunctions.at(type);
loadFunction(width, height, depth, pixelData + srcSkipBytes, srcRowPitch, srcDepthPitch,
loadFunction(width, height, depth,
pixelData, srcRowPitch, srcDepthPitch,
conversionBuffer->data(), bufferRowPitch, bufferDepthPitch);
ID3D11DeviceContext *immediateContext = mRenderer->getDeviceContext();
......
......@@ -1213,8 +1213,6 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
extensions->fboRenderMipmap = false;
extensions->debugMarker = true;
extensions->eglImage = true;
extensions->unpackSubimage = true;
extensions->packSubimage = true;
// D3D11 Feature Level 10_0+ uses SV_IsFrontFace in HLSL to emulate gl_FrontFacing.
// D3D11 Feature Level 9_3 doesn't support SV_IsFrontFace, and has no equivalent, so can't support gl_FrontFacing.
......
......@@ -73,12 +73,7 @@ gl::Error Framebuffer9::clear(const gl::State &state, const ClearParameters &cle
return mRenderer->clear(clearParams, colorAttachment, depthStencilAttachment);
}
gl::Error Framebuffer9::readPixelsImpl(const gl::Rectangle &area,
GLenum format,
GLenum type,
size_t outputPitch,
const gl::PixelPackState &pack,
uint8_t *pixels) const
gl::Error Framebuffer9::readPixels(const gl::Rectangle &area, GLenum format, GLenum type, size_t outputPitch, const gl::PixelPackState &pack, uint8_t *pixels) const
{
ASSERT(pack.pixelBuffer.get() == nullptr);
......
......@@ -28,12 +28,8 @@ class Framebuffer9 : public FramebufferD3D
private:
gl::Error clear(const gl::State &state, const ClearParameters &clearParams) override;
gl::Error readPixelsImpl(const gl::Rectangle &area,
GLenum format,
GLenum type,
size_t outputPitch,
const gl::PixelPackState &pack,
uint8_t *pixels) const override;
gl::Error readPixels(const gl::Rectangle &area, GLenum format, GLenum type, size_t outputPitch,
const gl::PixelPackState &pack, uint8_t *pixels) const override;
gl::Error blit(const gl::Rectangle &sourceArea, const gl::Rectangle &destArea, const gl::Rectangle *scissor,
bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter,
......
......@@ -480,8 +480,6 @@ gl::Error Image9::loadData(const gl::Box &area, const gl::PixelUnpackState &unpa
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(mInternalFormat);
GLsizei inputRowPitch = formatInfo.computeRowPitch(type, area.width, unpack.alignment, unpack.rowLength);
GLsizei inputSkipBytes = formatInfo.computeSkipPixels(inputRowPitch, 0, unpack.skipImages,
unpack.skipRows, unpack.skipPixels);
const d3d9::TextureFormat &d3dFormatInfo = d3d9::GetTextureFormatInfo(mInternalFormat);
ASSERT(d3dFormatInfo.loadFunction != NULL);
......@@ -500,9 +498,8 @@ gl::Error Image9::loadData(const gl::Box &area, const gl::PixelUnpackState &unpa
}
d3dFormatInfo.loadFunction(area.width, area.height, area.depth,
reinterpret_cast<const uint8_t *>(input) + inputSkipBytes,
inputRowPitch, 0, reinterpret_cast<uint8_t *>(locked.pBits),
locked.Pitch, 0);
reinterpret_cast<const uint8_t*>(input), inputRowPitch, 0,
reinterpret_cast<uint8_t*>(locked.pBits), locked.Pitch, 0);
unlock();
......@@ -516,8 +513,7 @@ gl::Error Image9::loadCompressedData(const gl::Box &area, const void *input)
const gl::InternalFormat &formatInfo = gl::GetInternalFormatInfo(mInternalFormat);
GLsizei inputRowPitch = formatInfo.computeRowPitch(GL_UNSIGNED_BYTE, area.width, 1, 0);
GLsizei inputDepthPitch =
formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, area.width, area.height, 1, 0, 0);
GLsizei inputDepthPitch = formatInfo.computeDepthPitch(GL_UNSIGNED_BYTE, area.width, area.height, 1, 0);
const d3d9::TextureFormat &d3d9FormatInfo = d3d9::GetTextureFormatInfo(mInternalFormat);
......
......@@ -574,8 +574,6 @@ void GenerateCaps(IDirect3D9 *d3d9,
extensions->colorBufferFloat = false;
extensions->debugMarker = true;
extensions->eglImage = true;
extensions->unpackSubimage = true;
extensions->packSubimage = true;
// D3D9 has no concept of separate masks and refs for front and back faces in the depth stencil
// state.
......
......@@ -1353,22 +1353,6 @@ void StateManagerGL::syncState(const gl::State &state, const gl::State::DirtyBit
// TODO(jmadill): split this
setPixelUnpackState(state.getUnpackState());
break;
case gl::State::DIRTY_BIT_UNPACK_IMAGE_HEIGHT:
// TODO(jmadill): split this
setPixelUnpackState(state.getUnpackState());
break;
case gl::State::DIRTY_BIT_UNPACK_SKIP_IMAGES:
// TODO(jmadill): split this
setPixelUnpackState(state.getUnpackState());
break;
case gl::State::DIRTY_BIT_UNPACK_SKIP_ROWS:
// TODO(jmadill): split this
setPixelUnpackState(state.getUnpackState());
break;
case gl::State::DIRTY_BIT_UNPACK_SKIP_PIXELS:
// TODO(jmadill): split this
setPixelUnpackState(state.getUnpackState());
break;
case gl::State::DIRTY_BIT_PACK_ALIGNMENT:
// TODO(jmadill): split this
setPixelPackState(state.getPackState());
......@@ -1377,18 +1361,6 @@ void StateManagerGL::syncState(const gl::State &state, const gl::State::DirtyBit
// TODO(jmadill): split this
setPixelPackState(state.getPackState());
break;
case gl::State::DIRTY_BIT_PACK_ROW_LENGTH:
// TODO(jmadill): split this
setPixelPackState(state.getPackState());
break;
case gl::State::DIRTY_BIT_PACK_SKIP_ROWS:
// TODO(jmadill): split this
setPixelPackState(state.getPackState());
break;
case gl::State::DIRTY_BIT_PACK_SKIP_PIXELS:
// TODO(jmadill): split this
setPixelPackState(state.getPackState());
break;
case gl::State::DIRTY_BIT_DITHER_ENABLED:
// TODO(jmadill): implement this
break;
......
......@@ -1064,9 +1064,7 @@ bool ValidateReadPixelsParameters(gl::Context *context, GLint x, GLint y, GLsize
GLenum sizedInternalFormat = GetSizedInternalFormat(format, type);
const InternalFormat &sizedFormatInfo = GetInternalFormatInfo(sizedInternalFormat);
GLsizei outputPitch =
sizedFormatInfo.computeRowPitch(type, width, context->getState().getPackAlignment(),
context->getState().getPackRowLength());
GLsizei outputPitch = sizedFormatInfo.computeRowPitch(type, width, context->getState().getPackAlignment(), 0);
// sized query sanity check
if (bufSize)
{
......
......@@ -3148,37 +3148,37 @@ void GL_APIENTRY PixelStorei(GLenum pname, GLint param)
case GL_UNPACK_IMAGE_HEIGHT:
ASSERT(context->getClientVersion() >= 3);
state.setUnpackImageHeight(param);
state.getUnpackState().imageHeight = param;
break;
case GL_UNPACK_SKIP_IMAGES:
ASSERT(context->getClientVersion() >= 3);
state.setUnpackSkipImages(param);
ASSERT(context->getClientVersion() >= 3);
state.getUnpackState().skipImages = param;
break;
case GL_UNPACK_SKIP_ROWS:
ASSERT((context->getClientVersion() >= 3) || context->getExtensions().unpackSubimage);
state.setUnpackSkipRows(param);
state.getUnpackState().skipRows = param;
break;
case GL_UNPACK_SKIP_PIXELS:
ASSERT((context->getClientVersion() >= 3) || context->getExtensions().unpackSubimage);
state.setUnpackSkipPixels(param);
state.getUnpackState().skipPixels = param;
break;
case GL_PACK_ROW_LENGTH:
ASSERT((context->getClientVersion() >= 3) || context->getExtensions().packSubimage);
state.setPackRowLength(param);
state.getPackState().rowLength = param;
break;
case GL_PACK_SKIP_ROWS:
ASSERT((context->getClientVersion() >= 3) || context->getExtensions().packSubimage);
state.setPackSkipRows(param);
state.getPackState().skipRows = param;
break;
case GL_PACK_SKIP_PIXELS:
ASSERT((context->getClientVersion() >= 3) || context->getExtensions().packSubimage);
state.setPackSkipPixels(param);
state.getPackState().skipPixels = param;
break;
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