// // Copyright 2014 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. //
// FramebufferAttachment.h: Defines the wrapper class gl::FramebufferAttachment, as well as the // objects and related functionality. [OpenGL ES 2.0.24] section 4.4.3 page 108.
class FramebufferAttachmentObjectImpl;
} // namespace rx
namespace gl
{ class FramebufferAttachmentObject; class Renderbuffer; class Texture;
// FramebufferAttachment implements a GL framebuffer attachment. // Attachments are "light" containers, which store pointers to ref-counted GL objects. // We support GL texture (2D/3D/Cube/2D array) and renderbuffer object attachments. // Note: Our old naming scheme used the term "Renderbuffer" for both GL renderbuffers and for // framebuffer attachments, which confused their usage.
class FramebufferAttachment final
{ public:
FramebufferAttachment();
// The size of the underlying resource the attachment points to. The 'depth' value will // correspond to a 3D texture depth or the layer count of a 2D array texture. For Surfaces and // Renderbuffers, it will always be 1.
Extents getSize() const;
Format getFormat() const;
GLsizei getSamples() const; // This will always return the actual sample count of the attachment even if // render_to_texture extension is active on this FBattachment object.
GLsizei getResourceSamples() const;
GLenum type() const { return mType; } bool isAttached() const { return mType != GL_NONE; } bool isRenderable(const Context *context) const; bool isYUV() const; bool isCreatedWithAHB() const;
// A framebuffer attachment points to one of three types of resources: Renderbuffers, // Textures and egl::Surface. The "Target" struct indicates which part of the // object an attachment references. For the three types: // - a Renderbuffer has a unique renderable target, and needs no target index // - a Texture has targets for every image and uses an ImageIndex // - a Surface has targets for Color and Depth/Stencil, and uses the attachment binding class Target
{ public:
Target();
Target(GLenum binding, const ImageIndex &imageIndex);
Target(const Target &other);
Target &operator=(const Target &other);
GLenum mType;
Target mTarget;
FramebufferAttachmentObject *mResource;
GLsizei mNumViews; bool mIsMultiview;
GLint mBaseViewIndex; // A single-sampled texture can be attached to a framebuffer either as single-sampled or as // multisampled-render-to-texture. In the latter case, |mRenderToTextureSamples| will contain // the number of samples. For renderbuffers, the number of samples is inherited from the // renderbuffer itself. // // Note that textures cannot change storage between single and multisample once attached to a // framebuffer. Renderbuffers instead can, and caching the number of renderbuffer samples here // can lead to stale data.
GLsizei mRenderToTextureSamples;
};
// A base class for objects that FBO Attachments may point to. class FramebufferAttachmentObject : public angle::Subject, public angle::ObserverInterface
{ public:
FramebufferAttachmentObject();
~FramebufferAttachmentObject() override;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.