This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree 2 files changed +11
-6
lines changed 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -2344,31 +2344,32 @@ bool Framebuffer::hasTextureAttachment(const Texture *texture) const
2344
2344
{
2345
2345
if (!mAttachedTextures .valid ())
2346
2346
{
2347
- std::set< const FramebufferAttachmentObject *> attachedTextures;
2347
+ FramebufferTextureAttachmentVector attachedTextures;
2348
2348
2349
2349
for (const auto &colorAttachment : mState .mColorAttachments )
2350
2350
{
2351
2351
if (colorAttachment.isAttached () && colorAttachment.type () == GL_TEXTURE)
2352
2352
{
2353
- attachedTextures.insert (colorAttachment.getResource ());
2353
+ attachedTextures.push_back (colorAttachment.getResource ());
2354
2354
}
2355
2355
}
2356
2356
2357
2357
if (mState .mDepthAttachment .isAttached () && mState .mDepthAttachment .type () == GL_TEXTURE)
2358
2358
{
2359
- attachedTextures.insert (mState .mDepthAttachment .getResource ());
2359
+ attachedTextures.push_back (mState .mDepthAttachment .getResource ());
2360
2360
}
2361
2361
2362
2362
if (mState .mStencilAttachment .isAttached () &&
2363
2363
mState .mStencilAttachment .type () == GL_TEXTURE)
2364
2364
{
2365
- attachedTextures.insert (mState .mStencilAttachment .getResource ());
2365
+ attachedTextures.push_back (mState .mStencilAttachment .getResource ());
2366
2366
}
2367
2367
2368
2368
mAttachedTextures = std::move (attachedTextures);
2369
2369
}
2370
2370
2371
- return (mAttachedTextures .value ().count (texture) > 0 );
2371
+ return std::find (mAttachedTextures .value ().begin (), mAttachedTextures .value ().end (), texture) !=
2372
+ mAttachedTextures .value ().end ();
2372
2373
}
2373
2374
2374
2375
} // namespace gl
Original file line number Diff line number Diff line change 12
12
13
13
#include < vector>
14
14
15
+ #include " common/FixedVector.h"
15
16
#include " common/Optional.h"
16
17
#include " common/angleutils.h"
17
18
#include " libANGLE/Constants.h"
@@ -422,7 +423,10 @@ class Framebuffer final : public angle::ObserverInterface,
422
423
Optional<DirtyBits> mDirtyBitsGuard ;
423
424
424
425
// A cache of attached textures for quick validation of feedback loops.
425
- mutable Optional<std::set<const FramebufferAttachmentObject *>> mAttachedTextures ;
426
+ using FramebufferTextureAttachmentVector =
427
+ angle::FixedVector<const FramebufferAttachmentObject *,
428
+ IMPLEMENTATION_MAX_FRAMEBUFFER_ATTACHMENTS>;
429
+ mutable Optional<FramebufferTextureAttachmentVector> mAttachedTextures ;
426
430
};
427
431
428
432
} // namespace gl
You can’t perform that action at this time.
0 commit comments