Commit 8cf813c7 by Jamie Madill

Query attachment render targets from Impl class.

*re-land with fix for D3D9* This allows us to eradicate the GetAttachmentRenderTarget methods. This improves potential performance, at the cost of exposing a Renderer-specific function at the API object level. BUG=angleproject:963 Change-Id: Iee9f985ddaed668df0c622228004b348eb4d2ea8 Reviewed-on: https://chromium-review.googlesource.com/269006Tested-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent deaee8ba
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "angle_gl.h" #include "angle_gl.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h"
#include "libANGLE/ImageIndex.h" #include "libANGLE/ImageIndex.h"
#include "libANGLE/RefCountObject.h" #include "libANGLE/RefCountObject.h"
...@@ -20,6 +21,20 @@ namespace egl ...@@ -20,6 +21,20 @@ namespace egl
class Surface; class Surface;
} }
namespace rx
{
// An implementation-specific object associated with an attachment.
class FramebufferAttachmentRenderTarget : angle::NonCopyable
{
public:
FramebufferAttachmentRenderTarget() {}
virtual ~FramebufferAttachmentRenderTarget() {}
};
class FramebufferAttachmentObjectImpl;
}
namespace gl namespace gl
{ {
class FramebufferAttachmentObject; class FramebufferAttachmentObject;
...@@ -119,7 +134,20 @@ class FramebufferAttachment final ...@@ -119,7 +134,20 @@ class FramebufferAttachment final
Texture *getTexture() const; Texture *getTexture() const;
const egl::Surface *getSurface() const; const egl::Surface *getSurface() const;
// "T" must be static_castable from FramebufferAttachmentRenderTarget
template <typename T>
gl::Error getRenderTarget(T **rtOut) const
{
// Cast through the pointer-to-pointer type
rx::FramebufferAttachmentRenderTarget *rtPtr = nullptr;
gl::Error error = getRenderTarget(&rtPtr);
*rtOut = static_cast<T*>(rtPtr);
return error;
}
private: private:
gl::Error getRenderTarget(rx::FramebufferAttachmentRenderTarget **rtOut) const;
GLenum mType; GLenum mType;
Target mTarget; Target mTarget;
BindingPointer<FramebufferAttachmentObject> mResource; BindingPointer<FramebufferAttachmentObject> mResource;
...@@ -135,6 +163,12 @@ class FramebufferAttachmentObject : public RefCountObject ...@@ -135,6 +163,12 @@ class FramebufferAttachmentObject : public RefCountObject
virtual GLsizei getAttachmentHeight(const FramebufferAttachment::Target &target) const = 0; virtual GLsizei getAttachmentHeight(const FramebufferAttachment::Target &target) const = 0;
virtual GLenum getAttachmentInternalFormat(const FramebufferAttachment::Target &target) const = 0; virtual GLenum getAttachmentInternalFormat(const FramebufferAttachment::Target &target) const = 0;
virtual GLsizei getAttachmentSamples(const FramebufferAttachment::Target &target) const = 0; virtual GLsizei getAttachmentSamples(const FramebufferAttachment::Target &target) const = 0;
Error getAttachmentRenderTarget(const FramebufferAttachment::Target &target,
rx::FramebufferAttachmentRenderTarget **rtOut) const;
protected:
virtual rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const = 0;
}; };
inline GLsizei FramebufferAttachment::getWidth() const inline GLsizei FramebufferAttachment::getWidth() const
...@@ -157,6 +191,38 @@ inline GLsizei FramebufferAttachment::getSamples() const ...@@ -157,6 +191,38 @@ inline GLsizei FramebufferAttachment::getSamples() const
return mResource->getAttachmentSamples(mTarget); return mResource->getAttachmentSamples(mTarget);
} }
inline gl::Error FramebufferAttachment::getRenderTarget(rx::FramebufferAttachmentRenderTarget **rtOut) const
{
return mResource->getAttachmentRenderTarget(mTarget, rtOut);
}
} // namespace gl
namespace rx
{
class FramebufferAttachmentObjectImpl : angle::NonCopyable
{
public:
FramebufferAttachmentObjectImpl() {}
virtual ~FramebufferAttachmentObjectImpl() {}
virtual gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) = 0;
};
} // namespace rx
namespace gl
{
inline Error FramebufferAttachmentObject::getAttachmentRenderTarget(
const FramebufferAttachment::Target &target,
rx::FramebufferAttachmentRenderTarget **rtOut) const
{
return getAttachmentImpl()->getAttachmentRenderTarget(target, rtOut);
}
} }
#endif // LIBANGLE_FRAMEBUFFERATTACHMENT_H_ #endif // LIBANGLE_FRAMEBUFFERATTACHMENT_H_
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "libANGLE/Texture.h" #include "libANGLE/Texture.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/RenderTargetD3D.h" #include "libANGLE/renderer/d3d/RenderTargetD3D.h"
#include "libANGLE/renderer/RenderbufferImpl.h"
namespace gl namespace gl
{ {
......
...@@ -15,11 +15,7 @@ ...@@ -15,11 +15,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/renderer/RenderbufferImpl.h"
namespace rx
{
class RenderbufferImpl;
}
namespace gl namespace gl
{ {
...@@ -58,6 +54,8 @@ class Renderbuffer : public FramebufferAttachmentObject ...@@ -58,6 +54,8 @@ class Renderbuffer : public FramebufferAttachmentObject
GLsizei getAttachmentSamples(const FramebufferAttachment::Target &/*target*/) const override { return getSamples(); } GLsizei getAttachmentSamples(const FramebufferAttachment::Target &/*target*/) const override { return getSamples(); }
private: private:
rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override { return mRenderbuffer; }
rx::RenderbufferImpl *mRenderbuffer; rx::RenderbufferImpl *mRenderbuffer;
GLsizei mWidth; GLsizei mWidth;
......
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#include "libANGLE/Config.h" #include "libANGLE/Config.h"
#include "libANGLE/Texture.h" #include "libANGLE/Texture.h"
#include "libANGLE/renderer/SurfaceImpl.h"
#include <EGL/eglext.h> #include <EGL/eglext.h>
......
...@@ -16,17 +16,13 @@ ...@@ -16,17 +16,13 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/renderer/SurfaceImpl.h"
namespace gl namespace gl
{ {
class Texture; class Texture;
} }
namespace rx
{
class SurfaceImpl;
}
namespace egl namespace egl
{ {
class AttributeMap; class AttributeMap;
...@@ -76,6 +72,7 @@ class Surface final : public gl::FramebufferAttachmentObject ...@@ -76,6 +72,7 @@ class Surface final : public gl::FramebufferAttachmentObject
private: private:
virtual ~Surface(); virtual ~Surface();
rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override { return mImplementation; }
rx::SurfaceImpl *mImplementation; rx::SurfaceImpl *mImplementation;
......
...@@ -29,6 +29,7 @@ class MockSurfaceImpl : public rx::SurfaceImpl ...@@ -29,6 +29,7 @@ class MockSurfaceImpl : public rx::SurfaceImpl
MOCK_CONST_METHOD0(getWidth, EGLint()); MOCK_CONST_METHOD0(getWidth, EGLint());
MOCK_CONST_METHOD0(getHeight, EGLint()); MOCK_CONST_METHOD0(getHeight, EGLint());
MOCK_CONST_METHOD0(isPostSubBufferSupported, EGLint(void)); MOCK_CONST_METHOD0(isPostSubBufferSupported, EGLint(void));
MOCK_METHOD2(getAttachmentRenderTarget, gl::Error(const gl::FramebufferAttachment::Target &, rx::FramebufferAttachmentRenderTarget **));
MOCK_METHOD0(destroy, void()); MOCK_METHOD0(destroy, void());
}; };
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "libANGLE/Data.h" #include "libANGLE/Data.h"
#include "libANGLE/Surface.h" #include "libANGLE/Surface.h"
#include "libANGLE/formatutils.h" #include "libANGLE/formatutils.h"
#include "libANGLE/renderer/TextureImpl.h"
namespace gl namespace gl
{ {
......
...@@ -19,17 +19,13 @@ ...@@ -19,17 +19,13 @@
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/renderer/TextureImpl.h"
namespace egl namespace egl
{ {
class Surface; class Surface;
} }
namespace rx
{
class TextureImpl;
}
namespace gl namespace gl
{ {
class Framebuffer; class Framebuffer;
...@@ -101,6 +97,7 @@ class Texture final : public FramebufferAttachmentObject ...@@ -101,6 +97,7 @@ class Texture final : public FramebufferAttachmentObject
GLsizei getAttachmentSamples(const FramebufferAttachment::Target &target) const override; GLsizei getAttachmentSamples(const FramebufferAttachment::Target &target) const override;
private: private:
rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const override { return mTexture; }
static unsigned int issueTextureSerial(); static unsigned int issueTextureSerial();
rx::TextureImpl *mTexture; rx::TextureImpl *mTexture;
......
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
#include "angle_gl.h" #include "angle_gl.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h"
namespace rx namespace rx
{ {
class RenderbufferImpl : angle::NonCopyable class RenderbufferImpl : public FramebufferAttachmentObjectImpl
{ {
public: public:
RenderbufferImpl(); RenderbufferImpl();
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h"
namespace egl namespace egl
{ {
...@@ -21,7 +22,7 @@ struct Config; ...@@ -21,7 +22,7 @@ struct Config;
namespace rx namespace rx
{ {
class SurfaceImpl : angle::NonCopyable class SurfaceImpl : public FramebufferAttachmentObjectImpl
{ {
public: public:
SurfaceImpl(); SurfaceImpl();
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "angle_gl.h" #include "angle_gl.h"
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/Error.h" #include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/ImageIndex.h" #include "libANGLE/ImageIndex.h"
namespace egl namespace egl
...@@ -35,7 +36,7 @@ struct SamplerState; ...@@ -35,7 +36,7 @@ struct SamplerState;
namespace rx namespace rx
{ {
class TextureImpl : angle::NonCopyable class TextureImpl : public FramebufferAttachmentObjectImpl
{ {
public: public:
TextureImpl() {} TextureImpl() {}
......
...@@ -226,7 +226,7 @@ GLenum FramebufferD3D::getImplementationColorReadFormat() const ...@@ -226,7 +226,7 @@ GLenum FramebufferD3D::getImplementationColorReadFormat() const
} }
RenderTargetD3D *attachmentRenderTarget = NULL; RenderTargetD3D *attachmentRenderTarget = NULL;
gl::Error error = GetAttachmentRenderTarget(readAttachment, &attachmentRenderTarget); gl::Error error = readAttachment->getRenderTarget(&attachmentRenderTarget);
if (error.isError()) if (error.isError())
{ {
return GL_NONE; return GL_NONE;
...@@ -248,7 +248,7 @@ GLenum FramebufferD3D::getImplementationColorReadType() const ...@@ -248,7 +248,7 @@ GLenum FramebufferD3D::getImplementationColorReadType() const
} }
RenderTargetD3D *attachmentRenderTarget = NULL; RenderTargetD3D *attachmentRenderTarget = NULL;
gl::Error error = GetAttachmentRenderTarget(readAttachment, &attachmentRenderTarget); gl::Error error = readAttachment->getRenderTarget(&attachmentRenderTarget);
if (error.isError()) if (error.isError())
{ {
return GL_NONE; return GL_NONE;
...@@ -376,48 +376,6 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const Wor ...@@ -376,48 +376,6 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const Wor
return mColorAttachmentsForRender; return mColorAttachmentsForRender;
} }
gl::Error GetAttachmentRenderTarget(const gl::FramebufferAttachment *attachment, RenderTargetD3D **outRT)
{
if (attachment->type() == GL_TEXTURE)
{
gl::Texture *texture = attachment->getTexture();
ASSERT(texture);
TextureD3D *textureD3D = GetImplAs<TextureD3D>(texture);
const gl::ImageIndex &index = attachment->getTextureImageIndex();
return textureD3D->getRenderTarget(index, outRT);
}
else if (attachment->type() == GL_RENDERBUFFER)
{
gl::Renderbuffer *renderbuffer = attachment->getRenderbuffer();
ASSERT(renderbuffer);
RenderbufferD3D *renderbufferD3D = GetImplAs<RenderbufferD3D>(renderbuffer);
*outRT = renderbufferD3D->getRenderTarget();
return gl::Error(GL_NO_ERROR);
}
else if (attachment->type() == GL_FRAMEBUFFER_DEFAULT)
{
const egl::Surface *surface = attachment->getSurface();
ASSERT(surface);
const SurfaceD3D *surfaceD3D = GetImplAs<SurfaceD3D>(surface);
ASSERT(surfaceD3D);
if (attachment->getBinding() == GL_BACK)
{
*outRT = surfaceD3D->getSwapChain()->getColorRenderTarget();
}
else
{
*outRT = surfaceD3D->getSwapChain()->getDepthStencilRenderTarget();
}
return gl::Error(GL_NO_ERROR);
}
else
{
UNREACHABLE();
return gl::Error(GL_INVALID_OPERATION);
}
}
// Note: RenderTarget serials should ideally be in the RenderTargets themselves. // Note: RenderTarget serials should ideally be in the RenderTargets themselves.
unsigned int GetAttachmentSerial(const gl::FramebufferAttachment *attachment) unsigned int GetAttachmentSerial(const gl::FramebufferAttachment *attachment)
{ {
......
...@@ -106,7 +106,6 @@ class FramebufferD3D : public FramebufferImpl ...@@ -106,7 +106,6 @@ class FramebufferD3D : public FramebufferImpl
virtual GLenum getRenderTargetImplementationFormat(RenderTargetD3D *renderTarget) const = 0; virtual GLenum getRenderTargetImplementationFormat(RenderTargetD3D *renderTarget) const = 0;
}; };
gl::Error GetAttachmentRenderTarget(const gl::FramebufferAttachment *attachment, RenderTargetD3D **outRT);
unsigned int GetAttachmentSerial(const gl::FramebufferAttachment *attachment); unsigned int GetAttachmentSerial(const gl::FramebufferAttachment *attachment);
} }
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "libANGLE/Framebuffer.h" #include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h" #include "libANGLE/FramebufferAttachment.h"
#include "libANGLE/renderer/d3d/FramebufferD3D.h" #include "libANGLE/renderer/d3d/FramebufferD3D.h"
#include "libANGLE/renderer/d3d/RenderTargetD3D.h"
namespace rx namespace rx
{ {
...@@ -30,11 +31,11 @@ ImageD3D::ImageD3D() ...@@ -30,11 +31,11 @@ ImageD3D::ImageD3D()
gl::Error ImageD3D::copy(const gl::Offset &destOffset, const gl::Rectangle &sourceArea, const gl::Framebuffer *source) gl::Error ImageD3D::copy(const gl::Offset &destOffset, const gl::Rectangle &sourceArea, const gl::Framebuffer *source)
{ {
const gl::FramebufferAttachment *colorbuffer = source->getReadColorbuffer(); const gl::FramebufferAttachment *srcAttachment = source->getReadColorbuffer();
ASSERT(colorbuffer); ASSERT(srcAttachment);
RenderTargetD3D *renderTarget = NULL; RenderTargetD3D *renderTarget = NULL;
gl::Error error = GetAttachmentRenderTarget(colorbuffer, &renderTarget); gl::Error error = srcAttachment->getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -12,11 +12,12 @@ ...@@ -12,11 +12,12 @@
#include "common/angleutils.h" #include "common/angleutils.h"
#include "libANGLE/angletypes.h" #include "libANGLE/angletypes.h"
#include "libANGLE/FramebufferAttachment.h"
namespace rx namespace rx
{ {
class RenderTargetD3D : angle::NonCopyable class RenderTargetD3D : public FramebufferAttachmentRenderTarget
{ {
public: public:
RenderTargetD3D(); RenderTargetD3D();
......
...@@ -75,4 +75,11 @@ unsigned int RenderbufferD3D::getRenderTargetSerial() const ...@@ -75,4 +75,11 @@ unsigned int RenderbufferD3D::getRenderTargetSerial() const
return (mRenderTarget ? mRenderTarget->getSerial() : 0); return (mRenderTarget ? mRenderTarget->getSerial() : 0);
} }
gl::Error RenderbufferD3D::getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut)
{
*rtOut = mRenderTarget;
return gl::Error(GL_NO_ERROR);
}
} }
...@@ -32,6 +32,9 @@ class RenderbufferD3D : public RenderbufferImpl ...@@ -32,6 +32,9 @@ class RenderbufferD3D : public RenderbufferImpl
RenderTargetD3D *getRenderTarget(); RenderTargetD3D *getRenderTarget();
unsigned int getRenderTargetSerial() const; unsigned int getRenderTargetSerial() const;
gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) override;
private: private:
RendererD3D *mRenderer; RendererD3D *mRenderer;
RenderTargetD3D *mRenderTarget; RenderTargetD3D *mRenderTarget;
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "libANGLE/Surface.h" #include "libANGLE/Surface.h"
#include "libANGLE/renderer/d3d/DisplayD3D.h" #include "libANGLE/renderer/d3d/DisplayD3D.h"
#include "libANGLE/renderer/d3d/RendererD3D.h" #include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/renderer/d3d/RenderTargetD3D.h"
#include "libANGLE/renderer/d3d/SwapChainD3D.h" #include "libANGLE/renderer/d3d/SwapChainD3D.h"
#include <tchar.h> #include <tchar.h>
...@@ -360,4 +361,18 @@ egl::Error SurfaceD3D::querySurfacePointerANGLE(EGLint attribute, void **value) ...@@ -360,4 +361,18 @@ egl::Error SurfaceD3D::querySurfacePointerANGLE(EGLint attribute, void **value)
return egl::Error(EGL_SUCCESS); return egl::Error(EGL_SUCCESS);
} }
gl::Error SurfaceD3D::getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut)
{
if (target.binding() == GL_BACK)
{
*rtOut = mSwapChain->getColorRenderTarget();
}
else
{
*rtOut = mSwapChain->getDepthStencilRenderTarget();
}
return gl::Error(GL_NO_ERROR);
}
} }
...@@ -54,6 +54,9 @@ class SurfaceD3D : public SurfaceImpl ...@@ -54,6 +54,9 @@ class SurfaceD3D : public SurfaceImpl
// Returns true if swapchain changed due to resize or interval update // Returns true if swapchain changed due to resize or interval update
bool checkForOutOfDateSwapChain(); bool checkForOutOfDateSwapChain();
gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) override;
private: private:
SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::Config *config, EGLint width, EGLint height, SurfaceD3D(RendererD3D *renderer, egl::Display *display, const egl::Config *config, EGLint width, EGLint height,
EGLint fixedSize, EGLClientBuffer shareHandle, EGLNativeWindowType window); EGLint fixedSize, EGLClientBuffer shareHandle, EGLNativeWindowType window);
......
...@@ -608,6 +608,15 @@ gl::Error TextureD3D::commitRegion(const gl::ImageIndex &index, const gl::Box &r ...@@ -608,6 +608,15 @@ gl::Error TextureD3D::commitRegion(const gl::ImageIndex &index, const gl::Box &r
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
gl::Error TextureD3D::getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut)
{
RenderTargetD3D *rtD3D = nullptr;
gl::Error error = getRenderTarget(target.textureIndex(), &rtD3D);
*rtOut = static_cast<FramebufferAttachmentRenderTarget *>(rtD3D);
return error;
}
TextureD3D_2D::TextureD3D_2D(RendererD3D *renderer) TextureD3D_2D::TextureD3D_2D(RendererD3D *renderer)
: TextureD3D(renderer) : TextureD3D(renderer)
{ {
......
...@@ -64,6 +64,9 @@ class TextureD3D : public TextureImpl ...@@ -64,6 +64,9 @@ class TextureD3D : public TextureImpl
TextureStorage *getStorage(); TextureStorage *getStorage();
ImageD3D *getBaseLevelImage() const; ImageD3D *getBaseLevelImage() const;
gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) override;
protected: protected:
gl::Error setImage(const gl::ImageIndex &index, GLenum type, gl::Error setImage(const gl::ImageIndex &index, GLenum type,
const gl::PixelUnpackState &unpack, const uint8_t *pixels, const gl::PixelUnpackState &unpack, const uint8_t *pixels,
......
...@@ -260,7 +260,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, const gl ...@@ -260,7 +260,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, const gl
drawBufferStates[colorAttachment] != GL_NONE) drawBufferStates[colorAttachment] != GL_NONE)
{ {
RenderTarget11 *renderTarget = NULL; RenderTarget11 *renderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(&attachment, &renderTarget); gl::Error error = attachment.getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -349,7 +349,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, const gl ...@@ -349,7 +349,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams, const gl
ASSERT(attachment != nullptr); ASSERT(attachment != nullptr);
RenderTarget11 *renderTarget = NULL; RenderTarget11 *renderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(attachment, &renderTarget); gl::Error error = attachment->getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -115,7 +115,7 @@ static gl::Error getRenderTargetResource(const gl::FramebufferAttachment *colorb ...@@ -115,7 +115,7 @@ static gl::Error getRenderTargetResource(const gl::FramebufferAttachment *colorb
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget11 *renderTarget = nullptr; RenderTarget11 *renderTarget = nullptr;
gl::Error error = d3d11::GetAttachmentRenderTarget(colorbuffer, &renderTarget); gl::Error error = colorbuffer->getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -189,7 +189,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang ...@@ -189,7 +189,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang
ASSERT(readBuffer); ASSERT(readBuffer);
RenderTargetD3D *readRenderTarget = nullptr; RenderTargetD3D *readRenderTarget = nullptr;
gl::Error error = GetAttachmentRenderTarget(readBuffer, &readRenderTarget); gl::Error error = readBuffer->getRenderTarget(&readRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -207,7 +207,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang ...@@ -207,7 +207,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang
drawBufferStates[colorAttachment] != GL_NONE) drawBufferStates[colorAttachment] != GL_NONE)
{ {
RenderTargetD3D *drawRenderTarget = nullptr; RenderTargetD3D *drawRenderTarget = nullptr;
error = GetAttachmentRenderTarget(&drawBuffer, &drawRenderTarget); error = drawBuffer.getRenderTarget(&drawRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -230,7 +230,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang ...@@ -230,7 +230,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang
ASSERT(readBuffer); ASSERT(readBuffer);
RenderTargetD3D *readRenderTarget = nullptr; RenderTargetD3D *readRenderTarget = nullptr;
gl::Error error = GetAttachmentRenderTarget(readBuffer, &readRenderTarget); gl::Error error = readBuffer->getRenderTarget(&readRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -241,7 +241,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang ...@@ -241,7 +241,7 @@ gl::Error Framebuffer11::blit(const gl::Rectangle &sourceArea, const gl::Rectang
ASSERT(drawBuffer); ASSERT(drawBuffer);
RenderTargetD3D *drawRenderTarget = nullptr; RenderTargetD3D *drawRenderTarget = nullptr;
error = GetAttachmentRenderTarget(drawBuffer, &drawRenderTarget); error = drawBuffer->getRenderTarget(&drawRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -1290,7 +1290,7 @@ gl::Error Renderer11::applyRenderTarget(const gl::Framebuffer *framebuffer) ...@@ -1290,7 +1290,7 @@ gl::Error Renderer11::applyRenderTarget(const gl::Framebuffer *framebuffer)
// Extract the render target dimensions and view // Extract the render target dimensions and view
RenderTarget11 *renderTarget = NULL; RenderTarget11 *renderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(colorbuffer, &renderTarget); gl::Error error = colorbuffer->getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -1327,7 +1327,7 @@ gl::Error Renderer11::applyRenderTarget(const gl::Framebuffer *framebuffer) ...@@ -1327,7 +1327,7 @@ gl::Error Renderer11::applyRenderTarget(const gl::Framebuffer *framebuffer)
if (depthStencil) if (depthStencil)
{ {
RenderTarget11 *depthStencilRenderTarget = NULL; RenderTarget11 *depthStencilRenderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(depthStencil, &depthStencilRenderTarget); gl::Error error = depthStencil->getRenderTarget(&depthStencilRenderTarget);
if (error.isError()) if (error.isError())
{ {
SafeRelease(framebufferRTVs); SafeRelease(framebufferRTVs);
...@@ -2423,7 +2423,7 @@ gl::Error Renderer11::copyImage2D(const gl::Framebuffer *framebuffer, const gl:: ...@@ -2423,7 +2423,7 @@ gl::Error Renderer11::copyImage2D(const gl::Framebuffer *framebuffer, const gl::
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget11 *sourceRenderTarget = NULL; RenderTarget11 *sourceRenderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(colorbuffer, &sourceRenderTarget); gl::Error error = colorbuffer->getRenderTarget(&sourceRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -2474,7 +2474,7 @@ gl::Error Renderer11::copyImageCube(const gl::Framebuffer *framebuffer, const gl ...@@ -2474,7 +2474,7 @@ gl::Error Renderer11::copyImageCube(const gl::Framebuffer *framebuffer, const gl
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget11 *sourceRenderTarget = NULL; RenderTarget11 *sourceRenderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(colorbuffer, &sourceRenderTarget); gl::Error error = colorbuffer->getRenderTarget(&sourceRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -2525,7 +2525,7 @@ gl::Error Renderer11::copyImage3D(const gl::Framebuffer *framebuffer, const gl:: ...@@ -2525,7 +2525,7 @@ gl::Error Renderer11::copyImage3D(const gl::Framebuffer *framebuffer, const gl::
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget11 *sourceRenderTarget = NULL; RenderTarget11 *sourceRenderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(colorbuffer, &sourceRenderTarget); gl::Error error = colorbuffer->getRenderTarget(&sourceRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -2576,7 +2576,7 @@ gl::Error Renderer11::copyImage2DArray(const gl::Framebuffer *framebuffer, const ...@@ -2576,7 +2576,7 @@ gl::Error Renderer11::copyImage2DArray(const gl::Framebuffer *framebuffer, const
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget11 *sourceRenderTarget = NULL; RenderTarget11 *sourceRenderTarget = NULL;
gl::Error error = d3d11::GetAttachmentRenderTarget(colorbuffer, &sourceRenderTarget); gl::Error error = colorbuffer->getRenderTarget(&sourceRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -1189,18 +1189,6 @@ HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name) ...@@ -1189,18 +1189,6 @@ HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name)
#endif #endif
} }
gl::Error GetAttachmentRenderTarget(const gl::FramebufferAttachment *attachment, RenderTarget11 **outRT)
{
RenderTargetD3D *renderTarget = NULL;
gl::Error error = rx::GetAttachmentRenderTarget(attachment, &renderTarget);
if (error.isError())
{
return error;
}
*outRT = GetAs<RenderTarget11>(renderTarget);
return gl::Error(GL_NO_ERROR);
}
Workarounds GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel) Workarounds GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel)
{ {
Workarounds workarounds; Workarounds workarounds;
......
...@@ -179,8 +179,6 @@ inline void SetBufferData(ID3D11DeviceContext *context, ID3D11Buffer *constantBu ...@@ -179,8 +179,6 @@ inline void SetBufferData(ID3D11DeviceContext *context, ID3D11Buffer *constantBu
context->Unmap(constantBuffer, 0); context->Unmap(constantBuffer, 0);
} }
gl::Error GetAttachmentRenderTarget(const gl::FramebufferAttachment *attachment, RenderTarget11 **outRT);
Workarounds GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel); Workarounds GenerateWorkarounds(D3D_FEATURE_LEVEL featureLevel);
} }
......
...@@ -239,8 +239,8 @@ gl::Error Blit9::copy2D(const gl::Framebuffer *framebuffer, const RECT &sourceRe ...@@ -239,8 +239,8 @@ gl::Error Blit9::copy2D(const gl::Framebuffer *framebuffer, const RECT &sourceRe
const gl::FramebufferAttachment *colorbuffer = framebuffer->getColorbuffer(0); const gl::FramebufferAttachment *colorbuffer = framebuffer->getColorbuffer(0);
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget9 *renderTarget9 = NULL; RenderTarget9 *renderTarget9 = nullptr;
error = d3d9::GetAttachmentRenderTarget(colorbuffer, &renderTarget9); error = colorbuffer->getRenderTarget(&renderTarget9);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -278,8 +278,8 @@ gl::Error Blit9::copyCube(const gl::Framebuffer *framebuffer, const RECT &source ...@@ -278,8 +278,8 @@ gl::Error Blit9::copyCube(const gl::Framebuffer *framebuffer, const RECT &source
const gl::FramebufferAttachment *colorbuffer = framebuffer->getColorbuffer(0); const gl::FramebufferAttachment *colorbuffer = framebuffer->getColorbuffer(0);
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget9 *renderTarget9 = NULL; RenderTarget9 *renderTarget9 = nullptr;
error = d3d9::GetAttachmentRenderTarget(colorbuffer, &renderTarget9); error = colorbuffer->getRenderTarget(&renderTarget9);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -60,7 +60,7 @@ gl::Error Framebuffer9::readPixels(const gl::Rectangle &area, GLenum format, GLe ...@@ -60,7 +60,7 @@ gl::Error Framebuffer9::readPixels(const gl::Rectangle &area, GLenum format, GLe
ASSERT(colorbuffer); ASSERT(colorbuffer);
RenderTarget9 *renderTarget = nullptr; RenderTarget9 *renderTarget = nullptr;
gl::Error error = d3d9::GetAttachmentRenderTarget(colorbuffer, &renderTarget); gl::Error error = colorbuffer->getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -247,7 +247,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl ...@@ -247,7 +247,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl
ASSERT(readBuffer); ASSERT(readBuffer);
RenderTarget9 *readRenderTarget = nullptr; RenderTarget9 *readRenderTarget = nullptr;
gl::Error error = d3d9::GetAttachmentRenderTarget(readBuffer, &readRenderTarget); gl::Error error = readBuffer->getRenderTarget(&readRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -258,7 +258,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl ...@@ -258,7 +258,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl
ASSERT(drawBuffer); ASSERT(drawBuffer);
RenderTarget9 *drawRenderTarget = nullptr; RenderTarget9 *drawRenderTarget = nullptr;
error = d3d9::GetAttachmentRenderTarget(drawBuffer, &drawRenderTarget); error = drawBuffer->getRenderTarget(&drawRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -373,7 +373,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl ...@@ -373,7 +373,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl
ASSERT(readBuffer); ASSERT(readBuffer);
RenderTarget9 *readDepthStencil = nullptr; RenderTarget9 *readDepthStencil = nullptr;
gl::Error error = d3d9::GetAttachmentRenderTarget(readBuffer, &readDepthStencil); gl::Error error = readBuffer->getRenderTarget(&readDepthStencil);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -384,7 +384,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl ...@@ -384,7 +384,7 @@ gl::Error Framebuffer9::blit(const gl::Rectangle &sourceArea, const gl::Rectangl
ASSERT(drawBuffer); ASSERT(drawBuffer);
RenderTarget9 *drawDepthStencil = nullptr; RenderTarget9 *drawDepthStencil = nullptr;
error = d3d9::GetAttachmentRenderTarget(drawBuffer, &drawDepthStencil); error = drawBuffer->getRenderTarget(&drawDepthStencil);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -1310,31 +1310,34 @@ gl::Error Renderer9::getNullColorbuffer(const gl::FramebufferAttachment *depthbu ...@@ -1310,31 +1310,34 @@ gl::Error Renderer9::getNullColorbuffer(const gl::FramebufferAttachment *depthbu
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
gl::Error Renderer9::applyRenderTarget(const gl::FramebufferAttachment *colorBuffer, const gl::FramebufferAttachment *depthStencilBuffer) gl::Error Renderer9::applyRenderTarget(const gl::FramebufferAttachment *colorAttachment,
const gl::FramebufferAttachment *depthStencilAttachment)
{ {
const gl::FramebufferAttachment *renderAttachment = colorAttachment;
// if there is no color attachment we must synthesize a NULL colorattachment // if there is no color attachment we must synthesize a NULL colorattachment
// to keep the D3D runtime happy. This should only be possible if depth texturing. // to keep the D3D runtime happy. This should only be possible if depth texturing.
if (!colorBuffer) if (renderAttachment == nullptr)
{ {
gl::Error error = getNullColorbuffer(depthStencilBuffer, &colorBuffer); gl::Error error = getNullColorbuffer(depthStencilAttachment, &renderAttachment);
if (error.isError()) if (error.isError())
{ {
return error; return error;
} }
} }
ASSERT(colorBuffer); ASSERT(renderAttachment != nullptr);
size_t renderTargetWidth = 0; size_t renderTargetWidth = 0;
size_t renderTargetHeight = 0; size_t renderTargetHeight = 0;
D3DFORMAT renderTargetFormat = D3DFMT_UNKNOWN; D3DFORMAT renderTargetFormat = D3DFMT_UNKNOWN;
bool renderTargetChanged = false; bool renderTargetChanged = false;
unsigned int renderTargetSerial = GetAttachmentSerial(colorBuffer); unsigned int renderTargetSerial = GetAttachmentSerial(renderAttachment);
if (renderTargetSerial != mAppliedRenderTargetSerial) if (renderTargetSerial != mAppliedRenderTargetSerial)
{ {
// Apply the render target on the device // Apply the render target on the device
RenderTarget9 *renderTarget = NULL; RenderTarget9 *renderTarget = nullptr;
gl::Error error = d3d9::GetAttachmentRenderTarget(colorBuffer, &renderTarget); gl::Error error = renderAttachment->getRenderTarget(&renderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -1355,17 +1358,18 @@ gl::Error Renderer9::applyRenderTarget(const gl::FramebufferAttachment *colorBuf ...@@ -1355,17 +1358,18 @@ gl::Error Renderer9::applyRenderTarget(const gl::FramebufferAttachment *colorBuf
renderTargetChanged = true; renderTargetChanged = true;
} }
unsigned int depthStencilSerial = (depthStencilBuffer != nullptr) ? GetAttachmentSerial(depthStencilBuffer) : 0; unsigned int depthStencilSerial = (depthStencilAttachment != nullptr) ?
GetAttachmentSerial(depthStencilAttachment) : 0;
if (depthStencilSerial != mAppliedDepthStencilSerial || !mDepthStencilInitialized) if (depthStencilSerial != mAppliedDepthStencilSerial || !mDepthStencilInitialized)
{ {
unsigned int depthSize = 0; unsigned int depthSize = 0;
unsigned int stencilSize = 0; unsigned int stencilSize = 0;
// Apply the depth stencil on the device // Apply the depth stencil on the device
if (depthStencilBuffer) if (depthStencilAttachment)
{ {
RenderTarget9 *depthStencilRenderTarget = NULL; RenderTarget9 *depthStencilRenderTarget = nullptr;
gl::Error error = d3d9::GetAttachmentRenderTarget(depthStencilBuffer, &depthStencilRenderTarget); gl::Error error = depthStencilAttachment->getRenderTarget(&depthStencilRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -1378,8 +1382,8 @@ gl::Error Renderer9::applyRenderTarget(const gl::FramebufferAttachment *colorBuf ...@@ -1378,8 +1382,8 @@ gl::Error Renderer9::applyRenderTarget(const gl::FramebufferAttachment *colorBuf
mDevice->SetDepthStencilSurface(depthStencilSurface); mDevice->SetDepthStencilSurface(depthStencilSurface);
SafeRelease(depthStencilSurface); SafeRelease(depthStencilSurface);
depthSize = depthStencilBuffer->getDepthSize(); depthSize = depthStencilAttachment->getDepthSize();
stencilSize = depthStencilBuffer->getStencilSize(); stencilSize = depthStencilAttachment->getStencilSize();
} }
else else
{ {
...@@ -2010,8 +2014,10 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams, ...@@ -2010,8 +2014,10 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
unsigned int stencilUnmasked = 0x0; unsigned int stencilUnmasked = 0x0;
if (clearParams.clearStencil && depthStencilBuffer->getStencilSize() > 0) if (clearParams.clearStencil && depthStencilBuffer->getStencilSize() > 0)
{ {
RenderTargetD3D *stencilRenderTarget = NULL; ASSERT(depthStencilBuffer != nullptr);
gl::Error error = GetAttachmentRenderTarget(depthStencilBuffer, &stencilRenderTarget);
RenderTargetD3D *stencilRenderTarget = nullptr;
gl::Error error = depthStencilBuffer->getRenderTarget(&stencilRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
...@@ -2031,8 +2037,10 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams, ...@@ -2031,8 +2037,10 @@ gl::Error Renderer9::clear(const ClearParameters &clearParams,
D3DCOLOR color = D3DCOLOR_ARGB(255, 0, 0, 0); D3DCOLOR color = D3DCOLOR_ARGB(255, 0, 0, 0);
if (clearColor) if (clearColor)
{ {
ASSERT(colorBuffer != nullptr);
RenderTargetD3D *colorRenderTarget = NULL; RenderTargetD3D *colorRenderTarget = NULL;
gl::Error error = GetAttachmentRenderTarget(colorBuffer, &colorRenderTarget); gl::Error error = colorBuffer->getRenderTarget(&colorRenderTarget);
if (error.isError()) if (error.isError())
{ {
return error; return error;
......
...@@ -105,7 +105,8 @@ class Renderer9 : public RendererD3D ...@@ -105,7 +105,8 @@ class Renderer9 : public RendererD3D
bool ignoreViewport); bool ignoreViewport);
gl::Error applyRenderTarget(const gl::Framebuffer *frameBuffer) override; gl::Error applyRenderTarget(const gl::Framebuffer *frameBuffer) override;
gl::Error applyRenderTarget(const gl::FramebufferAttachment *colorBuffer, const gl::FramebufferAttachment *depthStencilBuffer); gl::Error applyRenderTarget(const gl::FramebufferAttachment *colorAttachment,
const gl::FramebufferAttachment *depthStencilAttachment);
virtual gl::Error applyShaders(gl::Program *program, const gl::VertexFormat inputLayout[], const gl::Framebuffer *framebuffer, virtual gl::Error applyShaders(gl::Program *program, const gl::VertexFormat inputLayout[], const gl::Framebuffer *framebuffer,
bool rasterizerDiscard, bool transformFeedbackActive); bool rasterizerDiscard, bool transformFeedbackActive);
virtual gl::Error applyUniforms(const ProgramImpl &program, const std::vector<gl::LinkedUniform*> &uniformArray); virtual gl::Error applyUniforms(const ProgramImpl &program, const std::vector<gl::LinkedUniform*> &uniformArray);
......
...@@ -574,18 +574,6 @@ void MakeValidSize(bool isImage, D3DFORMAT format, GLsizei *requestWidth, GLsize ...@@ -574,18 +574,6 @@ void MakeValidSize(bool isImage, D3DFORMAT format, GLsizei *requestWidth, GLsize
*levelOffset = upsampleCount; *levelOffset = upsampleCount;
} }
gl::Error GetAttachmentRenderTarget(const gl::FramebufferAttachment *attachment, RenderTarget9 **outRT)
{
RenderTargetD3D *renderTarget = NULL;
gl::Error error = rx::GetAttachmentRenderTarget(attachment, &renderTarget);
if (error.isError())
{
return error;
}
*outRT = GetAs<RenderTarget9>(renderTarget);
return gl::Error(GL_NO_ERROR);
}
Workarounds GenerateWorkarounds() Workarounds GenerateWorkarounds()
{ {
Workarounds workarounds; Workarounds workarounds;
......
...@@ -76,7 +76,6 @@ inline bool isDeviceLostError(HRESULT errorCode) ...@@ -76,7 +76,6 @@ inline bool isDeviceLostError(HRESULT errorCode)
} }
} }
gl::Error GetAttachmentRenderTarget(const gl::FramebufferAttachment *attachment, RenderTarget9 **outRT);
Workarounds GenerateWorkarounds(); Workarounds GenerateWorkarounds();
} }
......
...@@ -33,6 +33,12 @@ class RenderbufferGL : public RenderbufferImpl ...@@ -33,6 +33,12 @@ class RenderbufferGL : public RenderbufferImpl
GLuint getRenderbufferID() const; GLuint getRenderbufferID() const;
gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) override
{
return gl::Error(GL_OUT_OF_MEMORY, "Not supported on OpenGL");
}
private: private:
const FunctionsGL *mFunctions; const FunctionsGL *mFunctions;
StateManagerGL *mStateManager; StateManagerGL *mStateManager;
......
...@@ -20,6 +20,12 @@ class SurfaceGL : public SurfaceImpl ...@@ -20,6 +20,12 @@ class SurfaceGL : public SurfaceImpl
SurfaceGL(); SurfaceGL();
~SurfaceGL() override; ~SurfaceGL() override;
gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) override
{
return gl::Error(GL_OUT_OF_MEMORY, "Not supported on OpenGL");
}
virtual egl::Error makeCurrent() = 0; virtual egl::Error makeCurrent() = 0;
}; };
......
...@@ -51,6 +51,12 @@ class TextureGL : public TextureImpl ...@@ -51,6 +51,12 @@ class TextureGL : public TextureImpl
void syncSamplerState(const gl::SamplerState &samplerState) const; void syncSamplerState(const gl::SamplerState &samplerState) const;
GLuint getTextureID() const; GLuint getTextureID() const;
gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target,
FramebufferAttachmentRenderTarget **rtOut) override
{
return gl::Error(GL_OUT_OF_MEMORY, "Not supported on OpenGL");
}
private: private:
GLenum mTextureType; GLenum mTextureType;
......
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