Commit 96ba0f12 by Jamie Madill Committed by Commit Bot

Vulkan: Move readPixels logic to ImageHelper.

This logic will be shared with ANGLE_get_image. Cleans up some of the graph access logic so it can work easily with TextureVk/RenderbufferVk. Bug: angleproject:3944 Change-Id: If069528f27b2c291d52de892c707562875b95227 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1879962 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 6f23b4b7
......@@ -192,7 +192,7 @@ class ContextImpl : public GLImplFactory
virtual angle::Result memoryBarrierByRegion(const gl::Context *context,
GLbitfield barriers) = 0;
const gl::State &getState() { return mState; }
const gl::State &getState() const { return mState; }
int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
int getClientMinorVersion() const { return mState.getClientMinorVersion(); }
const gl::Caps &getCaps() const { return mState.getCaps(); }
......
......@@ -891,6 +891,23 @@ class ImageHelper final : public CommandGraphResource
VkDeviceSize *bufferOffsetOut,
uint8_t **outDataPtr);
static angle::Result GetReadPixelsParams(ContextVk *contextVk,
GLenum format,
GLenum type,
const gl::Rectangle &area,
const gl::Rectangle &clippedArea,
PackPixelsParams *paramsOut,
GLuint *skipBytesOut);
angle::Result readPixels(ContextVk *contextVk,
const gl::Rectangle &area,
const PackPixelsParams &packPixelsParams,
VkImageAspectFlagBits copyAspectFlags,
uint32_t level,
uint32_t layer,
void *pixels,
DynamicBuffer *stagingBuffer);
private:
void forceChangeLayoutAndQueue(VkImageAspectFlags aspectMask,
ImageLayout newLayout,
......
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