Code Monkey home page Code Monkey logo

fips-bgfx's Introduction

fips-bgfx

Build Status

fipsified version of bgfx (https://github.com/bkaradzic/bgfx)

Get fips and clone fips-bgfx:

> mkdir fips-workspace
> cd fips-workspace
> git clone [email protected]:floooh/fips.git
> cd fips
> ./fips clone fips-bgfx
> cd ../fips-bgfx

Build and run on command line:

Build a debug config with xcodebuild (the default build config on OSX):

> ./fips build
> ./fips list targets
> ./fips run 00-helloworld
> ./fips run 01-cubes
...

Nicer command line builds with make or ninja:

# with make:
> ./fips set config osx-make-release
> ./fips build
> ./fips run 00-helloworld
# with ninja:
> ./fips set config osx-ninja-release
> ./fips build
> ./fips run 00-helloworld
...
> ./fips unset config

Work in Xcode:

> ./fips unset config
> ./fips open
[this should open Xcode and load the fips-bgfx project]

Most demos require the current working directory set to fips-bgfx/bgfx/examples/runtime, do this in Xcode by selecting the build target (e.g. 01-cubes), go to 'Edit Scheme... -> Options -> Working Directory'.

See fips-bgfx/fips.yml for the list of demos that require the working directory to be set.

Test for emscripten:

Only one sample currently works on emscripten, '17-drawstress':

# setup emscripten SDK for fips if not done before:
> ./fips setup emscripten
# check if all required tools are there (e.g. python2):
> ./fips diag tools
...
# select emscripten build config, configure, build and run
> ./fips set config emsc-make-release
# enable emscripten FS (FileSystem) module, in ccmake,
# find the FIPS_EMSCRIPTEN_USE_FS option, and set it to ON,
# then press (c)onfigure and (g)enerate:
> ./fips config
...
> ./fips make 17-drawstress
> ./fips run 17-drawstress

Once the browser opens you may have to refresh (F5) if the sample doesn't load immediately.

Known Issues

No Shader Code Generation for DirectX on non-Windows platforms

Shader code generation doesn't work fully because the bgfx shader compiler cannot create HLSL shader on non-windows platforms, the result will mess up the generated xxx.bin.h files checked in the source tree, so it's better to not commit generated files or generate them on windows if there is a need to commit them.

Samples

Some samples does not work on all platforms. Most specifically Emscripten and PNaCL does not support the following samples:

- 13-stencil
- 14-shadowvolumes
- 16-shadowmaps

For missing bx::CtrFileReader or equivalent implementation (see BX_CONFIG_CRT_FILE_READER_WRITER).

fips-bgfx's People

Contributors

floooh avatar fungos avatar jaynus avatar kochol avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fips-bgfx's Issues

Does not compile with latest bgfx

I've been trying to make it work with latest bgfx but without any fortune. I've fixed the compiling of texturec by adding a new iqa lib, but have no idea how to solve the compiling of shaderc, which has a new glslang dependency.

Can't build under macOS

I followed the steps in the README. After building, I get this error message.

/Users/gmisail/Desktop/Projects/Junior/CPP/CRay/fips-workspace/fips-bgfx/bgfx/3rdparty/etc2/ProcessRGB.cpp:208:53: error: 
      member reference base type 'v4i' (aka 'uint16 [4]') is not a structure or
      union
        __m128i d = _mm_loadu_si128((__m128i*)a[i*2].data());
                                              ~~~~~~^~~~~
/Users/gmisail/Desktop/Projects/Junior/CPP/CRay/fips-workspace/fips-bgfx/bgfx/3rdparty/etc2/ProcessRGB.cpp:225:44: error: 
      member reference base type 'v4i' (aka 'uint16 [4]') is not a structure or
      union
        _mm_storeu_si128((__m128i*)a[4+i*2].data(), a0);
                                   ~~~~~~~~^~~~~
/Users/gmisail/Desktop/Projects/Junior/CPP/CRay/fips-workspace/fips-bgfx/bgfx/3rdparty/etc2/ProcessRGB.cpp:230:53: error: 
      member reference base type 'v4i' (aka 'uint16 [4]') is not a structure or
      union
        __m128i d = _mm_loadu_si128((__m128i*)a[i*2].data());
                                              ~~~~~~^~~~~
/Users/gmisail/Desktop/Projects/Junior/CPP/CRay/fips-workspace/fips-bgfx/bgfx/3rdparty/etc2/ProcessRGB.cpp:237:42: error: 
      member reference base type 'v4i' (aka 'uint16 [4]') is not a structure or
      union
        _mm_storeu_si128((__m128i*)a[i*2].data(), t2);
                                   ~~~~~~^~~~~
4 errors generated.

** BUILD FAILED **


The following build commands failed:
	CompileC /Users/gmisail/Desktop/Projects/Junior/CPP/CRay/fips-workspace/fips-build/fips-bgfx/osx-xcode-debug/fips-bgfx.build/Debug/bgfx-etc2.build/Objects-normal/x86_64/ProcessRGB.o bgfx/3rdparty/etc2/ProcessRGB.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
[ERROR] Failed to build config 'osx-xcode-debug' of project 'fips-bgfx'

I am running macOS 10.12.4.

"bgfx shaderc not found" in a clean build

I was trying to create a simple project just to try fips and bgfx out.

I get the following error when doing a clean build (fips build in the mytest directory with nothing else in the fips-workspace directory):
"[ERROR] bgfx shaderc executable not found, please run 'make tools' in bgfx directory:"

InitializeBuildStatus:
  Touching "x64\Debug\ALL_GENERATE\ALL_GENERATE.tlog\unsuccessfulbuild".
CustomBuild:
  Building Custom Rule C:/dev/practice/fips/fips-workspace/fips-bgfx/CMakeLists.txt
  CMake does not need to re-run because C:\dev\practice\fips\fips-workspace\fips-build\mytest\win64-vstudio-debug\fips-
  bgfx_bgfx\CMakeFiles\generate.stamp is up-to-date.
  [ERROR] bgfx shaderc executable not found, please run 'make tools' in bgfx directory:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exi
ted with code 10. [C:\dev\practice\fips\fips-workspace\fips-build\mytest\win64-vstudio-debug\fips-bgfx_bgfx\ALL_GENERAT
E.vcxproj]
Done Building Project "C:\dev\practice\fips\fips-workspace\fips-build\mytest\win64-vstudio-debug\fips-bgfx_bgfx\ALL_GEN
ERATE.vcxproj" (default targets) -- FAILED.

CMakeLists.txt:

cmake_minimum_required(VERSION 2.8)
get_filename_component(FIPS_ROOT_DIR "../fips" ABSOLUTE)
include("${FIPS_ROOT_DIR}/cmake/fips.cmake")
fips_setup(PROJECT mytest)
fips_begin_app(foo cmdline)
    fips_src(src)
    fips_deps(bgfx bgfx-examples-common)
fips_end_app()
fips_finish()

src directory simply contains helloworld.cpp and logo.h from the bgfx 00-helloworld example.

This is easily fixed by doing fips build in the fips-bgfx directory, but is it possible to avoid the extra step? (I like the idea of git clone, fips build, done.)

Running the samples with proper cwd doesn't work any longer

I'm not able to run the samples on OSX, even with manually set current working dir from Xcode, any idea what's up with that @fungos ?

PS: samples that need to load files that is... others work fine...

I also get a compile error on Windows in the samples in examples/common/entry/dbg.cpp, may be the current version of bgfx is a bit unstable...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.