Commit f6fb6da8 by Khushal Committed by Commit Bot

Revert "Feedback Loop Redesign 2/3: Track bound FBOs in Texture."

This reverts commit 699bcde0. Reason for revert: Breaking GLES2WebGLDecoderPassthroughTest.DrawArraysInstancedANGLEEnablement. Here is a sample build : https://ci.chromium.org/p/chromium/builders/ci/Win10%20FYI%20x64%20Release%20%28NVIDIA%29/4240 Original change's description: > Feedback Loop Redesign 2/3: Track bound FBOs in Texture. > > Currently we track feedback loops by counting the times a Texture is > bound as a sampler or image in a particular context. This is a bit > tricky because Texture bindings change frequently. Relative to the > number of times we need to check for a feedback loop this causes excess > overhead. > > Usually Framebuffers have a low number of Textures bound (in many cases > just 1). And Textures aren't usually bound to many different FBOs. So > instead of counting the number of times a Texture is bound as a sampler > or image we will track the Framebuffers that the Texture is bound to. > > This CL adds a small vector class to gl::Texture which tracks all the > Framebufer Serials of its bound Framebuffers. We can use this set to > quickly check if there's any potential feedback loop between the a FBO > and this Texture. > > We also update the feedback loop check to use this new method. We will > be able to remove the old counting method when we switch the Vulkan > feedback loop handling to use the new tracking in this CL. > > Bug: angleproject:4500 > Bug: angleproject:4959 > Change-Id: I84a2f0ed8480d1da63d5879e0e56a8be4af4e735 > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2358850 > Reviewed-by: Tobin Ehlis <tobine@google.com> > Reviewed-by: Courtney Goeltzenleuchter <courtneygo@google.com> > Reviewed-by: Jonah Ryan-Davis <jonahr@google.com> > Commit-Queue: Jamie Madill <jmadill@chromium.org> TBR=tobine@google.com,courtneygo@google.com,jonahr@google.com,jmadill@chromium.org Change-Id: Ica795036895652add37ac8ed319031f9d5a321ac No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: angleproject:4500 Bug: angleproject:4959 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2365077Reviewed-by: 's avatarKhushal <khushalsagar@chromium.org> Commit-Queue: Khushal <khushalsagar@chromium.org>
parent 0f33d01e
...@@ -796,19 +796,19 @@ void Framebuffer::onDestroy(const Context *context) ...@@ -796,19 +796,19 @@ void Framebuffer::onDestroy(const Context *context)
{ {
if (isDefault()) if (isDefault())
{ {
mState.mDefaultFramebufferReadAttachment.detach(context, mState.mFramebufferSerial); mState.mDefaultFramebufferReadAttachment.detach(context);
mState.mDefaultFramebufferReadAttachmentInitialized = false; mState.mDefaultFramebufferReadAttachmentInitialized = false;
} }
for (auto &attachment : mState.mColorAttachments) for (auto &attachment : mState.mColorAttachments)
{ {
attachment.detach(context, mState.mFramebufferSerial); attachment.detach(context);
} }
mState.mDepthAttachment.detach(context, mState.mFramebufferSerial); mState.mDepthAttachment.detach(context);
mState.mStencilAttachment.detach(context, mState.mFramebufferSerial); mState.mStencilAttachment.detach(context);
mState.mWebGLDepthAttachment.detach(context, mState.mFramebufferSerial); mState.mWebGLDepthAttachment.detach(context);
mState.mWebGLStencilAttachment.detach(context, mState.mFramebufferSerial); mState.mWebGLStencilAttachment.detach(context);
mState.mWebGLDepthStencilAttachment.detach(context, mState.mFramebufferSerial); mState.mWebGLDepthStencilAttachment.detach(context);
mImpl->destroy(context); mImpl->destroy(context);
} }
...@@ -819,7 +819,7 @@ void Framebuffer::setReadSurface(const Context *context, egl::Surface *readSurfa ...@@ -819,7 +819,7 @@ void Framebuffer::setReadSurface(const Context *context, egl::Surface *readSurfa
mState.mDefaultFramebufferReadAttachment.attach( mState.mDefaultFramebufferReadAttachment.attach(
context, GL_FRAMEBUFFER_DEFAULT, GL_BACK, ImageIndex(), readSurface, context, GL_FRAMEBUFFER_DEFAULT, GL_BACK, ImageIndex(), readSurface,
FramebufferAttachment::kDefaultNumViews, FramebufferAttachment::kDefaultBaseViewIndex, FramebufferAttachment::kDefaultNumViews, FramebufferAttachment::kDefaultBaseViewIndex,
false, FramebufferAttachment::kDefaultRenderToTextureSamples, mState.mFramebufferSerial); false, FramebufferAttachment::kDefaultRenderToTextureSamples);
mDirtyBits.set(DIRTY_BIT_READ_BUFFER); mDirtyBits.set(DIRTY_BIT_READ_BUFFER);
} }
...@@ -1674,21 +1674,19 @@ void Framebuffer::setAttachment(const Context *context, ...@@ -1674,21 +1674,19 @@ void Framebuffer::setAttachment(const Context *context,
{ {
case GL_DEPTH_STENCIL: case GL_DEPTH_STENCIL:
case GL_DEPTH_STENCIL_ATTACHMENT: case GL_DEPTH_STENCIL_ATTACHMENT:
mState.mWebGLDepthStencilAttachment.attach( mState.mWebGLDepthStencilAttachment.attach(context, type, binding, textureIndex,
context, type, binding, textureIndex, resource, numViews, baseViewIndex, resource, numViews, baseViewIndex,
isMultiview, samples, mState.mFramebufferSerial); isMultiview, samples);
break; break;
case GL_DEPTH: case GL_DEPTH:
case GL_DEPTH_ATTACHMENT: case GL_DEPTH_ATTACHMENT:
mState.mWebGLDepthAttachment.attach(context, type, binding, textureIndex, resource, mState.mWebGLDepthAttachment.attach(context, type, binding, textureIndex, resource,
numViews, baseViewIndex, isMultiview, samples, numViews, baseViewIndex, isMultiview, samples);
mState.mFramebufferSerial);
break; break;
case GL_STENCIL: case GL_STENCIL:
case GL_STENCIL_ATTACHMENT: case GL_STENCIL_ATTACHMENT:
mState.mWebGLStencilAttachment.attach(context, type, binding, textureIndex, resource, mState.mWebGLStencilAttachment.attach(context, type, binding, textureIndex, resource,
numViews, baseViewIndex, isMultiview, samples, numViews, baseViewIndex, isMultiview, samples);
mState.mFramebufferSerial);
break; break;
default: default:
setAttachmentImpl(context, type, binding, textureIndex, resource, numViews, setAttachmentImpl(context, type, binding, textureIndex, resource, numViews,
...@@ -1871,7 +1869,7 @@ void Framebuffer::updateAttachment(const Context *context, ...@@ -1871,7 +1869,7 @@ void Framebuffer::updateAttachment(const Context *context,
GLsizei samples) GLsizei samples)
{ {
attachment->attach(context, type, binding, textureIndex, resource, numViews, baseViewIndex, attachment->attach(context, type, binding, textureIndex, resource, numViews, baseViewIndex,
isMultiview, samples, mState.mFramebufferSerial); isMultiview, samples);
mDirtyBits.set(dirtyBit); mDirtyBits.set(dirtyBit);
mState.mResourceNeedsInit.set(dirtyBit, attachment->initState() == InitState::MayNeedInit); mState.mResourceNeedsInit.set(dirtyBit, attachment->initState() == InitState::MayNeedInit);
onDirtyBinding->bind(resource); onDirtyBinding->bind(resource);
...@@ -1969,31 +1967,6 @@ FramebufferAttachment *Framebuffer::getAttachmentFromSubjectIndex(angle::Subject ...@@ -1969,31 +1967,6 @@ FramebufferAttachment *Framebuffer::getAttachmentFromSubjectIndex(angle::Subject
} }
} }
bool Framebuffer::formsRenderingFeedbackLoopWith(const Context *context) const
{
const State &glState = context->getState();
const ProgramExecutable *executable = glState.getProgramExecutable();
ASSERT(executable);
const ActiveTextureMask &activeTextures = executable->getActiveSamplersMask();
const ActiveTextureTypeArray &textureTypes = executable->getActiveSamplerTypes();
for (size_t textureIndex : activeTextures)
{
unsigned int uintIndex = static_cast<unsigned int>(textureIndex);
Texture *texture = glState.getSamplerTexture(uintIndex, textureTypes[textureIndex]);
const Sampler *sampler = glState.getSampler(uintIndex);
if (texture && texture->isSamplerComplete(context, sampler) &&
texture->isBoundToFramebuffer(mState.mFramebufferSerial))
{
// TODO(jmadill): Subresource check. http://anglebug.com/4500
return true;
}
}
return false;
}
bool Framebuffer::formsCopyingFeedbackLoopWith(TextureID copyTextureID, bool Framebuffer::formsCopyingFeedbackLoopWith(TextureID copyTextureID,
GLint copyTextureLevel, GLint copyTextureLevel,
GLint copyTextureLayer) const GLint copyTextureLayer) const
......
...@@ -171,7 +171,6 @@ class FramebufferState final : angle::NonCopyable ...@@ -171,7 +171,6 @@ class FramebufferState final : angle::NonCopyable
bool mWebGLDepthStencilConsistent; bool mWebGLDepthStencilConsistent;
// Tracks rendering feedback loops. // Tracks rendering feedback loops.
// TODO(jmadill): Remove. http://anglebug.com/4500
DrawBufferMask mDrawBufferFeedbackLoops; DrawBufferMask mDrawBufferFeedbackLoops;
bool mDepthBufferFeedbackLoop; bool mDepthBufferFeedbackLoop;
bool mStencilBufferFeedbackLoop; bool mStencilBufferFeedbackLoop;
...@@ -410,10 +409,7 @@ class Framebuffer final : public angle::ObserverInterface, ...@@ -410,10 +409,7 @@ class Framebuffer final : public angle::ObserverInterface,
// Observer implementation // Observer implementation
void onSubjectStateChange(angle::SubjectIndex index, angle::SubjectMessage message) override; void onSubjectStateChange(angle::SubjectIndex index, angle::SubjectMessage message) override;
// TODO(jmadill): Remove. http://anglebug.com/4500
bool hasRenderingFeedbackLoop() const { return mState.mHasRenderingFeedbackLoop; } bool hasRenderingFeedbackLoop() const { return mState.mHasRenderingFeedbackLoop; }
bool formsRenderingFeedbackLoopWith(const Context *context) const;
bool formsCopyingFeedbackLoopWith(TextureID copyTextureID, bool formsCopyingFeedbackLoopWith(TextureID copyTextureID,
GLint copyTextureLevel, GLint copyTextureLevel,
GLint copyTextureLayer) const; GLint copyTextureLayer) const;
......
...@@ -60,12 +60,11 @@ FramebufferAttachment::FramebufferAttachment(const Context *context, ...@@ -60,12 +60,11 @@ FramebufferAttachment::FramebufferAttachment(const Context *context,
GLenum type, GLenum type,
GLenum binding, GLenum binding,
const ImageIndex &textureIndex, const ImageIndex &textureIndex,
FramebufferAttachmentObject *resource, FramebufferAttachmentObject *resource)
rx::Serial framebufferSerial)
: mResource(nullptr) : mResource(nullptr)
{ {
attach(context, type, binding, textureIndex, resource, kDefaultNumViews, kDefaultBaseViewIndex, attach(context, type, binding, textureIndex, resource, kDefaultNumViews, kDefaultBaseViewIndex,
false, kDefaultRenderToTextureSamples, framebufferSerial); false, kDefaultRenderToTextureSamples);
} }
FramebufferAttachment::FramebufferAttachment(FramebufferAttachment &&other) FramebufferAttachment::FramebufferAttachment(FramebufferAttachment &&other)
...@@ -91,12 +90,12 @@ FramebufferAttachment::~FramebufferAttachment() ...@@ -91,12 +90,12 @@ FramebufferAttachment::~FramebufferAttachment()
ASSERT(!isAttached()); ASSERT(!isAttached());
} }
void FramebufferAttachment::detach(const Context *context, rx::Serial framebufferSerial) void FramebufferAttachment::detach(const Context *context)
{ {
mType = GL_NONE; mType = GL_NONE;
if (mResource != nullptr) if (mResource != nullptr)
{ {
mResource->onDetach(context, framebufferSerial); mResource->onDetach(context);
mResource = nullptr; mResource = nullptr;
} }
mNumViews = kDefaultNumViews; mNumViews = kDefaultNumViews;
...@@ -115,12 +114,11 @@ void FramebufferAttachment::attach(const Context *context, ...@@ -115,12 +114,11 @@ void FramebufferAttachment::attach(const Context *context,
GLsizei numViews, GLsizei numViews,
GLuint baseViewIndex, GLuint baseViewIndex,
bool isMultiview, bool isMultiview,
GLsizei samples, GLsizei samples)
rx::Serial framebufferSerial)
{ {
if (resource == nullptr) if (resource == nullptr)
{ {
detach(context, framebufferSerial); detach(context);
return; return;
} }
...@@ -130,11 +128,11 @@ void FramebufferAttachment::attach(const Context *context, ...@@ -130,11 +128,11 @@ void FramebufferAttachment::attach(const Context *context,
mBaseViewIndex = baseViewIndex; mBaseViewIndex = baseViewIndex;
mIsMultiview = isMultiview; mIsMultiview = isMultiview;
mRenderToTextureSamples = samples; mRenderToTextureSamples = samples;
resource->onAttach(context, framebufferSerial); resource->onAttach(context);
if (mResource != nullptr) if (mResource != nullptr)
{ {
mResource->onDetach(context, framebufferSerial); mResource->onDetach(context);
} }
mResource = resource; mResource = resource;
......
...@@ -64,15 +64,14 @@ class FramebufferAttachment final ...@@ -64,15 +64,14 @@ class FramebufferAttachment final
GLenum type, GLenum type,
GLenum binding, GLenum binding,
const ImageIndex &textureIndex, const ImageIndex &textureIndex,
FramebufferAttachmentObject *resource, FramebufferAttachmentObject *resource);
rx::Serial framebufferSerial);
FramebufferAttachment(FramebufferAttachment &&other); FramebufferAttachment(FramebufferAttachment &&other);
FramebufferAttachment &operator=(FramebufferAttachment &&other); FramebufferAttachment &operator=(FramebufferAttachment &&other);
~FramebufferAttachment(); ~FramebufferAttachment();
void detach(const Context *context, rx::Serial framebufferSerial); void detach(const Context *context);
void attach(const Context *context, void attach(const Context *context,
GLenum type, GLenum type,
GLenum binding, GLenum binding,
...@@ -81,8 +80,7 @@ class FramebufferAttachment final ...@@ -81,8 +80,7 @@ class FramebufferAttachment final
GLsizei numViews, GLsizei numViews,
GLuint baseViewIndex, GLuint baseViewIndex,
bool isMultiview, bool isMultiview,
GLsizei samples, GLsizei samples);
rx::Serial framebufferSerial);
// Helper methods // Helper methods
GLuint getRedSize() const; GLuint getRedSize() const;
...@@ -210,9 +208,9 @@ class FramebufferAttachmentObject : public angle::Subject, public angle::Observe ...@@ -210,9 +208,9 @@ class FramebufferAttachmentObject : public angle::Subject, public angle::Observe
GLenum binding, GLenum binding,
const ImageIndex &imageIndex) const = 0; const ImageIndex &imageIndex) const = 0;
virtual void onAttach(const Context *context, rx::Serial framebufferSerial) = 0; virtual void onAttach(const Context *context) = 0;
virtual void onDetach(const Context *context, rx::Serial framebufferSerial) = 0; virtual void onDetach(const Context *context) = 0;
virtual GLuint getId() const = 0; virtual GLuint getId() const = 0;
// These are used for robust resource initialization. // These are used for robust resource initialization.
virtual InitState initState(const ImageIndex &imageIndex) const = 0; virtual InitState initState(const ImageIndex &imageIndex) const = 0;
......
...@@ -193,9 +193,9 @@ bool ExternalImageSibling::isTextureable(const gl::Context *context) const ...@@ -193,9 +193,9 @@ bool ExternalImageSibling::isTextureable(const gl::Context *context) const
return mImplementation->isTexturable(context); return mImplementation->isTexturable(context);
} }
void ExternalImageSibling::onAttach(const gl::Context *context, rx::Serial framebufferSerial) {} void ExternalImageSibling::onAttach(const gl::Context *context) {}
void ExternalImageSibling::onDetach(const gl::Context *context, rx::Serial framebufferSerial) {} void ExternalImageSibling::onDetach(const gl::Context *context) {}
GLuint ExternalImageSibling::getId() const GLuint ExternalImageSibling::getId() const
{ {
......
...@@ -98,8 +98,8 @@ class ExternalImageSibling : public ImageSibling ...@@ -98,8 +98,8 @@ class ExternalImageSibling : public ImageSibling
const gl::ImageIndex &imageIndex) const override; const gl::ImageIndex &imageIndex) const override;
bool isTextureable(const gl::Context *context) const; bool isTextureable(const gl::Context *context) const;
void onAttach(const gl::Context *context, rx::Serial framebufferSerial) override; void onAttach(const gl::Context *context) override;
void onDetach(const gl::Context *context, rx::Serial framebufferSerial) override; void onDetach(const gl::Context *context) override;
GLuint getId() const override; GLuint getId() const override;
gl::InitState initState(const gl::ImageIndex &imageIndex) const override; gl::InitState initState(const gl::ImageIndex &imageIndex) const override;
......
...@@ -234,12 +234,12 @@ GLint Renderbuffer::getMemorySize() const ...@@ -234,12 +234,12 @@ GLint Renderbuffer::getMemorySize() const
return size.ValueOrDefault(std::numeric_limits<GLint>::max()); return size.ValueOrDefault(std::numeric_limits<GLint>::max());
} }
void Renderbuffer::onAttach(const Context *context, rx::Serial framebufferSerial) void Renderbuffer::onAttach(const Context *context)
{ {
addRef(); addRef();
} }
void Renderbuffer::onDetach(const Context *context, rx::Serial framebufferSerial) void Renderbuffer::onDetach(const Context *context)
{ {
release(context); release(context);
} }
......
...@@ -110,8 +110,8 @@ class Renderbuffer final : public RefCountObject<RenderbufferID>, ...@@ -110,8 +110,8 @@ class Renderbuffer final : public RefCountObject<RenderbufferID>,
GLenum binding, GLenum binding,
const ImageIndex &imageIndex) const override; const ImageIndex &imageIndex) const override;
void onAttach(const Context *context, rx::Serial framebufferSerial) override; void onAttach(const Context *context) override;
void onDetach(const Context *context, rx::Serial framebufferSerial) override; void onDetach(const Context *context) override;
GLuint getId() const override; GLuint getId() const override;
InitState initState(const ImageIndex &imageIndex) const override; InitState initState(const ImageIndex &imageIndex) const override;
......
...@@ -143,8 +143,8 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject ...@@ -143,8 +143,8 @@ class Surface : public LabeledObject, public gl::FramebufferAttachmentObject
GLenum binding, GLenum binding,
const gl::ImageIndex &imageIndex) const override; const gl::ImageIndex &imageIndex) const override;
void onAttach(const gl::Context *context, rx::Serial framebufferSerial) override {} void onAttach(const gl::Context *context) override {}
void onDetach(const gl::Context *context, rx::Serial framebufferSerial) override {} void onDetach(const gl::Context *context) override {}
GLuint getId() const override; GLuint getId() const override;
bool flexibleSurfaceCompatibilityRequested() const bool flexibleSurfaceCompatibilityRequested() const
......
...@@ -1774,20 +1774,13 @@ GLenum Texture::getGenerateMipmapHint() const ...@@ -1774,20 +1774,13 @@ GLenum Texture::getGenerateMipmapHint() const
return mState.getGenerateMipmapHint(); return mState.getGenerateMipmapHint();
} }
void Texture::onAttach(const Context *context, rx::Serial framebufferSerial) void Texture::onAttach(const Context *context)
{ {
addRef(); addRef();
// Duplicates allowed for multiple attachment points. See the comment in the header.
mBoundFramebufferSerials.push_back(framebufferSerial);
} }
void Texture::onDetach(const Context *context, rx::Serial framebufferSerial) void Texture::onDetach(const Context *context)
{ {
// Erase first instance. If there are multiple bindings, leave the others.
ASSERT(isBoundToFramebuffer(framebufferSerial));
mBoundFramebufferSerials.remove_and_permute(framebufferSerial);
release(context); release(context);
} }
......
...@@ -146,8 +146,6 @@ class TextureState final : private angle::NonCopyable ...@@ -146,8 +146,6 @@ class TextureState final : private angle::NonCopyable
GLenum getUsage() const { return mUsage; } GLenum getUsage() const { return mUsage; }
GLenum getDepthStencilTextureMode() const { return mDepthStencilTextureMode; } GLenum getDepthStencilTextureMode() const { return mDepthStencilTextureMode; }
bool isStencilMode() const { return mDepthStencilTextureMode == GL_STENCIL_INDEX; } bool isStencilMode() const { return mDepthStencilTextureMode == GL_STENCIL_INDEX; }
// TODO(jmadill): Remove. http://anglebug.com/4500
bool isBoundAsSamplerTexture(ContextID contextID) const bool isBoundAsSamplerTexture(ContextID contextID) const
{ {
return getBindingCount(contextID).samplerBindingCount > 0; return getBindingCount(contextID).samplerBindingCount > 0;
...@@ -547,8 +545,8 @@ class Texture final : public RefCountObject<TextureID>, ...@@ -547,8 +545,8 @@ class Texture final : public RefCountObject<TextureID>,
void setGenerateMipmapHint(GLenum generate); void setGenerateMipmapHint(GLenum generate);
GLenum getGenerateMipmapHint() const; GLenum getGenerateMipmapHint() const;
void onAttach(const Context *context, rx::Serial framebufferSerial) override; void onAttach(const Context *context) override;
void onDetach(const Context *context, rx::Serial framebufferSerial) override; void onDetach(const Context *context) override;
// Used specifically for FramebufferAttachmentObject. // Used specifically for FramebufferAttachmentObject.
GLuint getId() const override; GLuint getId() const override;
...@@ -561,17 +559,6 @@ class Texture final : public RefCountObject<TextureID>, ...@@ -561,17 +559,6 @@ class Texture final : public RefCountObject<TextureID>,
InitState initState() const { return mState.mInitState; } InitState initState() const { return mState.mInitState; }
void setInitState(const ImageIndex &imageIndex, InitState initState) override; void setInitState(const ImageIndex &imageIndex, InitState initState) override;
bool isBoundToFramebuffer(rx::Serial framebufferSerial) const
{
for (size_t index = 0; index < mBoundFramebufferSerials.size(); ++index)
{
if (mBoundFramebufferSerials[index] == framebufferSerial)
return true;
}
return false;
}
enum DirtyBitType enum DirtyBitType
{ {
// Sampler state // Sampler state
...@@ -656,14 +643,6 @@ class Texture final : public RefCountObject<TextureID>, ...@@ -656,14 +643,6 @@ class Texture final : public RefCountObject<TextureID>,
egl::Surface *mBoundSurface; egl::Surface *mBoundSurface;
egl::Stream *mBoundStream; egl::Stream *mBoundStream;
// We track all the serials of the Framebuffers this texture is attached to. Note that this
// allows duplicates because different ranges of a Texture can be bound to the same Framebuffer.
// For the purposes of depth-stencil loops, a simple "isBound" check works fine. For color
// attachment Feedback Loop checks we then need to check further to see when a Texture is bound
// to mulitple bindings that the bindings don't overlap.
static constexpr uint32_t kFastFramebufferSerialCount = 8;
angle::FastVector<rx::Serial, kFastFramebufferSerialCount> mBoundFramebufferSerials;
struct SamplerCompletenessCache struct SamplerCompletenessCache
{ {
SamplerCompletenessCache(); SamplerCompletenessCache();
......
...@@ -362,18 +362,19 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const gl: ...@@ -362,18 +362,19 @@ const gl::AttachmentList &FramebufferD3D::getColorAttachmentsForRender(const gl:
// it to be attached to a new binding point. // it to be attached to a new binding point.
if (mDummyAttachment.isAttached()) if (mDummyAttachment.isAttached())
{ {
mDummyAttachment.detach(context, Serial()); mDummyAttachment.detach(context);
} }
gl::Texture *dummyTex = nullptr; gl::Texture *dummyTex = nullptr;
// TODO(jmadill): Handle error if dummy texture can't be created. // TODO(Jamie): Handle error if dummy texture can't be created.
(void)mRenderer->getIncompleteTexture(context, gl::TextureType::_2D, &dummyTex); (void)mRenderer->getIncompleteTexture(context, gl::TextureType::_2D, &dummyTex);
if (dummyTex) if (dummyTex)
{ {
gl::ImageIndex index = gl::ImageIndex::Make2D(0); gl::ImageIndex index = gl::ImageIndex::Make2D(0);
mDummyAttachment = gl::FramebufferAttachment( mDummyAttachment = gl::FramebufferAttachment(
context, GL_TEXTURE, GL_COLOR_ATTACHMENT0_EXT + activeProgramLocation, index, context, GL_TEXTURE, GL_COLOR_ATTACHMENT0_EXT + activeProgramLocation, index,
dummyTex, Serial()); dummyTex);
colorAttachmentsForRender.push_back(&mDummyAttachment); colorAttachmentsForRender.push_back(&mDummyAttachment);
} }
} }
...@@ -389,7 +390,7 @@ void FramebufferD3D::destroy(const gl::Context *context) ...@@ -389,7 +390,7 @@ void FramebufferD3D::destroy(const gl::Context *context)
{ {
if (mDummyAttachment.isAttached()) if (mDummyAttachment.isAttached())
{ {
mDummyAttachment.detach(context, Serial()); mDummyAttachment.detach(context);
} }
} }
......
...@@ -3005,7 +3005,7 @@ const char *ValidateDrawStates(const Context *context) ...@@ -3005,7 +3005,7 @@ const char *ValidateDrawStates(const Context *context)
} }
// Detect rendering feedback loops for WebGL. // Detect rendering feedback loops for WebGL.
if (framebuffer->formsRenderingFeedbackLoopWith(context)) if (framebuffer->hasRenderingFeedbackLoop())
{ {
return kFeedbackLoop; return kFeedbackLoop;
} }
......
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