Hash :
900c7e87
Author :
Date :
2020-07-07T14:20:36
Serialize d/s buffers + use color buffers' impl format for readPixels Adds serialization of depth/stencil buffer contents Currently, readPixels on color buffers uses the gles front-end format, which can be different from the implementation format used in the backend. This can cause seg fault crashes when the number of bytes in a pixel differs between the two format. Changes so that readPixels for color buffers always use the backend format. Bug: angleproject:4817 Change-Id: I62d5deb1320ea38ee46143b2aa97f372ba01baeb Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2284451 Reviewed-by: Cody Northrop <cnorthrop@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Commit-Queue: Manh Nguyen <nguyenmh@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
//
// Copyright 2020 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// frame_capture_utils.h:
// ANGLE frame capture utils interface.
//
#ifndef FRAME_CAPTURE_UTILS_H_
#define FRAME_CAPTURE_UTILS_H_
#include <vector>
#include "libANGLE/Error.h"
namespace gl
{
class BinaryOutputStream;
class Context;
class Framebuffer;
class FramebufferAttachment;
class FramebufferState;
class ImageIndex;
} // namespace gl
typedef unsigned int GLenum;
namespace angle
{
class MemoryBuffer;
class ScratchBuffer;
Result SerializeContext(gl::BinaryOutputStream *bos, const gl::Context *context);
Result SerializeFramebuffer(const gl::Context *context,
gl::BinaryOutputStream *bos,
gl::Framebuffer *framebuffer);
Result SerializeFramebufferState(const gl::Context *context,
gl::BinaryOutputStream *bos,
gl::Framebuffer *framebuffer,
const gl::FramebufferState &framebufferState);
Result SerializeFramebufferAttachment(const gl::Context *context,
gl::BinaryOutputStream *bos,
ScratchBuffer *scratchBuffer,
gl::Framebuffer *framebuffer,
const gl::FramebufferAttachment &framebufferAttachment);
void SerializeImageIndex(gl::BinaryOutputStream *bos, const gl::ImageIndex &imageIndex);
} // namespace angle
#endif // FRAME_CAPTURE_UTILS_H_