Adding bc7 compresstion support#2
Conversation
There was a problem hiding this comment.
Pull request overview
Adds BC7 texture compression format support to LLGI’s cross-backend texture format conversion layer so BC7 assets can be used on Vulkan, Metal, and DX12.
Changes:
- Extend
TextureFormatTypewithBC7andBC7_SRGB. - Add BC7 ↔ native-format conversion for Vulkan (
VkFormat) and DX12 (DXGI_FORMAT). - Add BC7 forward conversion for Metal (
MTLPixelFormat) and tidy the namespace close comment.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/LLGI.Base.h |
Adds BC7 / BC7_SRGB to the shared TextureFormatType enum. |
src/Vulkan/LLGI.BaseVulkan.cpp |
Maps BC7 / BC7_SRGB to Vulkan VkFormat equivalents. |
src/DX12/LLGI.BaseDX12.cpp |
Maps BC7 / BC7_SRGB to/from DX12 DXGI_FORMAT equivalents. |
src/Metal/LLGI.Metal_Impl.mm |
Adds Metal MTLPixelFormat mapping for BC7 / BC7_SRGB (forward path). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR introduces BC7 compressed texture format support by extending the engine’s cross-backend texture format enum and wiring BC7/BC7_SRGB conversions for Vulkan, Metal, and DirectX 12.
Changes:
- Add
TextureFormatType::BC7andTextureFormatType::BC7_SRGB(plusto_string()support). - Map BC7 formats to Vulkan
VkFormatand DX12DXGI_FORMAT. - Map BC7 formats to Metal
MTLPixelFormatin both conversion directions.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/Vulkan/LLGI.BaseVulkan.cpp |
Adds BC7/BC7_SRGB entries to the Vulkan format conversion table. |
src/Metal/LLGI.Metal_Impl.mm |
Adds BC7/BC7_SRGB conversion mappings between TextureFormatType and MTLPixelFormat. |
src/LLGI.Base.h |
Extends the texture format enum and stringification for BC7/BC7_SRGB. |
src/DX12/LLGI.BaseDX12.cpp |
Adds BC7/BC7_SRGB conversion mappings between TextureFormatType and DXGI_FORMAT. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR adds BC7 texture format support across the engine’s platform backends (Vulkan/Metal/DX12) by extending the shared TextureFormatType enum, updating backend format-conversion logic, and teaching the core memory-size helper how to size BC-compressed textures.
Changes:
- Added
TextureFormatType::BC7andTextureFormatType::BC7_SRGB(plusto_stringsupport). - Added BC7<->native format mappings in Vulkan, Metal, and DX12 backends.
- Updated Vulkan format table iteration to use
std::size, and updatedGetTextureMemorySizeto compute BC block-compressed sizes.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Vulkan/LLGI.BaseVulkan.cpp | Adds BC7 Vulkan format mappings and uses std::size for safe table iteration. |
| src/Metal/LLGI.Metal_Impl.mm | Adds BC7 mappings for Metal (macOS-only guarded section) and fixes namespace closing comment. |
| src/LLGI.Base.h | Extends the public texture format enum and updates string + memory sizing to cover BC formats incl. BC7. |
| src/DX12/LLGI.BaseDX12.cpp | Adds BC7 mappings to/from DXGI formats. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| BC7, | ||
| R8G8B8A8_UNORM_SRGB, | ||
| B8G8R8A8_UNORM_SRGB, | ||
| BC1_SRGB, | ||
| BC2_SRGB, | ||
| BC3_SRGB, | ||
| BC7_SRGB, | ||
| D32, | ||
| D24S8, | ||
| D32S8, |
There was a problem hiding this comment.
Pull request overview
Adds BC7 / BC7_SRGB texture format support across backends and updates CPU-side texture sizing/copy logic to properly account for row pitch (including block-compressed formats).
Changes:
- Added
TextureFormatType::BC7andTextureFormatType::BC7_SRGB, plus string conversions. - Mapped BC7 formats for Vulkan (
VkFormat), DirectX 12 (DXGI_FORMAT), and Metal (MTLPixelFormat). - Refactored texture memory sizing into
GetTextureRowPitch()/GetTextureRowCount()and updated DX12 upload/capture paths to use them.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/Vulkan/LLGI.BaseVulkan.cpp |
Adds BC7 mappings and fixes format-table iteration using std::size. |
src/Metal/LLGI.Metal_Impl.mm |
Adds BC7 ⇄ MTLPixelFormat conversions. |
src/LLGI.Base.h |
Introduces BC7 enums and new row-pitch/row-count based memory sizing helpers. |
src/DX12/LLGI.TextureDX12.cpp |
Uses new row pitch/count helpers for upload buffer handling. |
src/DX12/LLGI.GraphicsDX12.cpp |
Uses new row pitch/count helpers when copying captured render target data. |
src/DX12/LLGI.BaseDX12.cpp |
Adds BC7 ⇄ DXGI_FORMAT conversions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| { | ||
| case TextureFormatType::R8G8B8A8_UNORM: | ||
| return size.X * size.Y * size.Z * 4; | ||
| case TextureFormatType::B8G8R8A8_UNORM: | ||
| return size.X * size.Y * size.Z * 4; | ||
| case TextureFormatType::R8_UNORM: | ||
| return size.X * size.Y * size.Z * 1; | ||
| case TextureFormatType::R16G16_FLOAT: | ||
| return size.X * size.Y * size.Z * 4; | ||
| case TextureFormatType::R16G16B16A16_FLOAT: | ||
| return size.X * size.Y * size.Z * 8; | ||
| case TextureFormatType::R32G32B32A32_FLOAT: | ||
| return size.X * size.Y * size.Z * 16; | ||
| case TextureFormatType::R8G8B8A8_UNORM_SRGB: |
No description provided.