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.
| 86 | // linearization. |
| 87 | // TODO: Move this function and the one above to a central location. |
| 88 | DXGI_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 | |
| 113 | void PTImage::createSRV( |
| 114 | const PTRenderer& renderer, PTImage* pImage, const D3D12_CPU_DESCRIPTOR_HANDLE& handle) |
nothing calls this directly
no outgoing calls
no test coverage detected