MCPcopy Create free account
hub / github.com/GPUOpen-Effects/TressFX / CreateDebugUAVResource

Method CreateDebugUAVResource

src/DX12/DX12EngineInterfaceImpl.cpp:351–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349
350#ifdef TRESSFX_DEBUG_UAV
351std::unique_ptr<EI_Resource> EI_Device::CreateDebugUAVResource(const int width, const int height, const size_t channels, const int arraySize, const char* name, float ClearValue /*= 0.f*/)
352{
353 EI_Resource* res = new EI_Resource;
354 res->m_ResourceType = EI_ResourceType::Buffer;
355 res->m_pBuffer = new DX12Resource(&m_device);
356
357 DXGI_FORMAT format = DXGI_FORMAT_R32_UINT;
358 switch (channels)
359 {
360 case 4:
361 format = DXGI_FORMAT_R32G32B32A32_FLOAT;
362 break;
363
364 default:
365 // Unsupported ... add whatever you need
366 assert(false);
367 break;
368 }
369
370 res->m_pBuffer->CreateTex2D(format, width, height, arraySize, EI_BF_NEEDSUAV, name);
371
372 return std::unique_ptr<EI_Resource>(res);
373}
374#endif // TRESSFX_DEBUG_UAV
375
376std::unique_ptr<EI_Resource> EI_Device::CreateRenderTargetResource(const int width, const int height, const size_t channels, const size_t channelSize, const char* name, AMD::float4* ClearValues /*= nullptr*/)

Callers

nothing calls this directly

Calls 1

CreateTex2DMethod · 0.80

Tested by

no test coverage detected