Closed Andrewfeng123 closed 1 week ago
Dx9 has been dropped. Can you take this opportunity to remove it?
Unfortunately the changes break embedded shaders with BGFX_EMBEDDED_SHADER
when using bgfx_compile_shaders
with AS_HEADERS
:
error: ‘vs_line_spv’ was not declared in this scope; did you mean ‘vs_line_spirv’?
[build] 97 | BGFX_EMBEDDED_SHADER(vs_line), BGFX_EMBEDDED_SHADER(vs_line_instanced),
The headers generate a variable with this naming:
static const uint8_t vs_line_spirv[924] =
but the BGFX_EMBEDDED_SHADER
macro expects vs_line_spv
@bwrsandman Okay I pushed a new commit, please let me know if this works. This is a bit of a hack, but I don't see another way of doing so without changing bgfx.
Currently, the profiles
spirv
andmetal
are abbreviated tospv
andmtl
, which means the compiled shaders are in the directoriesspv
andmtl
. This is different from the convention used in bgfx (seebgfx/examples/runtime
), which leaves them asspirv
andmetal
. Conforming to the bgfx has an added benefit: it is now possible to directly use theloadShader
andloadProgram
functions defined in bgfx_utils (inbgfx/examples/common/
) just like the example programs. This was not possible before since the extensionsspirv
andmetal
were hard-coded into bgfx_utils.Example:
In the
CMakeLists.txt
at the root of the project:In
main.cpp
: