Skip to content

Commit

Permalink
fix validation errors by flushing the upload
Browse files Browse the repository at this point in the history
Summary: this test runs multiple format and when it got to the second format, it was still trying to upload the first format and freeing its resources would fail because it was in use by current frame buffer

Reviewed By: EricGriffith

Differential Revision: D62181019

fbshipit-source-id: 5a4185f38f9a890ce62896620f4b69b01a04d15d
  • Loading branch information
francoiscoulombe authored and facebook-github-bot committed Sep 4, 2024
1 parent 9a94793 commit b27c001
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/igl/tests/util/TextureFormatTestBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void TextureFormatTestBase::SetUp() {
OFFSCREEN_TEX_WIDTH,
OFFSCREEN_TEX_HEIGHT,
TextureDesc::TextureUsageBits::Sampled);
texDesc.debugName = "TextureFormatTestBase rgba unorm8 sampled";

Result ret;
sampledTexture_ = iglDev_->createTexture(texDesc, &ret);
Expand Down Expand Up @@ -349,6 +350,11 @@ void TextureFormatTestBase::testUpload(std::shared_ptr<ITexture> texture) {
const auto range = texture->getFullRange();
const Result result = texture->upload(range, data.data());
ASSERT_TRUE(result.isOk()) << texture->getProperties().name;
// flush upload
Result ret;
auto cmdBuf = cmdQueue_->createCommandBuffer(CommandBufferDesc{}, &ret);
cmdQueue_->submit(*cmdBuf);
cmdBuf->waitUntilCompleted();
}

// Attempts to render into texture.
Expand Down

0 comments on commit b27c001

Please sign in to comment.