#include "libANGLE/renderer/gl/BlitGL.h"
#include "common/FixedVector.h"
#include "common/utilities.h"
#include "common/vector_utils.h"
#include "image_util/copyimage.h"
#include "libANGLE/Context.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/Format.h"
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/RenderbufferGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/formatutilsgl.h"
#include "libANGLE/renderer/gl/renderergl_utils.h"
#include "libANGLE/renderer/renderer_utils.h"
#include "platform/autogen/FeaturesGL_autogen.h"
Vector2;
namespace rx
{
namespace
{
angle::Result CheckCompileStatus(const gl::Context *context,
const rx::FunctionsGL *functions,
GLuint shader)
{ … }
angle::Result CheckLinkStatus(const gl::Context *context,
const rx::FunctionsGL *functions,
GLuint program)
{ … }
class [[nodiscard]] ScopedGLState : angle::NonCopyable
{ … };
angle::Result SetClearState(StateManagerGL *stateManager,
bool colorClear,
bool depthClear,
bool stencilClear,
GLbitfield *outClearMask)
{ … }
ClearBindTargetVector;
angle::Result PrepareForClear(StateManagerGL *stateManager,
GLenum sizedInternalFormat,
ClearBindTargetVector *outBindtargets,
ClearBindTargetVector *outUnbindTargets,
GLbitfield *outClearMask)
{ … }
angle::Result UnbindAttachment(const gl::Context *context,
const FunctionsGL *functions,
GLenum framebufferTarget,
GLenum attachment)
{ … }
angle::Result UnbindAttachments(const gl::Context *context,
const FunctionsGL *functions,
GLenum framebufferTarget,
const ClearBindTargetVector &bindTargets)
{ … }
angle::Result CheckIfAttachmentNeedsClearing(const gl::Context *context,
const gl::FramebufferAttachment *attachment,
bool *needsClearInit)
{ … }
}
BlitGL::BlitGL(const FunctionsGL *functions,
const angle::FeaturesGL &features,
StateManagerGL *stateManager)
: … { … }
BlitGL::~BlitGL()
{ … }
angle::Result BlitGL::copyImageToLUMAWorkaroundTexture(const gl::Context *context,
GLuint texture,
gl::TextureType textureType,
gl::TextureTarget target,
GLenum lumaFormat,
size_t level,
const gl::Rectangle &sourceArea,
GLenum internalFormat,
gl::Framebuffer *source)
{ … }
angle::Result BlitGL::copySubImageToLUMAWorkaroundTexture(const gl::Context *context,
GLuint texture,
gl::TextureType textureType,
gl::TextureTarget target,
GLenum lumaFormat,
size_t level,
const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
gl::Framebuffer *source)
{ … }
angle::Result BlitGL::blitColorBufferWithShader(const gl::Context *context,
const gl::Framebuffer *source,
const GLuint destTexture,
const gl::TextureTarget destTarget,
const size_t destLevel,
const gl::Rectangle &sourceAreaIn,
const gl::Rectangle &destAreaIn,
GLenum filter,
bool writeAlpha)
{ … }
angle::Result BlitGL::blitColorBufferWithShader(const gl::Context *context,
const gl::Framebuffer *source,
const gl::Framebuffer *dest,
const gl::Rectangle &sourceAreaIn,
const gl::Rectangle &destAreaIn,
GLenum filter,
bool writeAlpha)
{ … }
angle::Result BlitGL::blitColorBufferWithShader(const gl::Context *context,
const gl::Framebuffer *source,
const GLuint destFramebuffer,
const gl::Rectangle &sourceAreaIn,
const gl::Rectangle &destAreaIn,
GLenum filter,
bool writeAlpha)
{ … }
angle::Result BlitGL::copySubTexture(const gl::Context *context,
TextureGL *source,
size_t sourceLevel,
GLenum sourceComponentType,
GLuint destID,
gl::TextureTarget destTarget,
size_t destLevel,
GLenum destComponentType,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
bool needsLumaWorkaround,
GLenum lumaFormat,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
bool transformLinearToSrgb,
bool *copySucceededOut)
{ … }
angle::Result BlitGL::copySubTextureCPUReadback(const gl::Context *context,
TextureGL *source,
size_t sourceLevel,
GLenum sourceSizedInternalFormat,
TextureGL *dest,
gl::TextureTarget destTarget,
size_t destLevel,
GLenum destFormat,
GLenum destType,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
bool needsLumaWorkaround,
GLenum lumaFormat,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha)
{ … }
angle::Result BlitGL::copyTexSubImage(const gl::Context *context,
TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
gl::TextureTarget destTarget,
size_t destLevel,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
bool *copySucceededOut)
{ … }
angle::Result BlitGL::clearRenderableTexture(const gl::Context *context,
TextureGL *source,
GLenum sizedInternalFormat,
int numTextureLayers,
const gl::ImageIndex &imageIndex,
bool *clearSucceededOut)
{ … }
angle::Result BlitGL::clearRenderbuffer(const gl::Context *context,
RenderbufferGL *source,
GLenum sizedInternalFormat)
{ … }
angle::Result BlitGL::clearFramebuffer(const gl::Context *context,
const gl::DrawBufferMask &colorAttachments,
bool depthClear,
bool stencilClear,
FramebufferGL *source)
{ … }
angle::Result BlitGL::clearRenderableTextureAlphaToOne(const gl::Context *context,
GLuint texture,
gl::TextureTarget target,
size_t level)
{ … }
angle::Result BlitGL::generateMipmap(const gl::Context *context,
TextureGL *source,
GLuint baseLevel,
GLuint levelCount,
const gl::Extents &sourceBaseLevelSize,
const nativegl::TexImageFormat &format)
{ … }
angle::Result BlitGL::generateSRGBMipmap(const gl::Context *context,
TextureGL *source,
GLuint baseLevel,
GLuint levelCount,
const gl::Extents &sourceBaseLevelSize)
{ … }
angle::Result BlitGL::initializeResources(const gl::Context *context)
{ … }
angle::Result BlitGL::orphanScratchTextures(const gl::Context *context)
{ … }
angle::Result BlitGL::setScratchTextureParameter(const gl::Context *context,
GLenum param,
GLenum value)
{ … }
angle::Result BlitGL::setVAOState(const gl::Context *context)
{ … }
angle::Result BlitGL::initializeVAOState(const gl::Context *context)
{ … }
angle::Result BlitGL::getBlitProgram(const gl::Context *context,
gl::TextureType sourceTextureType,
GLenum sourceComponentType,
GLenum destComponentType,
BlitProgram **program)
{ … }
}