Skip to content

Commit 937e01a

Browse files
corporatesharkmeta-codesync[bot]
authored andcommitted
igl | IGLU | Add Tracy profiler markers to texture_loader/ktx/TextureLoaderFactory
Reviewed By: rudybear Differential Revision: D115179581 fbshipit-source-id: 7f9463a28ca583d5bcddbe102faca35b1437a1e1
1 parent 4ec7b0f commit 937e01a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

IGLU/texture_loader/ktx/TextureLoaderFactory.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <ktx.h>
1111
#include <igl/IGLSafeC.h>
12+
#include <igl/Macros.h>
1213

1314
// @fb-only
1415
// @fb-only
@@ -94,6 +95,7 @@ TextureLoader::TextureLoader(DataReader reader,
9495
igl::TextureFormat format,
9596
std::unique_ptr<ktxTexture, KtxDeleter> texture) noexcept :
9697
Super(reader), texture_(std::move(texture)) {
98+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
9799
auto& desc = mutableDescriptor();
98100
desc.format = format;
99101
desc.numLayers = range.numLayers;
@@ -126,6 +128,7 @@ bool TextureLoader::shouldGenerateMipmaps() const noexcept {
126128
// NOLINTNEXTLINE(bugprone-exception-escape)
127129
void TextureLoader::uploadInternal(igl::ITexture& texture,
128130
igl::Result* IGL_NULLABLE outResult) const noexcept {
131+
IGL_PROFILER_FUNCTION();
129132
const auto& desc = descriptor();
130133

131134
size_t offset = 0;
@@ -150,6 +153,7 @@ void TextureLoader::loadToExternalMemoryInternal(uint8_t* IGL_NONNULL data,
150153
uint32_t length,
151154
igl::Result* IGL_NULLABLE
152155
outResult) const noexcept {
156+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
153157
const auto& desc = descriptor();
154158

155159
size_t offsetDestination = 0;
@@ -211,6 +215,7 @@ std::unique_ptr<ITextureLoader> TextureLoaderFactory::tryCreateInternal(
211215
DataReader reader,
212216
igl::TextureFormat /*preferredFormat*/,
213217
igl::Result* IGL_NULLABLE outResult) const noexcept {
218+
IGL_PROFILER_FUNCTION_COLOR(IGL_PROFILER_COLOR_CREATE);
214219
const auto range = textureRange(reader);
215220
auto result = range.validate();
216221
if (!result.isOk()) {

0 commit comments

Comments
 (0)