Skip to content

Commit

Permalink
Merge branch 'main' into bjd/descriptorsets-useafterfree
Browse files Browse the repository at this point in the history
  • Loading branch information
bejado authored Oct 3, 2024
2 parents fefccae + 739d400 commit 2ed7d39
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions filament/src/details/Texture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,15 @@ FTexture::FTexture(FEngine& engine, const Builder& builder) {
mSwizzle = builder->mSwizzle;
mTextureIsSwizzled = builder->mTextureIsSwizzled;

if (mTarget == SamplerType::SAMPLER_EXTERNAL) {
bool const isImported = builder->mImportedId != 0;
if (mTarget == SamplerType::SAMPLER_EXTERNAL && !isImported) {
// mHandle and mHandleForSampling will be created in setExternalImage()
// If this Texture is used for sampling before setExternalImage() is called,
// we'll lazily create a 1x1 placeholder texture.
return;
}

if (UTILS_LIKELY(builder->mImportedId == 0)) {
if (UTILS_LIKELY(!isImported)) {
mHandle = driver.createTexture(
mTarget, mLevelCount, mFormat, mSampleCount, mWidth, mHeight, mDepth, mUsage);
} else {
Expand Down

0 comments on commit 2ed7d39

Please sign in to comment.