LukasBanana / LLGL

Low Level Graphics Library (LLGL) is a thin abstraction layer for the modern graphics APIs OpenGL, Direct3D, Vulkan, and Metal
BSD 3-Clause "New" or "Revised" License
2.03k stars 135 forks source link

Move D3D builtin shaders from being DLL resources to being bytecode objects. #95

Closed gdianaty closed 1 year ago

gdianaty commented 1 year ago

The Problem

As of now, when LLGL is built as static (LLGL_BUILD_STATIC_LIB) it is unable to perform any mip computations. This is because LLGL's mip generation functionality uses a compute shader to achieve mip generation.

This is because the Windows Resource Compiler is not honored by the MSVC Librarian and is therefore lost at compile-time. Static versions of the library don't have access to the shader bytecode.

The (Proposed) Solution

Move shader bytecode to a header (/Fh). This way it's included in static versions of the library. With this edit made, all examples run as expected and mip generation occurs as if the library was included as a dynamic library.

LukasBanana commented 1 year ago

Thanks for fixing this 👍