Compare commits
20 Commits
v1.136.913
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 574dd75c69 | |||
|
|
98d6c112a4 | ||
|
|
75700d672a | ||
|
|
c3fa3b0e36 | ||
|
|
668550dc7c | ||
|
|
8cc59b3a23 | ||
|
|
884c624619 | ||
|
|
9ba6a8ae0f | ||
|
|
830133102d | ||
|
|
4a9973b9e3 | ||
|
|
78c265c3c9 | ||
|
|
10a9ed2220 | ||
|
|
26dbcda964 | ||
|
|
4f736eedd5 | ||
|
|
ceacf584eb | ||
|
|
7addeb2643 | ||
|
|
6e2138a920 | ||
|
|
af6a3b1f2f | ||
|
|
f40f4ca580 | ||
|
|
eda300c870 |
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -17,7 +17,7 @@ jobs:
|
||||
env:
|
||||
CMAKE_VERSION: 3.20.0
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Linux dependencies
|
||||
@@ -57,7 +57,7 @@ jobs:
|
||||
CC: ${{ matrix.cc }}
|
||||
CXX: ${{ matrix.cxx }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Linux dependencies
|
||||
@@ -94,7 +94,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Linux dependencies
|
||||
|
||||
6
.github/workflows/format.yml
vendored
6
.github/workflows/format.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
name: cmake-format
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
needs: cmake-format-check
|
||||
if: always() && startsWith(github.event_name, 'pull_request') && needs.cmake-format-check.result == 'failure'
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
repository: ${{ github.event.pull_request.head.repo.full_name }}
|
||||
@@ -45,7 +45,7 @@ jobs:
|
||||
args: --config-files .cmake-format.py --in-place
|
||||
- run: |
|
||||
git diff > cmake-format.patch
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: formatting-fix-${{github.sha}}
|
||||
path: cmake-format.patch
|
||||
|
||||
14
.github/workflows/release.yml
vendored
14
.github/workflows/release.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
sha: ${{ steps.version.outputs.sha }}
|
||||
tag: ${{ steps.version.outputs.tag }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
@@ -51,7 +51,7 @@ jobs:
|
||||
CMAKE_INSTALL_DIR: ${{ github.workspace }}/install/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install Linux dependencies
|
||||
@@ -80,7 +80,7 @@ jobs:
|
||||
- name: Build
|
||||
run: |
|
||||
cmake --build "${{ env.CMAKE_BUILD_DIR }}" --target install --config Release
|
||||
- uses: actions/upload-artifact@v4
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: ${{ matrix.os }}
|
||||
path: ${{ github.workspace }}/install/
|
||||
@@ -93,7 +93,7 @@ jobs:
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
@@ -102,15 +102,15 @@ jobs:
|
||||
find src/bgfx.cmake -name ".git*" -exec rm -rf {} +
|
||||
find src/bgfx.cmake -name ".editorconfig" -delete
|
||||
rm src/bgfx.cmake/.cmake-format.py
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: windows-latest
|
||||
path: ${{ github.workspace }}/install/windows/bgfx.cmake
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: ubuntu-latest
|
||||
path: ${{ github.workspace }}/install/linux/bgfx.cmake
|
||||
- uses: actions/download-artifact@v4
|
||||
- uses: actions/download-artifact@v8
|
||||
with:
|
||||
name: macos-latest
|
||||
path: ${{ github.workspace }}/install/macos/bgfx.cmake
|
||||
|
||||
@@ -45,7 +45,7 @@ cmake_dependent_option(
|
||||
)
|
||||
cmake_dependent_option(BGFX_WITH_WAYLAND "Use Wayland backend." ON "CMAKE_SYSTEM_NAME STREQUAL Linux" OFF)
|
||||
option(BGFX_CUSTOM_TARGETS "Include convenience custom targets." ON)
|
||||
option(BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON)
|
||||
cmake_dependent_option(BGFX_CONFIG_MULTITHREADED "Build bgfx with multithreaded configuration" ON "NOT CMAKE_SYSTEM_NAME STREQUAL Emscripten" OFF)
|
||||
option(BGFX_CONFIG_RENDERER_WEBGPU "Enable the webgpu renderer" OFF)
|
||||
option(BGFX_CONFIG_DEBUG_ANNOTATION "Enable gfx debug annotations (default: on in debug)" OFF)
|
||||
|
||||
|
||||
2
bgfx
2
bgfx
Submodule bgfx updated: 011ede6b42...4481b9b46b
2
bimg
2
bimg
Submodule bimg updated: a0204c79f9...2317bb623a
2
bx
2
bx
Submodule bx updated: 36ad6131f4...c6131ec676
2
cmake/bgfx/3rdparty/spirv-opt.cmake
vendored
2
cmake/bgfx/3rdparty/spirv-opt.cmake
vendored
@@ -110,6 +110,7 @@ file(
|
||||
${SPIRV_TOOLS}/source/val/validate_debug.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_decorations.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_derivatives.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_dot_product.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_execution_limitations.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_extensions.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_function.cpp
|
||||
@@ -130,6 +131,7 @@ file(
|
||||
${SPIRV_TOOLS}/source/val/validate_misc.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_mode_setting.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_non_uniform.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_pipe.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_primitives.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_ray_query.cpp
|
||||
${SPIRV_TOOLS}/source/val/validate_ray_tracing.cpp
|
||||
|
||||
@@ -29,14 +29,7 @@ file(
|
||||
${BGFX_DIR}/include/bgfx/c99/*.h
|
||||
)
|
||||
|
||||
if(APPLE)
|
||||
file(GLOB BGFX_OBJC_SOURCES ${BGFX_DIR}/src/*.mm)
|
||||
list(APPEND BGFX_SOURCES ${BGFX_OBJC_SOURCES})
|
||||
list(REMOVE_ITEM BGFX_SOURCES ${BGFX_DIR}/src/amalgamated.cpp)
|
||||
set(BGFX_AMALGAMATED_SOURCE ${BGFX_DIR}/src/amalgamated.mm)
|
||||
else()
|
||||
set(BGFX_AMALGAMATED_SOURCE ${BGFX_DIR}/src/amalgamated.cpp)
|
||||
endif()
|
||||
set(BGFX_AMALGAMATED_SOURCE ${BGFX_DIR}/src/amalgamated.cpp)
|
||||
|
||||
if(BGFX_AMALGAMATED)
|
||||
set(BGFX_NOBUILD ${BGFX_SOURCES})
|
||||
@@ -59,7 +52,6 @@ endif()
|
||||
|
||||
if(BGFX_CONFIG_RENDERER_WEBGPU)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/3rdparty/webgpu.cmake)
|
||||
target_compile_definitions(bgfx PRIVATE BGFX_CONFIG_RENDERER_WEBGPU=1)
|
||||
if(EMSCRIPTEN)
|
||||
target_link_options(bgfx PRIVATE "-s USE_WEBGPU=1")
|
||||
else()
|
||||
@@ -192,13 +184,6 @@ if(UNIX
|
||||
target_link_libraries(bgfx PUBLIC ${X11_LIBRARIES} ${OPENGL_LIBRARIES})
|
||||
endif()
|
||||
|
||||
# Exclude mm files if not on OS X
|
||||
if(NOT APPLE)
|
||||
set_source_files_properties(${BGFX_DIR}/src/glcontext_eagl.mm PROPERTIES HEADER_FILE_ONLY ON)
|
||||
set_source_files_properties(${BGFX_DIR}/src/glcontext_nsgl.mm PROPERTIES HEADER_FILE_ONLY ON)
|
||||
set_source_files_properties(${BGFX_DIR}/src/renderer_mtl.mm PROPERTIES HEADER_FILE_ONLY ON)
|
||||
endif()
|
||||
|
||||
# Exclude glx context on non-unix
|
||||
if(NOT UNIX OR APPLE)
|
||||
set_source_files_properties(${BGFX_DIR}/src/glcontext_glx.cpp PROPERTIES HEADER_FILE_ONLY ON)
|
||||
@@ -207,10 +192,14 @@ endif()
|
||||
# Put in a "bgfx" folder in Visual Studio
|
||||
set_target_properties(bgfx PROPERTIES FOLDER "bgfx")
|
||||
|
||||
# in Xcode we need to specify this file as objective-c++ (instead of renaming to .mm)
|
||||
# in Xcode we need to specify these files as objective-c++ (instead of renaming to .mm)
|
||||
if(XCODE)
|
||||
set_source_files_properties(
|
||||
${BGFX_DIR}/src/renderer_vk.cpp PROPERTIES LANGUAGE OBJCXX XCODE_EXPLICIT_FILE_TYPE sourcecode.cpp.objcpp
|
||||
${BGFX_DIR}/src/renderer_vk.cpp
|
||||
${BGFX_DIR}/src/renderer_webgpu.cpp
|
||||
PROPERTIES
|
||||
LANGUAGE OBJCXX
|
||||
XCODE_EXPLICIT_FILE_TYPE sourcecode.cpp.objcpp
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -346,6 +346,10 @@ if(BGFX_BUILD_EXAMPLES)
|
||||
45-bokeh
|
||||
46-fsr
|
||||
47-pixelformats
|
||||
48-drawindirect
|
||||
49-hextile
|
||||
50-headless
|
||||
51-gpufont
|
||||
)
|
||||
|
||||
foreach(EXAMPLE ${BGFX_EXAMPLES})
|
||||
|
||||
@@ -1,3 +1 @@
|
||||
#include "@BGFX_DIR@/src/shader.cpp"
|
||||
#include "@BGFX_DIR@/src/shader_dxbc.cpp"
|
||||
#include "@BGFX_DIR@/src/shader_spirv.cpp"
|
||||
|
||||
@@ -39,6 +39,7 @@ target_include_directories(
|
||||
${BGFX_DIR}/3rdparty/dawn/src
|
||||
)
|
||||
|
||||
set(DXCOMPILER_RUNTIME)
|
||||
if(UNIX
|
||||
AND NOT APPLE
|
||||
AND NOT EMSCRIPTEN
|
||||
@@ -50,6 +51,9 @@ if(UNIX
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include
|
||||
${BGFX_DIR}/3rdparty/directx-headers/include/wsl/stubs
|
||||
)
|
||||
set(DXCOMPILER_RUNTIME ${BGFX_DIR}/tools/bin/linux/libdxcompiler.so)
|
||||
elseif(WIN32)
|
||||
set(DXCOMPILER_RUNTIME ${BGFX_DIR}/tools/bin/windows/dxcompiler.dll)
|
||||
endif()
|
||||
|
||||
if(BGFX_AMALGAMATED)
|
||||
@@ -77,3 +81,15 @@ endif()
|
||||
if(BGFX_INSTALL)
|
||||
install(TARGETS shaderc EXPORT "${TARGETS_EXPORT_NAME}" DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
|
||||
# DXIL compiler will be dynamically loaded at runtime - no need
|
||||
# to link, just install the needed binaries alongside shaderc.exe
|
||||
if(DXCOMPILER_RUNTIME)
|
||||
add_custom_command(
|
||||
TARGET shaderc POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DXCOMPILER_RUNTIME} $<TARGET_FILE_DIR:shaderc>
|
||||
)
|
||||
if(BGFX_INSTALL)
|
||||
install(FILES ${DXCOMPILER_RUNTIME} DESTINATION "${CMAKE_INSTALL_BINDIR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -459,16 +459,10 @@ if(TARGET bgfx::shaderc)
|
||||
|
||||
# --define
|
||||
if(ARG_DEFINES)
|
||||
list(APPEND CLI "--defines")
|
||||
set(DEFINES "")
|
||||
foreach(DEFINE ${ARG_DEFINES})
|
||||
if(NOT "${DEFINES}" STREQUAL "")
|
||||
set(DEFINES "${DEFINES}\\\\;${DEFINE}")
|
||||
else()
|
||||
set(DEFINES "${DEFINE}")
|
||||
endif()
|
||||
endforeach()
|
||||
list(APPEND CLI "${DEFINES}")
|
||||
# Add extra escapes or CMake will expand in the final CLI
|
||||
string(REPLACE ";" "\\\\\\;" DEFINES "${ARG_DEFINES}")
|
||||
# Also need to quote escape for Unix shells
|
||||
list(APPEND CLI "--define" "\"${DEFINES}\"")
|
||||
endif()
|
||||
|
||||
# --raw
|
||||
@@ -541,21 +535,25 @@ if(TARGET bgfx::shaderc)
|
||||
|
||||
# extensions consistent with those listed under bgfx/runtime/shaders
|
||||
function(_bgfx_get_profile_path_ext PROFILE PROFILE_PATH_EXT)
|
||||
string(REPLACE 100_es essl PROFILE ${PROFILE})
|
||||
string(REPLACE 300_es essl PROFILE ${PROFILE})
|
||||
string(REPLACE 120 glsl PROFILE ${PROFILE})
|
||||
string(REPLACE s_4_0 dx10 PROFILE ${PROFILE})
|
||||
string(REPLACE s_5_0 dx11 PROFILE ${PROFILE})
|
||||
string(REPLACE 430 glsl PROFILE ${PROFILE})
|
||||
string(REPLACE s_5_0 dxbc PROFILE ${PROFILE})
|
||||
string(REPLACE s_6_0 dxil PROFILE ${PROFILE})
|
||||
set(${PROFILE_PATH_EXT} ${PROFILE} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
# extensions consistent with embedded_shader.h
|
||||
function(_bgfx_get_profile_ext PROFILE PROFILE_EXT)
|
||||
string(REPLACE 100_es essl PROFILE ${PROFILE})
|
||||
string(REPLACE 300_es essl PROFILE ${PROFILE})
|
||||
string(REPLACE 120 glsl PROFILE ${PROFILE})
|
||||
string(REPLACE 430 glsl PROFILE ${PROFILE})
|
||||
string(REPLACE spirv spv PROFILE ${PROFILE})
|
||||
string(REPLACE metal mtl PROFILE ${PROFILE})
|
||||
string(REPLACE s_4_0 dx10 PROFILE ${PROFILE})
|
||||
string(REPLACE s_5_0 dx11 PROFILE ${PROFILE})
|
||||
string(REPLACE s_5_0 dxbc PROFILE ${PROFILE})
|
||||
string(REPLACE s_6_0 dxil PROFILE ${PROFILE})
|
||||
set(${PROFILE_EXT} ${PROFILE} PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
@@ -566,16 +564,25 @@ if(TARGET bgfx::shaderc)
|
||||
# OUTPUT_DIR directory
|
||||
# OUT_FILES_VAR variable name
|
||||
# INCLUDE_DIRS directories
|
||||
# DEFINES defines
|
||||
# [AS_HEADERS]
|
||||
# )
|
||||
#
|
||||
function(bgfx_compile_shaders)
|
||||
set(options AS_HEADERS)
|
||||
set(oneValueArgs TYPE VARYING_DEF OUTPUT_DIR OUT_FILES_VAR)
|
||||
set(multiValueArgs SHADERS INCLUDE_DIRS)
|
||||
set(multiValueArgs SHADERS INCLUDE_DIRS DEFINES)
|
||||
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
|
||||
|
||||
set(PROFILES 120 300_es spirv)
|
||||
set(PROFILES spirv)
|
||||
if(ARGS_TYPE STREQUAL "COMPUTE")
|
||||
list(APPEND PROFILES 430 300_es)
|
||||
else()
|
||||
list(APPEND PROFILES 120 100_es)
|
||||
endif()
|
||||
if(BGFX_CONFIG_RENDERER_WEBGPU)
|
||||
list(APPEND PROFILES wgsl)
|
||||
endif()
|
||||
if(IOS)
|
||||
set(PLATFORM IOS)
|
||||
list(APPEND PROFILES metal)
|
||||
@@ -595,8 +602,8 @@ if(TARGET bgfx::shaderc)
|
||||
OR CYGWIN
|
||||
)
|
||||
set(PLATFORM WINDOWS)
|
||||
list(APPEND PROFILES s_4_0)
|
||||
list(APPEND PROFILES s_5_0)
|
||||
list(APPEND PROFILES s_6_0)
|
||||
elseif(ORBIS) # ORBIS should be defined by a PS4 CMake toolchain
|
||||
set(PLATFORM ORBIS)
|
||||
list(APPEND PROFILES pssl)
|
||||
@@ -625,9 +632,6 @@ if(TARGET bgfx::shaderc)
|
||||
endif()
|
||||
set(OUTPUT ${ARGS_OUTPUT_DIR}/${PROFILE_PATH_EXT}/${SHADER_FILE_BASENAME}.bin${HEADER_PREFIX})
|
||||
set(PLATFORM_I ${PLATFORM})
|
||||
if(PROFILE STREQUAL "spirv")
|
||||
set(PLATFORM_I LINUX)
|
||||
endif()
|
||||
set(BIN2C_PART "")
|
||||
if(ARGS_AS_HEADERS)
|
||||
set(BIN2C_PART BIN2C ${SHADER_FILE_NAME_WE}_${PROFILE_EXT})
|
||||
@@ -635,13 +639,14 @@ if(TARGET bgfx::shaderc)
|
||||
_bgfx_shaderc_parse(
|
||||
CLI #
|
||||
${BIN2C_PART} #
|
||||
${ARGS_TYPE} ${PLATFORM_I} WERROR "$<$<CONFIG:debug>:DEBUG>$<$<CONFIG:relwithdebinfo>:DEBUG>"
|
||||
${ARGS_TYPE} ${PLATFORM_I} "$<$<CONFIG:Debug,RelWithDebInfo>:DEBUG>"
|
||||
FILE ${SHADER_FILE_ABSOLUTE}
|
||||
OUTPUT ${OUTPUT}
|
||||
PROFILE ${PROFILE}
|
||||
O "$<$<CONFIG:debug>:0>$<$<CONFIG:release>:3>$<$<CONFIG:relwithdebinfo>:3>$<$<CONFIG:minsizerel>:3>"
|
||||
O "$<IF:$<CONFIG:Debug>,0,3>"
|
||||
VARYINGDEF ${ARGS_VARYING_DEF}
|
||||
INCLUDES ${BGFX_SHADER_INCLUDE_PATH} ${ARGS_INCLUDE_DIRS}
|
||||
DEFINES ${ARGS_DEFINES}
|
||||
)
|
||||
list(APPEND OUTPUTS ${OUTPUT})
|
||||
list(APPEND ALL_OUTPUTS ${OUTPUT})
|
||||
|
||||
2
cmake/bimg/3rdparty/miniz.cmake
vendored
2
cmake/bimg/3rdparty/miniz.cmake
vendored
@@ -19,5 +19,5 @@ if(NOT MINIZ_LIBRARIES)
|
||||
MINIZ_SOURCES #
|
||||
${BIMG_DIR}/3rdparty/tinyexr/deps/miniz/miniz.* #
|
||||
)
|
||||
set(MINIZ_INCLUDE_DIR ${BIMG_DIR}/3rdparty/tinyexr/deps/miniz)
|
||||
set(MINIZ_INCLUDE_DIR ${BIMG_DIR}/3rdparty/tinyexr/deps)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user