mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-17 21:12:35 +01:00
Compare commits
6 Commits
v1.128.883
...
v1.129.886
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf79284dad | ||
|
|
06144dcb9b | ||
|
|
3b5115516c | ||
|
|
ef0ed485c5 | ||
|
|
2c33050257 | ||
|
|
b12eb2882a |
2
.github/workflows/format.yml
vendored
2
.github/workflows/format.yml
vendored
@@ -45,7 +45,7 @@ jobs:
|
||||
args: --config-files .cmake-format.py --in-place
|
||||
- run: |
|
||||
git diff > cmake-format.patch
|
||||
- uses: actions/upload-artifact@v2
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: formatting-fix-${{github.sha}}
|
||||
path: cmake-format.patch
|
||||
|
||||
@@ -94,7 +94,7 @@ bgfx_compile_shaders(
|
||||
SHADERS filenames
|
||||
VARYING_DEF filename
|
||||
OUTPUT_DIR directory
|
||||
[AS_HEADER]
|
||||
[AS_HEADERS]
|
||||
)
|
||||
```
|
||||
This defines a shaderc command to generate binaries or headers for a number of `TYPE` shaders with `SHADERS` files and `VARYING_DEF` file in the `OUTPUT_DIR` directory. There will be one generated shader for each supported rendering API on this current platform according to the `BGFX_EMBEDDED_SHADER` macro in `bgfx/embedded_shader.h` for headers and in the directory expected by `load_shader` in `bgfx_utils.h`.
|
||||
@@ -110,14 +110,14 @@ bgfx_compile_shaders(
|
||||
SHADERS vs.sc
|
||||
VARYING_DEF varying.def.sc
|
||||
OUTPUT_DIR ${CMAKE_BINARY_DIR}/include/generated/shaders
|
||||
AS_HEADER
|
||||
AS_HEADERS
|
||||
)
|
||||
bgfx_compile_shader_to_header(
|
||||
bgfx_compile_shaders(
|
||||
TYPE FRAGMENT
|
||||
SHADERS fs.sc
|
||||
VARYING_DEF ${CMAKE_SOURCE_DIR}/varying.def.sc
|
||||
OUTPUT_DIR ${CMAKE_BINARY_DIR}/include/generated/shaders
|
||||
AS_HEADER
|
||||
AS_HEADERS
|
||||
)
|
||||
|
||||
add_library(myLib main.cpp vs.sc fs.sc)
|
||||
|
||||
2
bgfx
2
bgfx
Submodule bgfx updated: cc789e83a6...de56398919
2
bimg
2
bimg
Submodule bimg updated: 0d1c78e779...c5c7b6e187
2
bx
2
bx
Submodule bx updated: 2cebc558eb...01c99ddd09
1
cmake/bgfx/3rdparty/spirv-opt.cmake
vendored
1
cmake/bgfx/3rdparty/spirv-opt.cmake
vendored
@@ -129,6 +129,7 @@ file(
|
||||
${SPIRV_TOOLS}/source/val/validate_ray_tracing_reorder.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_scopes.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_small_type_uses.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_tensor_layout.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_type.cpp
|
||||
${SPIRV_TOOLS}/source/val/validation_state.cpp
|
||||
)
|
||||
|
||||
@@ -364,7 +364,7 @@ if(TARGET bgfx::shaderc)
|
||||
# FILE filename
|
||||
# OUTPUT filename
|
||||
# FRAGMENT|VERTEX|COMPUTE
|
||||
# ANDROID|ASM_JS|IOS|LINUX|NACL|OSX|WINDOWS
|
||||
# ANDROID|ASM_JS|IOS|LINUX|OSX|WINDOWS|ORBIS
|
||||
# PROFILE profile
|
||||
# [O 0|1|2|3]
|
||||
# [VARYINGDEF filename]
|
||||
@@ -382,7 +382,7 @@ if(TARGET bgfx::shaderc)
|
||||
function(_bgfx_shaderc_parse ARG_OUT)
|
||||
cmake_parse_arguments(
|
||||
ARG
|
||||
"DEPENDS;ANDROID;ASM_JS;IOS;LINUX;NACL;OSX;WINDOWS;PREPROCESS;RAW;FRAGMENT;VERTEX;COMPUTE;VERBOSE;DEBUG;DISASM;WERROR"
|
||||
"DEPENDS;ANDROID;ASM_JS;IOS;LINUX;OSX;WINDOWS;ORBIS;PREPROCESS;RAW;FRAGMENT;VERTEX;COMPUTE;VERBOSE;DEBUG;DISASM;WERROR"
|
||||
"FILE;OUTPUT;VARYINGDEF;BIN2C;PROFILE;O"
|
||||
"INCLUDES;DEFINES"
|
||||
${ARGN}
|
||||
@@ -423,7 +423,7 @@ if(TARGET bgfx::shaderc)
|
||||
|
||||
# --platform
|
||||
set(PLATFORM "")
|
||||
set(PLATFORMS "ANDROID;ASM_JS;IOS;LINUX;NACL;OSX;WINDOWS")
|
||||
set(PLATFORMS "ANDROID;ASM_JS;IOS;LINUX;OSX;WINDOWS;ORBIS")
|
||||
foreach(P ${PLATFORMS})
|
||||
if(ARG_${P})
|
||||
if(PLATFORM)
|
||||
@@ -436,20 +436,20 @@ if(TARGET bgfx::shaderc)
|
||||
if(PLATFORM STREQUAL "")
|
||||
message(SEND_ERROR "Call to _bgfx_shaderc_parse() must have a platform flag: ${PLATFORMS}")
|
||||
return()
|
||||
elseif(PLATFORM STREQUAL ANDROID)
|
||||
elseif(PLATFORM STREQUAL "ANDROID")
|
||||
list(APPEND CLI "--platform" "android")
|
||||
elseif(PLATFORM STREQUAL ASM_JS)
|
||||
elseif(PLATFORM STREQUAL "ASM_JS")
|
||||
list(APPEND CLI "--platform" "asm.js")
|
||||
elseif(PLATFORM STREQUAL IOS)
|
||||
elseif(PLATFORM STREQUAL "IOS")
|
||||
list(APPEND CLI "--platform" "ios")
|
||||
elseif(PLATFORM STREQUAL NACL)
|
||||
list(APPEND CLI "--platform" "nacl")
|
||||
elseif(PLATFORM STREQUAL OSX)
|
||||
elseif(PLATFORM STREQUAL "OSX")
|
||||
list(APPEND CLI "--platform" "osx")
|
||||
elseif(PLATFORM STREQUAL UNIX)
|
||||
elseif(PLATFORM STREQUAL "LINUX")
|
||||
list(APPEND CLI "--platform" "linux")
|
||||
elseif(PLATFORM STREQUAL WINDOWS)
|
||||
elseif(PLATFORM STREQUAL "WINDOWS")
|
||||
list(APPEND CLI "--platform" "windows")
|
||||
elseif(PLATFORM STREQUAL "ORBIS")
|
||||
list(APPEND CLI "--platform" "orbis")
|
||||
endif()
|
||||
|
||||
# --preprocess
|
||||
@@ -576,7 +576,12 @@ if(TARGET bgfx::shaderc)
|
||||
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
||||
|
||||
set(PROFILES 120 300_es spirv)
|
||||
if(UNIX AND NOT APPLE)
|
||||
if(IOS)
|
||||
set(PLATFORM IOS)
|
||||
list(APPEND PROFILES metal)
|
||||
elseif(ANDROID)
|
||||
set(PLATFORM ANDROID)
|
||||
elseif(UNIX AND NOT APPLE)
|
||||
set(PLATFORM LINUX)
|
||||
elseif(EMSCRIPTEN)
|
||||
set(PLATFORM ASM_JS)
|
||||
@@ -592,6 +597,9 @@ if(TARGET bgfx::shaderc)
|
||||
set(PLATFORM WINDOWS)
|
||||
list(APPEND PROFILES s_4_0)
|
||||
list(APPEND PROFILES s_5_0)
|
||||
elseif(ORBIS) # ORBIS should be defined by a PS4 CMake toolchain
|
||||
set(PLATFORM ORBIS)
|
||||
list(APPEND PROFILES pssl)
|
||||
else()
|
||||
# pssl for Agc and Gnm renderers
|
||||
# nvn for Nvn renderer
|
||||
|
||||
Reference in New Issue
Block a user