MCPcopy Create free account
hub / github.com/Autodesk/Aurora / getDXFormat

Method getDXFormat

Libraries/Aurora/Source/DirectX/PTImage.cpp:88–111  ·  view source on GitHub ↗

Gets the corresponding DXGI format for the specified IImage format, optionally with sRGB linearization. TODO: Move this function and the one above to a central location.

Source from the content-addressed store, hash-verified

86// linearization.
87// TODO: Move this function and the one above to a central location.
88DXGI_FORMAT PTImage::getDXFormat(ImageFormat format, bool linearize)
89{
90 switch (format)
91 {
92 case ImageFormat::Integer_RGBA:
93 return linearize ? DXGI_FORMAT_R8G8B8A8_UNORM_SRGB : DXGI_FORMAT_R8G8B8A8_UNORM;
94 case ImageFormat::Float_R:
95 return DXGI_FORMAT_R32_FLOAT;
96 case ImageFormat::Float_RGB:
97 return DXGI_FORMAT_R32G32B32_FLOAT;
98 case ImageFormat::Float_RGBA:
99 return DXGI_FORMAT_R32G32B32A32_FLOAT;
100 case ImageFormat::Half_RGBA:
101 return DXGI_FORMAT_R16G16B16A16_FLOAT;
102 case ImageFormat::Short_RGBA:
103 return DXGI_FORMAT_R16G16B16A16_UNORM;
104 case ImageFormat::Integer_RG:
105 return DXGI_FORMAT_R32G32_UINT;
106 case ImageFormat::Byte_R:
107 return DXGI_FORMAT_R8_UNORM;
108 }
109
110 return DXGI_FORMAT_UNKNOWN;
111}
112
113void PTImage::createSRV(
114 const PTRenderer& renderer, PTImage* pImage, const D3D12_CPU_DESCRIPTOR_HANDLE& handle)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected