Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedding shader resources #71

Merged
merged 10 commits into from
Aug 10, 2022
Merged

Embedding shader resources #71

merged 10 commits into from
Aug 10, 2022

Conversation

crud89
Copy link
Owner

@crud89 crud89 commented Aug 10, 2022

Describe the pull request

This PR allows to embed shaders as binary resources into executables. For this, the CMake support for shaders has been extended. It is now possible to define one or more shader libraries, which translate to a header file for each library. Those can be included anywhere in the project. Shader modules can be added to a library, which results in a class to be created for them. The class name derives from the shader module name, where . and : characters are replaced by _.

A shader library header is private. If a shader resource should be made available to dependent projects (as in #54), a public interface granting access to the resource must be manually defined.

Shader modules can now be loaded from streams. The shader program builder API has been extended to support this, too.

As a result, the blitting compute shader required by the DirectX 12 backend is now embedded. This way, no manual copies are required for dependent projects for this shader.

Related issues

@crud89 crud89 added Priority: Medium A issue with normal priority. Type: Feature Request New feature or request. Type: Requirement An implementation is required before the next release. Module: Vulkan 🌋 The issue involves the Vulkan backend. Module: DX12 ❎ The issue involves the DX12 backend. labels Aug 10, 2022
@crud89 crud89 added this to the Alpha #03 milestone Aug 10, 2022
@crud89 crud89 self-assigned this Aug 10, 2022
@crud89 crud89 marked this pull request as ready for review August 10, 2022 13:04
@crud89 crud89 added the Module: Build 🛠 Issues that involve the build process. label Aug 10, 2022
@crud89 crud89 merged commit c9d1490 into main Aug 10, 2022
@crud89 crud89 deleted the embed-shaders branch August 10, 2022 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: Build 🛠 Issues that involve the build process. Module: DX12 ❎ The issue involves the DX12 backend. Module: Vulkan 🌋 The issue involves the Vulkan backend. Priority: Medium A issue with normal priority. Type: Feature Request New feature or request. Type: Requirement An implementation is required before the next release.
Projects
Status: v0.3.1
Development

Successfully merging this pull request may close these issues.

Allow shaders to be embedded into binaries. Allow loading shaders modules from streams.
1 participant