Returns the corresponding NVTT compression format for the provided ResourceFormat. This conversion function should be used to convert formats for compressed textures.
| 131 | // Returns the corresponding NVTT compression format for the provided ResourceFormat. This conversion function should be used to convert |
| 132 | // formats for compressed textures. |
| 133 | nvtt::Format convertFormatToNvttFormat(ResourceFormat format) |
| 134 | { |
| 135 | switch (format) |
| 136 | { |
| 137 | case ResourceFormat::BC1Unorm: |
| 138 | case ResourceFormat::BC1UnormSrgb: |
| 139 | return nvtt::Format::Format_BC1; |
| 140 | case ResourceFormat::BC2Unorm: |
| 141 | case ResourceFormat::BC2UnormSrgb: |
| 142 | return nvtt::Format::Format_BC2; |
| 143 | case ResourceFormat::BC3Unorm: |
| 144 | case ResourceFormat::BC3UnormSrgb: |
| 145 | return nvtt::Format::Format_BC3; |
| 146 | case ResourceFormat::BC4Unorm: |
| 147 | return nvtt::Format::Format_BC4; |
| 148 | case ResourceFormat::BC5Snorm: |
| 149 | case ResourceFormat::BC5Unorm: |
| 150 | return nvtt::Format::Format_BC5; |
| 151 | case ResourceFormat::BC6HS16: |
| 152 | return nvtt::Format::Format_BC6S; |
| 153 | case ResourceFormat::BC7Unorm: |
| 154 | case ResourceFormat::BC7UnormSrgb: |
| 155 | return nvtt::Format::Format_BC7; |
| 156 | default: |
| 157 | FALCOR_THROW("No corresponding NVTT compression format for the specified ResourceFormat."); |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // Returns the corresponding NVTT input format for the provided ResourceFormat. Should only be used to convert formats for non-compressed |
| 162 | // textures. |