Skip to content

Adding bc7 compresstion support#2

Merged
durswd merged 7 commits into
effekseer:masterfrom
xiaoyv404:feat/bc7-support
Apr 12, 2026
Merged

Adding bc7 compresstion support#2
durswd merged 7 commits into
effekseer:masterfrom
xiaoyv404:feat/bc7-support

Conversation

@xiaoyv404
Copy link
Copy Markdown

No description provided.

Copilot AI review requested due to automatic review settings April 11, 2026 06:19
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 TextureFormatType with BC7 and BC7_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.

Comment thread src/LLGI.Base.h
Comment thread src/Metal/LLGI.Metal_Impl.mm
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::BC7 and TextureFormatType::BC7_SRGB (plus to_string() support).
  • Map BC7 formats to Vulkan VkFormat and DX12 DXGI_FORMAT.
  • Map BC7 formats to Metal MTLPixelFormat in 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.

Comment thread src/Vulkan/LLGI.BaseVulkan.cpp
Comment thread src/LLGI.Base.h
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::BC7 and TextureFormatType::BC7_SRGB (plus to_string support).
  • Added BC7<->native format mappings in Vulkan, Metal, and DX12 backends.
  • Updated Vulkan format table iteration to use std::size, and updated GetTextureMemorySize to 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.

Comment thread src/LLGI.Base.h
Comment on lines +262 to 271
BC7,
R8G8B8A8_UNORM_SRGB,
B8G8R8A8_UNORM_SRGB,
BC1_SRGB,
BC2_SRGB,
BC3_SRGB,
BC7_SRGB,
D32,
D24S8,
D32S8,
Comment thread src/LLGI.Base.h Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::BC7 and TextureFormatType::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.

Comment thread src/LLGI.Base.h
Comment on lines 565 to 569
{
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:
@durswd durswd merged commit 200e58c into effekseer:master Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants