Coder Social home page Coder Social logo

facebook / igl Goto Github PK

View Code? Open in Web Editor NEW
2.9K 56.0 169.0 13.82 MB

Intermediate Graphics Library (IGL) is a cross-platform library that commands the GPU. It provides a single low-level cross-platform interface on top of various graphics APIs (e.g. OpenGL, Metal and Vulkan).

License: Other

CMake 1.24% C++ 81.46% Objective-C++ 8.05% Java 0.91% Python 0.02% Objective-C 1.09% Metal 0.02% C 7.21%

igl's Introduction

IGL Logo

Build Status

Intermediate Graphics Library (IGL) is a cross-platform library that commands the GPU. It encapsulates common GPU functionality with a low-level cross-platform interface. IGL is designed to support multiple backends implemented on top of various graphics APIs (e.g. OpenGL, Metal and Vulkan) with a common interface.

There are a lot of good options for abstracting GPU API's; each making different trade-offs. We designed IGL around the following priorities:

  1. Low-level, forward-looking API. IGL embraces modern abstractions (command buffers, state containers, bindless, etc) and is designed to give more control than OpenGL's state machine API. As a result, IGL can have leaner backends for modern API's (e.g. Metal, Vulkan).
  2. Minimal overhead for C++. IGL supports new or existing native rendering code without overhead of language interop or the need for other language runtimes.
  3. Reach + scale in production. IGL has been globally battle-tested for broad device reliability (especially the long-tail of Android devices as well as Quest 2/3/Pro compatibility for OpenGL/Vulkan) and performance-tuned on our apps.

Supported rendering backends

Supported platforms

  • Android
  • iOS
  • Linux
  • macOS
  • Windows
  • WebAssembly

API Support

Windows Linux macOS iOS Android
Vulkan 1.1 ✔️ ✔️ ✔️ (MoltenVK) ✖️ ✔️ (Quest 2/3/Pro)
OpenGL ES 2.0 - 3.0 ✔️ (Angle) ✔️ (Angle) ✔️ ✔️ ✔️
OpenGL ES 3.1 - 3.2 ✔️ (Angle) ✔️ (Angle) ✖️ ✖️ ✔️
OpenGL 3.1 - 4.6 ✔️ ✔️ ✖️ ✖️ ✖️
Metal 2 ✖️ ✖️ ✔️ ✔️ ✖️

Build

Before building, run the deployment scripts:

python3 deploy_content.py
python3 deploy_deps.py

These scripts download external third-party dependencies. Please check Dependencies for the full list.

  • Windows
cd build
cmake .. -G "Visual Studio 17 2022"
  • Linux
sudo apt-get install clang xorg-dev libxinerama-dev libxcursor-dev libgles2-mesa-dev libegl1-mesa-dev libglfw3-dev libglew-dev libstdc++-12-dev
cd build
cmake .. -G "Unix Makefiles"
  • macOS
cd build
cmake .. -G "Xcode" -DIGL_WITH_VULKAN=OFF
  • iOS
cd build
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../third-party/deps/src/ios-cmake/ios.toolchain.cmake -DDEPLOYMENT_TARGET=13.0 -DPLATFORM=OS64
  • Android

The Gradle project is located within the build/android folder.

  • WebAssembly

Please install Emscripten and Ninja.

cd build
emcmake cmake .. -G Ninja
cmake --build .

Screenshots

image

image

License

IGL is released under the MIT license, see LICENSE.md for the full text as well as third-party library acknowledgements. SparkSL Compiler is released under the SparkSL Compiler License, see LICENSE for full text.

igl's People

Contributors

amesingflank avatar arhelmus avatar battleaxevr avatar bpjatfb avatar christophpurrer avatar corporateshark avatar facebook-github-bot avatar francoiscoulombe avatar gnolnuhc avatar johnkearney avatar jwric avatar kalwalt avatar karlll avatar metaandre avatar michaeltay avatar mmaurer avatar mriegger avatar nlutsenko avatar rodrigocastiel avatar rshest avatar rudybear avatar smeenai avatar sodastsai avatar surffer3d avatar syeh1 avatar tgoulart avatar trivedivivek avatar vener91 avatar vinsentli avatar zheap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

igl's Issues

Build issues on Android / OpenXR, runtime assert, and GL ES support on Quest.

Hi, thanks for getting IGL to work (more or less) on Quest.

I have a few issues to report and some comments:

  1. It won't build without modifying the manifest file to be the content of the target, instead of the actual manifest.

image

I get "content not allowed in prolog". This is following the build instructions to the letter.

  1. When I start the app on Quest Pro, I get an assert here:

image

  1. The left/right eyes aren't rendering properly on Quest Pro.

  2. On PC, there are a bunch of asserts in debug mode, several of the apps don't run properly or crash. Only TinyLarge works.

  3. Is there a plan to make GL ES + OpenXR run on Android / Quest?

Or just leave it at Vulkan.

Because I have a third party library that only supports GL ES so far, and a Vulkan-only graphics library is basically just a wrapper and that doesn't add much real value. I don't have time to make this sample work on GL ES myself. It has to do this for me to consider using the IGL library.

I reported several of these issues six months ago and the stereo graphics still don't render properly. I believe it needs more testing.

#41

You needn't consider this as 5 different issues, just one "issue" : please make this sample run properly on Quest, first on Vulkan, and then consider adding GL ES support which I need going forward. If this is too much to ask, fine, I'll just code it myself from scratch.

Cmake compilation definitions not propagating upwards

I'm not sure about this, but shouldn't IGL's cmake compilation definitions such as IGL_BACKEND_ENABLE_OPENGL, IGL_BACKEND_ENABLE_VULKAN, etc. be set on the IGLLibrary target, such that projects that include IGL as a subdirectory can also use the macro definitions which are used in the Macros.h file

Something like this to add compile options to the target

get_directory_property(IGL_DEFS COMPILE_DEFINITIONS )
target_compile_definitions(IGLLibrary INTERFACE ${IGL_DEFS})

Feature request: Enable resource debug labels

  • Please enable setting debug labels to resources such as buffers and textures. On Vulkan this could use VK_EXT_debug_utils extension.
  • Please allow reading the debug label accessible on resources using C++ API as well.
  • Primary purpose is to improve Renderdoc support. Thanks!

Compile Error : Definition of implicit copy constructor for 'vbool' is deprecated

Platform: Mac & Xcode

After having fixed the issue #52, I try to build "HelloWorldSession" on Mac with Xcode, some errors occurred.

Documents/Code/igl/third-party/deps/src/ktx-software/lib/basisu/encoder/cppspmd_sse.h:453:10 Definition of implicit copy constructor for 'vbool' is deprecated because it has a user-provided copy assignment operator

image

How to fix it ?

Unable to run sample applications

I try to run them and I get the following errors:

[bkeys@desktop desktop]$ ./Tiny
[IGL] Error in (void igl::vulkan::VulkanContext::createInstance(const size_t, const char **)).
Vulkan API call failed: /home/bkeys/Devel/igl/src/igl/vulkan/VulkanContext.cpp:303
  ivkCreateInstance(VK_API_VERSION_1_1, config_.enableValidation, config_.enableGPUAssistedValidation, config_.enableSynchronizationValidation, instanceExtensions.size(), instanceExtensions.data(), &vkInstance_)
  VK_ERROR_LAYER_NOT_PRESENT
Tiny: /home/bkeys/Devel/igl/src/igl/vulkan/VulkanContext.cpp:303: void igl::vulkan::VulkanContext::createInstance(const size_t, const char **): Assertion `false' failed.
Aborted (core dumped)

OpenGL based applications do not work either:

[IGL] Error in (void (anonymous namespace)::glfwErrorHandler(int, const char *)).
GLFW Error: GLX: Failed to create context: GLXBadFBConfig

I am running Fedora Workstation 38, on KDE Wayland session.

WebGPU backend?

Is a WebGPU backend planned or in scope for this project?

FB-specific extensions should be optional, not required

Currently XR_FB_SWAPCHAIN_UPDATE_STATE_VULKAN_EXTENSION_NAME is in XrAppImplVulkan::getXrRequiredExtensions(), and thus Vulkan doesn't run on other non-Quest VR headsets.

It works fine on GL ES mode on other headsets though, which don't have this.

For ex: XR_FB_PASSTHROUGH_EXTENSION_NAME is checked in the enumerated list of all supported extensions, but not required:

image

This is the ideal pattern to use for optional or vendor specific features, I think. It's also useful for things like eye- or face-trackingwhich may or may not be enabled by the user thus unavailable, even on Quest Pro.

Issue compiling WebAssembly

As described in the readme i run this command to build the wasm lib:

cd build
emcmake cmake .. -G Ninja
cmake --build .

configurations goes well:

emcmake cmake .. -G Ninja
configure: cmake .. -G Ninja -DCMAKE_TOOLCHAIN_FILE=/home/kalwalt/kalwalt-github/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_CROSSCOMPILING_EMULATOR=/home/kalwalt/kalwalt-github/emsdk/node/16.20.0_64bit/bin/node
-- IGL_WITH_SAMPLES  = ON
-- IGL_WITH_OPENGL    = OFF
-- IGL_WITH_OPENGLES  = OFF
-- IGL_WITH_VULKAN    = OFF
-- IGL_WITH_METAL     = OFF
-- IGL_WITH_WEBGL     = ON
-- IGL_WITH_IGLU      = ON
-- IGL_WITH_SHELL     = OFF
-- IGL_WITH_TESTS     = OFF
-- IGL_WITH_TRACY     = OFF
-- IGL_WITH_TRACY_GPU = OFF
-- IGL_WITH_OPENXR    = OFF
-- IGL_ENFORCE_LOGS   = ON
-- IGL_DEPLOY_DEPS    = ON
-- IGL generator : Ninja
-- IGL build type: 
-- Found Python3: /home/kalwalt/anaconda3/bin/python3.1 (found version "3.11.5") found components: Interpreter 
-- IGL_ROOT_DIR = /home/kalwalt/kalwalt-github/igl
WARNING: Please install the Python packages [paramiko, scp] for full script operation.
--- Using third-party/deps as base directory
--- Using main bootstrap file /home/kalwalt/kalwalt-github/igl/third-party/bootstrap-deps.json
--- WARNING: command hg not found, but required by script
--- WARNING: command svn not found, but required by script
--- Cached state for meshoptimizer equals expected state; skipping library
--- Cached state for glslang equals expected state; skipping library
--- Cached state for SPIRV-Headers equals expected state; skipping library
--- Cached state for tinyobjloader equals expected state; skipping library
--- Cached state for glfw equals expected state; skipping library
--- Cached state for glew equals expected state; skipping library
--- Cached state for stb equals expected state; skipping library
--- Cached state for 3D-Graphics-Rendering-Cookbook equals expected state; skipping library
--- Cached state for bc7enc equals expected state; skipping library
--- Cached state for glm equals expected state; skipping library
--- Cached state for taskflow equals expected state; skipping library
--- Cached state for fmt equals expected state; skipping library
--- Cached state for imgui equals expected state; skipping library
--- Cached state for volk equals expected state; skipping library
--- Cached state for vma equals expected state; skipping library
--- Cached state for tracy equals expected state; skipping library
--- Cached state for gtest equals expected state; skipping library
--- Cached state for EGL equals expected state; skipping library
--- Cached state for ios-cmake equals expected state; skipping library
--- Cached state for spark-sl equals expected state; skipping library
--- Cached state for ktx-software equals expected state; skipping library
--- Cached state for openxr-sdk equals expected state; skipping library
--- Finished
-- Configuring done
-- Generating done

but during the build process i got this error:

[93/119] Building CXX object IGLU/CMak...loader/ktx2/TextureLoaderFactory.cpp.o
FAILED: IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o 
/home/kalwalt/kalwalt-github/emsdk/upstream/emscripten/em++ -DIGL_BACKEND_ENABLE_OPENGL=1 -DIGL_CMAKE_BUILD=1 -DIGL_FORCE_ENABLE_LOGS=1 -DIGL_WITH_IGLU=1 -I/home/kalwalt/kalwalt-github/igl/. -I/home/kalwalt/kalwalt-github/igl/third-party/deps/src/imgui -I/home/kalwalt/kalwalt-github/igl/build_em/IGLU/include -I/home/kalwalt/kalwalt-github/igl/build_em/IGLU/include_texture_loader -I/home/kalwalt/kalwalt-github/igl -I/home/kalwalt/kalwalt-github/igl/src -I/home/kalwalt/kalwalt-github/igl/third-party/deps/src/glm -I/home/kalwalt/kalwalt-github/igl/third-party/deps/src/stb -std=gnu++17 -MD -MT IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o -MF IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o.d -o IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o -c /home/kalwalt/kalwalt-github/igl/IGLU/texture_loader/ktx2/TextureLoaderFactory.cpp
In file included from /home/kalwalt/kalwalt-github/igl/IGLU/texture_loader/ktx2/TextureLoaderFactory.cpp:8:
In file included from /home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx2/TextureLoaderFactory.h:10:
/home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx/TextureLoaderFactory.h:29:23: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
      const ktxTexture* texture) const noexcept = 0;
                      ^
/home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx/TextureLoaderFactory.h:29:23: note: insert '_Nullable' if the pointer may be null
      const ktxTexture* texture) const noexcept = 0;
                      ^
                        _Nullable
/home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx/TextureLoaderFactory.h:29:23: note: insert '_Nonnull' if the pointer should never be null
      const ktxTexture* texture) const noexcept = 0;
                      ^
                        _Nonnull
In file included from /home/kalwalt/kalwalt-github/igl/IGLU/texture_loader/ktx2/TextureLoaderFactory.cpp:8:
/home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx2/TextureLoaderFactory.h:35:66: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
  [[nodiscard]] igl::TextureFormat textureFormat(const ktxTexture* texture) const noexcept final;
                                                                 ^
/home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx2/TextureLoaderFactory.h:35:66: note: insert '_Nullable' if the pointer may be null
  [[nodiscard]] igl::TextureFormat textureFormat(const ktxTexture* texture) const noexcept final;
                                                                 ^
                                                                   _Nullable
/home/kalwalt/kalwalt-github/igl/./IGLU/texture_loader/ktx2/TextureLoaderFactory.h:35:66: note: insert '_Nonnull' if the pointer should never be null
  [[nodiscard]] igl::TextureFormat textureFormat(const ktxTexture* texture) const noexcept final;
                                                                 ^
                                                                   _Nonnull
/home/kalwalt/kalwalt-github/igl/IGLU/texture_loader/ktx2/TextureLoaderFactory.cpp:13:10: fatal error: 'ktx.h' file not found
#include <ktx.h>
         ^~~~~~~
2 warnings and 1 error generated.
em++: error: '/home/kalwalt/kalwalt-github/emsdk/upstream/bin/clang++ -target wasm32-unknown-emscripten -fignore-exceptions -fvisibility=default -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr -DEMSCRIPTEN -I/home/kalwalt/kalwalt-github/emsdk/upstream/emscripten/cache/sysroot/include/SDL --sysroot=/home/kalwalt/kalwalt-github/emsdk/upstream/emscripten/cache/sysroot -Xclang -iwithsysroot/include/compat -DIGL_BACKEND_ENABLE_OPENGL=1 -DIGL_CMAKE_BUILD=1 -DIGL_FORCE_ENABLE_LOGS=1 -DIGL_WITH_IGLU=1 -I/home/kalwalt/kalwalt-github/igl/. -I/home/kalwalt/kalwalt-github/igl/third-party/deps/src/imgui -I/home/kalwalt/kalwalt-github/igl/build_em/IGLU/include -I/home/kalwalt/kalwalt-github/igl/build_em/IGLU/include_texture_loader -I/home/kalwalt/kalwalt-github/igl -I/home/kalwalt/kalwalt-github/igl/src -I/home/kalwalt/kalwalt-github/igl/third-party/deps/src/glm -I/home/kalwalt/kalwalt-github/igl/third-party/deps/src/stb -std=gnu++17 -MD -MT IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o -MF IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o.d -c /home/kalwalt/kalwalt-github/igl/IGLU/texture_loader/ktx2/TextureLoaderFactory.cpp -o IGLU/CMakeFiles/IGLUtexture_loader.dir/texture_loader/ktx2/TextureLoaderFactory.cpp.o' failed (returned 1)
[98/119] Building CXX object IGLU/CMak...ate_pool/RenderPipelineStatePool.cpp.o
ninja: build stopped: subcommand failed.

Maybe i missing some steps?
Thank you, Walter.

I'm trying to build the WASM version with an Ubuntu 22-04 machine without Vulkan ( i have only an integrated GPU intel card)

Can I do persistently mapped buffers?

IBuffer::map() comments give the impression that map() is not a performant path. Are persistently mapped buffers possible? How would I use them?

Thanks!

CMake compile error - set_property could not find TARGET

Platform: Macos
When I run "cmake -G Xcode .. -DIGL_WITH_VULKAN=OFF",some errors occurred

Mac-mini build % cmake -G Xcode .. -DIGL_WITH_VULKAN=OFF
-- The CXX compiler identification is AppleClang 15.0.0.15000040
-- The C compiler identification is AppleClang 15.0.0.15000040
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- IGL_WITH_SAMPLES  = ON
-- IGL_WITH_OPENGL   = ON
-- IGL_WITH_OPENGLES = OFF
-- IGL_WITH_VULKAN   = OFF
-- IGL_WITH_METAL    = ON
-- IGL_WITH_WEBGL    = OFF
-- IGL_WITH_IGLU     = ON
-- IGL_WITH_SHELL    = ON
-- IGL_WITH_TESTS    = OFF
-- IGL_WITH_TRACY    = OFF
-- IGL_ENFORCE_LOGS  = ON
-- IGL_DEPLOY_DEPS   = ON
-- The OBJC compiler identification is AppleClang 15.0.0.15000040
-- Detecting OBJC compiler ABI info
-- Detecting OBJC compiler ABI info - done
-- Check for working OBJC compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- The OBJCXX compiler identification is AppleClang 15.0.0.15000040
-- Detecting OBJCXX compiler ABI info
-- Detecting OBJCXX compiler ABI info - done
-- Check for working OBJCXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- IGL generator : Xcode
-- IGL build type: Debug
-- Found Python3: /Users/chage/anaconda3/bin/python3.10 (found version "3.10.9") found components: Interpreter 
-- IGL_ROOT_DIR = /Users/chage/Documents/Code/igl
--- Using third-party/deps as base directory
--- Using main bootstrap file /Users/chage/Documents/Code/igl/third-party/bootstrap-deps.json
--- Cached state for meshoptimizer equals expected state; skipping library
--- Cached state for glslang equals expected state; skipping library
--- Cached state for tinyobjloader equals expected state; skipping library
--- Cached state for glfw equals expected state; skipping library
--- Cached state for glew equals expected state; skipping library
--- Cached state for stb equals expected state; skipping library
--- Cached state for 3D-Graphics-Rendering-Cookbook equals expected state; skipping library
--- Cached state for bc7enc equals expected state; skipping library
--- Cached state for glm equals expected state; skipping library
--- Cached state for taskflow equals expected state; skipping library
--- Cached state for fmt equals expected state; skipping library
--- Cached state for imgui equals expected state; skipping library
--- Cached state for volk equals expected state; skipping library
--- Cached state for vma equals expected state; skipping library
--- Cached state for tracy equals expected state; skipping library
--- Cached state for gtest equals expected state; skipping library
--- Cached state for EGL equals expected state; skipping library
--- Cached state for ios-cmake equals expected state; skipping library
--- Cached state for spark-sl equals expected state; skipping library
--- Cached state for ktx-software equals expected state; skipping library
--- Finished
-- Found OpenGL: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/System/Library/Frameworks/OpenGL.framework   
Initial BUILD_X64=ON
Initial CMAKE_BUILD_TYPE=Debug
bc7enc build type: Debug
Building 64-bit
-- Found Bash: /bin/bash  
-- Could NOT find Vulkan (missing: Vulkan_LIBRARY Vulkan_INCLUDE_DIR) (found version "")
-- Vulkan SDK not found -> skipping mkvk target (this is harmless; only needed when re-generating of vulkan headers and dfdutils is required)
--   AVX2 backend     - ON
--   SSE4.1 backend   - OFF
--   SSE2 backend     - OFF
--   NEON backend     - OFF
--   NONE backend     - OFF
--   NATIVE backend   - OFF
--   Universal bin    - OFF
--   Invariance       - ON
--   Shared libs      - OFF
--   Decompressor     - OFF
--   Diagnostics      - OFF
--   ASAN             - OFF
--   Unit tests       - OFF
-- Module support is disabled.
-- Version: 9.1.0
-- Build type: Debug
-- CXX_STANDARD: 11
-- Performing Test has_std_11_flag
-- Performing Test has_std_11_flag - Success
-- Performing Test has_std_0x_flag
-- Performing Test has_std_0x_flag - Success
-- Required features: cxx_variadic_templates
-- Performing Test HAS_NULLPTR_WARNING
-- Performing Test HAS_NULLPTR_WARNING - Success
CMake Error at cmake/helpers.cmake:8 (set_property):
  set_property could not find TARGET makedfd2vk.  Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  CMakeLists.txt:259 (igl_set_folder)


CMake Error at cmake/helpers.cmake:8 (set_property):
  set_property could not find TARGET makevk2dfd.  Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  CMakeLists.txt:260 (igl_set_folder)


CMake Error at cmake/helpers.cmake:8 (set_property):
  set_property could not find TARGET mkvk.  Perhaps it has not yet been
  created.
Call Stack (most recent call first):
  CMakeLists.txt:261 (igl_set_folder)


CMake Error at cmake/helpers.cmake:8 (set_property):
  set_property could not find TARGET mkvkformatfiles.  Perhaps it has not yet
  been created.
Call Stack (most recent call first):
  CMakeLists.txt:262 (igl_set_folder)


-- Configuring incomplete, errors occurred!

I'v specified -DIGL_WITH_VULKAN=OFF, how to fix it ?

Is there a fallback for VK when VK_EXT_descriptor_indexing is missing?

Hello, I'm targeting mobile devices where I want Vulkan to be the primary backend. The README states that VK_EXT_descriptor_indexing is required. It seems that this extension does not have a good coverage (<27%) on Android (source: https://vulkan.gpuinfo.org/). am I right to assume that VK will fail for those and therefore need to use a OpenGLES backend or there's alternative/fallback in the VK backend so it'll work but it's up to the user to not use descriptor indexing.

Problem with SPIRV reflection produced by DXC compiler

Hi! I have a problem with spirv relfection in IGL on this line. I have a bunch of RWStructuredBuffers in my shader, and DXC emits spirv for them as uniform+uniformblock decoration. My current solution for this is very dumb:

    const bool isStorage = (id.storageClass == SpvStorageClassUniform ||
                            id.storageClass == SpvStorageClassUniformConstant) && id.dset == 2; // kBindPoint_BuffersStorage
    const bool isUniform = (id.storageClass == SpvStorageClassUniform ||
                           id.storageClass == SpvStorageClassUniformConstant) && id.dset == 1; // kBindPoint_BuffersUniform

and it looks like the real one should use check for SpvDecorationBufferBlock maybe?

Raytracing?

Is raytracing within the scope of this project. Metal, DirectX and Vulkan all seem to have a way to do raytracing. I don't have experience with DirectX since I'm on a Mac, however I have seen the differences between Metal and Vulkan's raytracing API, and it seems that they could map well to each other. Thanks!

github action for WASM compilation

Looking at your github actions, i can't see one dedicated to WASM with Emscripten, would you interested to add it? i mean it would be useful to have at least a test if it fails the main build process.

Oculus Touch controller bindings

Hi, I implemented the Touch controller bindings in my branch, do you want me to make a "clean branch" with just that in it and PR it?

Would this be useful to anyone? IMO a complete "hello world" XR app should show and use VR motion controllers, not just display a rotating cube. Like hello_xr. I haven't added any cubes to draw using the grip or aim pose or anything to the base samples (nor do I plan to), but at least having the bindings set up properly is good to have, right? I have bindings handy for all the other HMDs' controller types: HTC, Pico, Touch Pro controllers, and there are a bunch that are PC only.

image

The current XrApp update loop doesn't call XrSyncActions (in pollActions) so your framework won't support OOTB controllers or other events being polled at all, even if you add those bindings later. I'm not sure TBH if you can even add more bindings after the session is started.

image

If you actually want this PR I'll clean up my code and stuff it in another branch for a clean PR.

I also have Link Sharpening implemented which looks / works great (at least when using only 1 layer).

Doing this work made me realize that the current implementation of XrApp.h vs two XrApp.cpp has a TON of code reuse which is bad practice and results in duplicated work (see #94).

But I can't help but think that if IGL actually is to become useful to many people, the default main branch should have this stuff and generic code shouldn't be duplicated. I'd rather merge the controller bindings PR for just Touch controllers then you can refactor it after to remove duplicated parts that are common. There's no problem adding ex Vive or WMR bindings in a generic way on mobile, even though they are PC-only devices, because the runtime simply picks the best interaction profile to use at runtime. This is how hello_xr works, of course.

OpenXR SDK Source code is almost entirely generic between PC and mobile builds, the main differences are just in the initialization structs, extensions, and of course in their renderer / platform classes. But those are abstracted away (for better or worse, I needed ability to poll the Xr statuses from another thread for async / higher Hz polling rates used for CloudXR, so I made pollActions public and take an argument specifying which thread it's being called from, main or async thread. It could be enabled in both, as those booleans are independent in my code. Use case: when I connect to CloudXR and the async polling starts of controller states, I don't need the local poses updated so I flip that boolean. However, instead of using an enum to pick which, when I enable a locally drawn UI on top of the video stream, I will need both threads to poll their own states, and thus a separate copy of the states for each one. I've implemented this before and this is the only way to avoid dropped button transition events when one thread is polling at say 240 Hz and the main thread at 90 Hz, synchronous to the refresh rate).

How to align buffer?

I want to write to a buffer, which previously has already been written to. In this case, the write offset should be properly aligned, in order to respect buffer offset alignment requirements. I have some questions related to this:

  1. BufferDesc::BufferType type; is documented as GLES only. This does not seem to be accurate: vulkan::Buffer::create() inspects type, and derives VkBufferUsageFlags from it.
  2. IBuffer does not seem to expose buffer type. So how do I know which alignment should I apply to a buffer? At least in GL there is separate alignment values for different buffer target bindings.
  3. How do I figure out different buffer type alignments? Which buffer types DeviceFeatureLimits::BufferAlignment applies to? Does ShaderStorageBufferOffsetAlignment apply to only shader storage buffers? What alignment should I use for uniform buffer offset?
    I wonder if IBuffer should expose buffer type? Or maybe IBuffer could have method to apply necessary offset alignment (size_t in, aligned size_t out)?

Thanks!

sample Tiny_MeshLarge error.

[IGL] Error in (igl::Result igl::opengl::RenderPipelineState::create(const igl::RenderPipelineDesc&)).
Sampler uniform (texSkyboxIrradiance) not found in shader.
[IGL] Error in (igl::Result igl::opengl::RenderPipelineState::create(const igl::RenderPipelineDesc&)).
Sampler uniform (texAlpha) not found in shader.
[IGL] Error in (igl::Result igl::opengl::RenderPipelineState::create(const igl::RenderPipelineDesc&)).
Sampler uniform (texDiffuse) not found in shader.
[IGL] Error in (igl::Result igl::opengl::RenderPipelineState::create(const igl::RenderPipelineDesc&)).
Sampler uniform (texAmbient) not found in shader.
[IGL] Error in (igl::Result igl::opengl::RenderPipelineState::create(const igl::RenderPipelineDesc&)).
Sampler uniform (texShadow) not found in shader.
[IGL] Error in (igl::Result igl::opengl::RenderPipelineState::create(const igl::RenderPipelineDesc&)).
uniform block (MeshMaterials) not found in shader.
[IGL] Error in (igl::Result igl::opengl::ShaderModule::create(const igl::ShaderModuleDesc&)).
failed to compile vertex shader:
0:1(1): error: syntax error, unexpected NEW_IDENTIFIER

IGLU submodule compiled with Emscripten (WASM)

At the moment the IGLU submodule is not compiled to WebAssembly, but in theory it should be possible. As i know, the underlying libraries, imgui ktx and stb can be compiled with Emscripten. The IGLU submodule is necessary for the Tiny_MeshLarge example, so it would be a nice have.
I will report here my progresses and if it make sense i will send a PR.

mobile/XrApp.cpp and desktop/XrApp.cpp are largely redundant and should be combined into a single /src/XrApp

Per subject, the OpenXR client C++ source code should be largely platform-agnostic.

As I've been adding features like Touch controller bindings, body tracking, eye-tracking. I realized there is a lot of duplicate work needed to get it to work on PC and reach parity on mobile. If a feature doesn't work on PC (or vice versa), the instance extension simply won't be enumerated during initialization and the runtime support booleans would remain false.

As we all know. Code duplication is bad, leads to bugs, mismatches, maintenance overhead.

I recommend looking at OpenXR SDK Source's "hello_xr", which uses a single CPP file implementation for all platforms. Platform-specific stuff belongs in their respective abstraction layers, or at most, an ifdef or two.

I don't want to have to duplicate controller bindings that should be exactly the same. Over time XrApp will get larger and larger and the amount of duplicated code (+potential bugs) would increase. Having to add the same code to each XrApp.cpp is already costing me time so it's best if it's moved sooner than later.

Thanks.

WebGPU backend

What are the plans for adding a WebGPU backend to IGL?

Barriers between compute calls

As far as i know, to ensure same memory read write order, user need to insert barrier call between compute dispatches. But i don't see any sign of high level barrier calls in IGL for buffers. This is intentional or kinda bug?

sample "tiny" error

Hi,

I try to compile tiny

a@zalman:~/igl/samples/desktop$  cmake .
CMake Warning (dev) in CMakeLists.txt:
  No project() command is present.  The top-level CMakeLists.txt file must
  contain a literal, direct call to the project() command.  Add a line of
  code such as

    project(ProjectName)

  near the top of the file, but after cmake_minimum_required().

  CMake is pretending there is a "project(Project)" command on the first
  line.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 11.3.0
-- The CXX compiler identification is GNU 11.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:21 (igl_set_cxxstd):
  Unknown CMake command "igl_set_cxxstd".
Call Stack (most recent call first):
  CMakeLists.txt:38 (add_demo)


-- Configuring incomplete, errors occurred!
See also "/home/a/igl/samples/desktop/CMakeFiles/CMakeOutput.log".

How can I do it ?

Node.js deprecation warning in github action

while testing a new build script for Emscripten see issue #67 i noticed this warning:

[cmake-build (Ubuntu - Emscripten, ubuntu-latest, Debug, emcc, em++, Ninja)](https://github.com/kalwalt/igl/actions/runs/7783677004/job/21222620454)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3, actions/cache@v2, SimenB/github-actions-cpu-cores@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.

I think actions/checkout need to be upgraded infact the latest is v4 and the igl scripts use v3.

bootstrap.py does not put filepath in quotes when running scripts

As the title says;
I was in the process of running pre-build steps when it failed due to a directory being cut short ("D:/Programming/Libraries/C++ Libraries/igl" to "D:/Programming/Libraries/C++")
This occurred on the bc7enc part only (Im guessing it was the first third-party project that used python to configure it).
Using Ctrl+F, I found the call to the log function for running scripts, prom there I just threw a bunch of print statements for values on each line, giving me the state and line where the error occurred which was this line.
By inserting escaped quotes on either side of the filename variable, this was fixed for me.

# from
dieIfNonZero(executeCommand(TOOL_COMMAND_PYTHON + " " + filename, False));
# to
dieIfNonZero(executeCommand(TOOL_COMMAND_PYTHON + " \"" + filename + "\"", False));

BufferAPIHintBits questions

  • Why is BufferAPIHintBits::Ring buffer specific to Metal? Functionality similar to Ring could be implemented on top of IBuffer API, so I wonder, are there some benefits of having it directly in IBuffer? But why only Metal?
  • Is BufferAPIHintBits::Bone used for anything? I did one super quick search in igl repo and I did not find any uses.

OpenXR + IGL sample

I'm interested in using IGL for standalone VR (Quest / Pico / HTC), but I'd like to first validate how well it runs in VR on Quest.

I was told that there would be an OpenXR sample forthcoming at some point, is that still the case?

Question about motivations and goals for IGL

Seeing as people are more familiar with the library bgfx for C++ and wgpu for Rust, what's the motivation for starting IGL? does it internally predate both of those libraries?

C API?

Is there a plan to expose a C API to make it easier to use from other languages?

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.