MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXNTC / CopyTextureSetDataIntoGraphicsTextures

Function CopyTextureSetDataIntoGraphicsTextures

tools/cli/GraphicsPasses.cpp:312–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310
311 return true;
312}
313
314bool CopyTextureSetDataIntoGraphicsTextures(
315 ntc::IContext* context,
316 ntc::ITextureSet* textureSet,
317 ntc::TextureDataPage page,
318 bool allMipLevels,
319 bool onlyBlockCompressedFormats,
320 GraphicsResourcesForTextureSet const& graphicsResources)
321{
322 for (int textureIndex = 0; textureIndex < textureSet->GetTextureCount(); ++textureIndex)
323 {
324 ntc::ITextureMetadata* textureMetadata = textureSet->GetTexture(textureIndex);
325 ntc::BlockCompressedFormat const bcFormat = textureMetadata->GetBlockCompressedFormat();
326 if (onlyBlockCompressedFormats && bcFormat == ntc::BlockCompressedFormat::None)
327 continue;
328
329 GraphicsResourcesForTexture const& textureResources = graphicsResources.perTexture[textureIndex];
330
331 int mipLevels = allMipLevels ? textureResources.color->getDesc().mipLevels : 1;
332
333 for (int mipLevel = 0; mipLevel < mipLevels; ++mipLevel)
334 {
335 ntc::ReadChannelsIntoTextureParameters params;
336 params.page = page;
337 params.mipLevel = mipLevel;
338 params.firstChannel = textureMetadata->GetFirstChannel();
339 params.numChannels = textureMetadata->GetNumChannels();
340 params.texture = textureResources.sharedTexture;
341 params.textureMipLevel = mipLevel;
342 params.dstRgbColorSpace = textureMetadata->GetRgbColorSpace();
343 params.dstAlphaColorSpace = textureMetadata->GetAlphaColorSpace();
344 params.useDithering = true;
345
346 ntc::Status ntcStatus = textureSet->ReadChannelsIntoTexture(params);
347
348 CHECK_NTC_RESULT("ReadChannelsIntoTexture")
349 }
350 }
351
352 return true;
353}
354

Callers 1

mainFunction · 0.85

Calls 1

GetTextureMethod · 0.80

Tested by

no test coverage detected