Skip to content

Commit

Permalink
Merge pull request #5 from q4a/bgfx-2022
Browse files Browse the repository at this point in the history
Update bgfx and use SPIRV
  • Loading branch information
gamedolphin authored Jun 27, 2022
2 parents 0cf1932 + ee6a7e3 commit a33a342
Show file tree
Hide file tree
Showing 10 changed files with 475 additions and 10 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on: [push, pull_request]

jobs:
build-linux:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup
run: |
git submodule update --init --recursive
- name: Install deps
run: |
sudo apt-get update &&
sudo apt-get install -y libsdl2-dev libgl1-mesa-dev x11proto-core-dev libx11-dev
- name: Build bgfx
run: |
cd bgfx
make -j$(nproc) linux-release64
- name: Build sample
run: |
make all
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[submodule "bgfx"]
path = bgfx
url = git://github.com/bkaradzic/bgfx.git
url = https://github.com/bkaradzic/bgfx
[submodule "bimg"]
path = bimg
url = git://github.com/bkaradzic/bimg.git
url = https://github.com/bkaradzic/bimg
[submodule "bx"]
path = bx
url = git://github.com/bkaradzic/bx.git
url = https://github.com/bkaradzic/bx
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ CC = g++

# COMPILER_FLAGS specifies the additional compilation options we're using
# -w suppresses all warnings
COMPILER_FLAGS = -w
COMPILER_FLAGS = -w -DBX_CONFIG_DEBUG=0

BGFX_HEADERS = -Ibgfx/include -Ibx/include -Ibimg/include

Expand All @@ -16,13 +16,15 @@ all : main.cpp
-f v_simple.sc \
-o v_simple.bin \
--platform linux \
-p spirv \
--type vertex \
--verbose \
-i bgfx/src
./bgfx/.build/linux64_gcc/bin/shadercRelease \
-f f_simple.sc \
-o f_simple.bin \
--platform linux \
-p spirv \
--type fragment \
--verbose \
-i bgfx/src
Expand Down
2 changes: 1 addition & 1 deletion bgfx
Submodule bgfx updated 8385 files
2 changes: 1 addition & 1 deletion bimg
Submodule bimg updated 45 files
+2 −1 .appveyor.yml
+4 −9 .editorconfig
+0 −32 .travis.yml
+1 −0 3rdparty/astc-codec/src/base/string_utils.h
+54 −170 3rdparty/astc/astc_lib.cpp
+4 −2 3rdparty/astc/astc_lib.h
+9 −9 3rdparty/astc/mathlib.cpp
+1 −1 3rdparty/astc/mathlib.h
+14 −14 3rdparty/astc/vectypes.h
+21 −0 3rdparty/lodepng/LICENSE
+0 −10 3rdparty/lodepng/README.md
+2,876 −2,690 3rdparty/lodepng/lodepng.cpp
+327 −141 3rdparty/lodepng/lodepng.h
+2 −2 3rdparty/nvtt/nvcore/nvcore.h
+4 −2 3rdparty/nvtt/nvcore/posh.h
+2 −2 3rdparty/nvtt/nvtt.cpp
+907 −334 3rdparty/stb/stb_image.h
+52 −48 3rdparty/stb/stb_image_resize.h
+735 −137 3rdparty/stb/stb_image_write.h
+393 −99 3rdparty/tinyexr/README.md
+196 −0 3rdparty/tinyexr/deps/miniz/ChangeLog.md
+22 −0 3rdparty/tinyexr/deps/miniz/LICENSE
+7,733 −0 3rdparty/tinyexr/deps/miniz/miniz.c
+1,350 −0 3rdparty/tinyexr/deps/miniz/miniz.h
+34 −0 3rdparty/tinyexr/deps/miniz/readme.md
+2,774 −7,456 3rdparty/tinyexr/tinyexr.h
+1 −1 LICENSE
+2 −3 README.md
+4 −2 include/bimg/bimg.h
+2 −2 include/bimg/decode.h
+6 −2 include/bimg/encode.h
+47 −56 makefile
+6 −2 scripts/bimg.lua
+4 −2 scripts/bimg_decode.lua
+17 −2 scripts/bimg_encode.lua
+3 −5 scripts/genie.lua
+5 −5 scripts/texturec.lua
+40 −3 src/bimg_p.h
+59 −0 src/config.h
+806 −558 src/image.cpp
+10 −8 src/image_cubemap_filter.cpp
+141 −19 src/image_decode.cpp
+31 −14 src/image_encode.cpp
+3 −3 src/image_gnf.cpp
+65 −50 tools/texturec/texturec.cpp
2 changes: 1 addition & 1 deletion bx
Submodule bx updated 139 files
3 changes: 3 additions & 0 deletions f_simple.sc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
$input v_color0

#include <bgfx_shader.sh>
#include "shaderlib.sh"

void main()
{
gl_FragColor = v_color0;
Expand Down
7 changes: 4 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include <stdio.h>
#include <SDL2/SDL.h>
#include <fstream>

#include <bx/math.h>
#include <bgfx/bgfx.h>
#include <bgfx/platform.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_syswm.h>
#include <fstream>
#include <bx/math.h>


SDL_Window* window = NULL;
Expand Down
Loading

0 comments on commit a33a342

Please sign in to comment.