├── render-hal ├── src │ └── lib.rs └── Cargo.toml ├── render-core ├── src │ ├── debug.rs │ ├── profile.rs │ ├── constants.rs │ ├── lib.rs │ ├── utilities.rs │ ├── modules.rs │ └── backend.rs ├── tests │ ├── compile.rs │ ├── create.rs │ ├── allocator.rs │ ├── format.rs │ ├── system.rs │ ├── utilities.rs │ └── common │ │ └── mod.rs └── Cargo.toml ├── render-hal-dx12 ├── src │ ├── compile.rs │ ├── types.rs │ ├── module.rs │ ├── lib.rs │ └── backend.rs └── Cargo.toml ├── .gitignore ├── nix_run.sh ├── win_run.bat ├── nix_build.sh ├── win_build.bat ├── CHANGES.md ├── render-hal-vk ├── redist │ └── vulkansdk-macos-1.1.85.0 │ │ ├── macOS │ │ ├── lib │ │ │ ├── libvulkan.dylib │ │ │ ├── libvulkan.1.dylib │ │ │ ├── libHLSL.a │ │ │ ├── libSPIRV.a │ │ │ ├── libglslang.a │ │ │ ├── libshaderc.a │ │ │ ├── libMoltenVK.dylib │ │ │ ├── libOGLCompiler.a │ │ │ ├── libOSDependent.a │ │ │ ├── libSPIRV-Tools.a │ │ │ ├── libSPVRemapper.a │ │ │ ├── libspirv-cross.a │ │ │ ├── libSPIRV-Tools-opt.a │ │ │ ├── libSPIRV-Tools-link.a │ │ │ ├── libshaderc_shared.dylib │ │ │ ├── libvulkan.1.1.85.dylib │ │ │ ├── libSPIRV-Tools-shared.dylib │ │ │ ├── libVkLayer_threading.dylib │ │ │ ├── libVkLayer_core_validation.dylib │ │ │ ├── libVkLayer_object_tracker.dylib │ │ │ ├── libVkLayer_unique_objects.dylib │ │ │ ├── libVkLayer_parameter_validation.dylib │ │ │ └── pkgconfig │ │ │ │ ├── SPIRV-Tools-shared.pc │ │ │ │ └── SPIRV-Tools.pc │ │ ├── Frameworks │ │ │ └── vulkan.framework │ │ │ │ ├── Versions │ │ │ │ ├── Current │ │ │ │ └── A │ │ │ │ │ ├── vulkan │ │ │ │ │ ├── Resources │ │ │ │ │ └── Info.plist │ │ │ │ │ └── Headers │ │ │ │ │ ├── vulkan.h │ │ │ │ │ ├── vulkan_vi.h │ │ │ │ │ ├── vulkan_ios.h │ │ │ │ │ ├── vulkan_macos.h │ │ │ │ │ ├── vulkan_xlib_xrandr.h │ │ │ │ │ ├── vk_sdk_platform.h │ │ │ │ │ ├── vulkan_mir.h │ │ │ │ │ ├── vulkan_wayland.h │ │ │ │ │ ├── vulkan_xlib.h │ │ │ │ │ └── vulkan_xcb.h │ │ │ │ ├── Headers │ │ │ │ ├── vulkan │ │ │ │ └── Resources │ │ ├── bin │ │ │ ├── glslc │ │ │ ├── spirv-as │ │ │ ├── spirv-cfg │ │ │ ├── spirv-dis │ │ │ ├── spirv-link │ │ │ ├── spirv-opt │ │ │ ├── spirv-val │ │ │ ├── vulkaninfo │ │ │ ├── spirv-cross │ │ │ ├── spirv-remap │ │ │ ├── spirv-stats │ │ │ ├── glslangValidator │ │ │ └── spirv-lesspipe.sh │ │ ├── include │ │ │ ├── glslang │ │ │ │ ├── Include │ │ │ │ │ ├── revision.h │ │ │ │ │ └── InitializeGlobals.h │ │ │ │ └── MachineIndependent │ │ │ │ │ ├── RemoveTree.h │ │ │ │ │ ├── iomapper.h │ │ │ │ │ ├── propagateNoContraction.h │ │ │ │ │ └── ScanContext.h │ │ │ ├── vulkan │ │ │ │ ├── vulkan.h │ │ │ │ ├── vulkan_vi.h │ │ │ │ ├── vulkan_ios.h │ │ │ │ ├── vulkan_macos.h │ │ │ │ ├── vulkan_xlib_xrandr.h │ │ │ │ ├── vk_sdk_platform.h │ │ │ │ ├── vulkan_mir.h │ │ │ │ ├── vulkan_wayland.h │ │ │ │ ├── vulkan_xlib.h │ │ │ │ └── vulkan_xcb.h │ │ │ └── SPIRV │ │ │ │ ├── GLSL.ext.EXT.h │ │ │ │ ├── disassemble.h │ │ │ │ ├── GLSL.ext.KHR.h │ │ │ │ ├── GlslangToSpv.h │ │ │ │ ├── Logger.h │ │ │ │ ├── SpvTools.h │ │ │ │ ├── GLSL.ext.NV.h │ │ │ │ └── bitutils.h │ │ └── etc │ │ │ └── vulkan │ │ │ ├── icd.d │ │ │ └── MoltenVK_icd.json │ │ │ └── explicit_layer.d │ │ │ ├── VkLayer_unique_objects.json │ │ │ ├── VkLayer_threading.json │ │ │ ├── VkLayer_standard_validation.json │ │ │ ├── VkLayer_object_tracker.json │ │ │ ├── VkLayer_parameter_validation.json │ │ │ └── VkLayer_core_validation.json │ │ ├── MoltenVK │ │ ├── macOS │ │ │ ├── MoltenVK.framework │ │ │ │ ├── Versions │ │ │ │ │ ├── Current │ │ │ │ │ └── A │ │ │ │ │ │ ├── MoltenVK │ │ │ │ │ │ └── Headers │ │ │ │ │ │ └── mvk_vulkan.h │ │ │ │ ├── Headers │ │ │ │ └── MoltenVK │ │ │ ├── libMoltenVK.dylib │ │ │ └── MoltenVK_icd.json │ │ ├── iOS │ │ │ ├── libMoltenVK.dylib │ │ │ ├── MoltenVK.framework │ │ │ │ ├── MoltenVK │ │ │ │ └── Headers │ │ │ │ │ └── mvk_vulkan.h │ │ │ └── MoltenVK_icd.json │ │ └── include │ │ │ ├── MoltenVK │ │ │ └── mvk_vulkan.h │ │ │ └── vulkan │ │ │ ├── vulkan.h │ │ │ ├── vulkan_vi.h │ │ │ ├── vulkan_ios.h │ │ │ ├── vulkan_macos.h │ │ │ ├── vulkan_xlib_xrandr.h │ │ │ ├── vk_sdk_platform.h │ │ │ ├── vulkan_mir.h │ │ │ ├── vulkan_wayland.h │ │ │ ├── vulkan_xlib.h │ │ │ └── vulkan_xcb.h │ │ ├── Applications │ │ ├── cube.app │ │ │ └── Contents │ │ │ │ ├── MacOS │ │ │ │ ├── libvulkan.1.dylib │ │ │ │ ├── cube │ │ │ │ └── libvulkan.1.1.85.dylib │ │ │ │ ├── Resources │ │ │ │ ├── LunarGIcon.icns │ │ │ │ ├── Main.storyboardc │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── MainMenu.nib │ │ │ │ │ ├── XfG-lQ-9wD-view-m2S-Jp-Qdl.nib │ │ │ │ │ └── NSWindowController-B8D-0N-5wS.nib │ │ │ │ └── vulkan │ │ │ │ │ └── icd.d │ │ │ │ │ └── MoltenVK_icd.json │ │ │ │ ├── Frameworks │ │ │ │ └── libMoltenVK.dylib │ │ │ │ └── Info.plist │ │ ├── cubepp.app │ │ │ └── Contents │ │ │ │ ├── MacOS │ │ │ │ ├── libvulkan.1.dylib │ │ │ │ ├── cubepp │ │ │ │ └── libvulkan.1.1.85.dylib │ │ │ │ ├── Resources │ │ │ │ ├── LunarGIcon.icns │ │ │ │ ├── Main.storyboardc │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── MainMenu.nib │ │ │ │ │ ├── XfG-lQ-9wD-view-m2S-Jp-Qdl.nib │ │ │ │ │ └── NSWindowController-B8D-0N-5wS.nib │ │ │ │ └── vulkan │ │ │ │ │ └── icd.d │ │ │ │ │ └── MoltenVK_icd.json │ │ │ │ ├── Frameworks │ │ │ │ └── libMoltenVK.dylib │ │ │ │ └── Info.plist │ │ └── vulkaninfo.app │ │ │ └── Contents │ │ │ ├── MacOS │ │ │ ├── libvulkan.1.dylib │ │ │ ├── vulkaninfo.sh │ │ │ ├── vulkaninfo │ │ │ └── libvulkan.1.1.85.dylib │ │ │ ├── Resources │ │ │ ├── LunarGIcon.icns │ │ │ └── vulkan │ │ │ │ └── icd.d │ │ │ │ └── MoltenVK_icd.json │ │ │ ├── Frameworks │ │ │ └── libMoltenVK.dylib │ │ │ └── Info.plist │ │ └── VERSIONS.txt ├── src │ ├── queue.rs │ ├── raw │ │ ├── memory.rs │ │ ├── mod.rs │ │ ├── buffer.rs │ │ ├── swap_chain.rs │ │ ├── command │ │ │ ├── mod.rs │ │ │ └── fence.rs │ │ └── escape.rs │ ├── shader_views.rs │ ├── module.rs │ ├── debug.rs │ └── lib.rs ├── build.rs └── Cargo.toml ├── Cargo.toml ├── osx_info.sh ├── osx_run.sh ├── osx_build.sh ├── osx_test.sh ├── render-hal-mtl ├── src │ ├── lib.rs │ ├── module.rs │ └── backend.rs └── Cargo.toml ├── render-hal-mock ├── src │ ├── lib.rs │ └── module.rs └── Cargo.toml ├── README.md ├── LICENSE-MIT └── CODE_OF_CONDUCT.md /render-hal/src/lib.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /render-core/src/debug.rs: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /render-core/src/profile.rs: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /render-hal-dx12/src/compile.rs: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /render-hal-dx12/src/types.rs: -------------------------------------------------------------------------------- 1 | // 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | Cargo.lock 3 | **/*.rs.bk 4 | -------------------------------------------------------------------------------- /render-core/tests/compile.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn placeholder() {} 3 | -------------------------------------------------------------------------------- /render-core/tests/create.rs: -------------------------------------------------------------------------------- 1 | #[test] 2 | fn placeholder() {} 3 | -------------------------------------------------------------------------------- /nix_run.sh: -------------------------------------------------------------------------------- 1 | cargo +stable fmt 2 | cargo build --all 3 | cargo run --bin debug -------------------------------------------------------------------------------- /win_run.bat: -------------------------------------------------------------------------------- 1 | cargo +stable fmt 2 | cargo build --all 3 | cargo run --bin debug -------------------------------------------------------------------------------- /nix_build.sh: -------------------------------------------------------------------------------- 1 | cargo +stable fmt 2 | cargo build --all 3 | cargo build --bin debug -------------------------------------------------------------------------------- /win_build.bat: -------------------------------------------------------------------------------- 1 | cargo +stable fmt 2 | cargo build --all 3 | cargo build --bin debug -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | # Changes 2 | 3 | ## 0.1.0 (2019-09-23) 4 | 5 | * First release. 6 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libvulkan.dylib: -------------------------------------------------------------------------------- 1 | libvulkan.1.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/Current: -------------------------------------------------------------------------------- 1 | A -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libvulkan.1.dylib: -------------------------------------------------------------------------------- 1 | libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK.framework/MoltenVK: -------------------------------------------------------------------------------- 1 | Versions/Current/MoltenVK -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Headers: -------------------------------------------------------------------------------- 1 | Versions/Current/Headers -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/vulkan: -------------------------------------------------------------------------------- 1 | Versions/Current/vulkan -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Resources: -------------------------------------------------------------------------------- 1 | Versions/Current/Resources -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/MacOS/libvulkan.1.dylib: -------------------------------------------------------------------------------- 1 | libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/MacOS/libvulkan.1.dylib: -------------------------------------------------------------------------------- 1 | libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/MacOS/libvulkan.1.dylib: -------------------------------------------------------------------------------- 1 | libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/src/queue.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use render_core::error::{Error, Result}; 4 | 5 | pub struct RenderCommandQueueVk {} 6 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/glslc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/glslc -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-as: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-as -------------------------------------------------------------------------------- /render-hal-vk/src/raw/memory.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use ash; 4 | 5 | pub type Properties = ash::vk::MemoryPropertyFlags; 6 | pub type RawMemory = ash::vk::DeviceMemory; 7 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-cfg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-cfg -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-dis: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-dis -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-link: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-link -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-opt -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-val: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-val -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/vulkaninfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/vulkaninfo -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libHLSL.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libHLSL.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-cross: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-cross -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-remap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-remap -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-stats: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-stats -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/glslang/Include/revision.h: -------------------------------------------------------------------------------- 1 | // This header is generated by the make-revision script. 2 | 3 | #define GLSLANG_PATCH_LEVEL 2904 4 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libglslang.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libglslang.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libshaderc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libshaderc.a -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "render-core", 4 | "render-hal", 5 | #"render-hal-dx12", 6 | "render-hal-mock", 7 | #"render-hal-mtl", 8 | #"render-hal-vk", 9 | ] 10 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/glslangValidator: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/glslangValidator -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libMoltenVK.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libMoltenVK.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libOGLCompiler.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libOGLCompiler.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libOSDependent.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libOSDependent.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPVRemapper.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPVRemapper.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libspirv-cross.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libspirv-cross.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/iOS/libMoltenVK.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/iOS/libMoltenVK.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools-opt.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools-opt.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/MacOS/vulkaninfo.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | BASEDIR=`dirname $0` 3 | open /Applications/Utilities/Terminal.app $BASEDIR/vulkaninfo 4 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/libMoltenVK.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/libMoltenVK.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools-link.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools-link.a -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libshaderc_shared.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libshaderc_shared.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libvulkan.1.1.85.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools-shared.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libSPIRV-Tools-shared.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_threading.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_threading.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/iOS/MoltenVK.framework/MoltenVK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/iOS/MoltenVK.framework/MoltenVK -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/MacOS/cube: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/MacOS/cube -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_core_validation.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_core_validation.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_object_tracker.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_object_tracker.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_unique_objects.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_unique_objects.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/MacOS/cubepp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/MacOS/cubepp -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/iOS/MoltenVK_icd.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.0.0", 3 | "ICD": { 4 | "library_path": "./libMoltenVK.dylib", 5 | "api_version" : "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_parameter_validation.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/libVkLayer_parameter_validation.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK_icd.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.0.0", 3 | "ICD": { 4 | "library_path": "./libMoltenVK.dylib", 5 | "api_version" : "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/MacOS/vulkaninfo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/MacOS/vulkaninfo -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK.framework/Versions/A/MoltenVK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK.framework/Versions/A/MoltenVK -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/vulkan: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/vulkan -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/LunarGIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/LunarGIcon.icns -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/LunarGIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/LunarGIcon.icns -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Frameworks/libMoltenVK.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Frameworks/libMoltenVK.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/MacOS/libvulkan.1.1.85.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/MacOS/libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/icd.d/MoltenVK_icd.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.0.0", 3 | "ICD": { 4 | "library_path": "../../../lib/libMoltenVK.dylib", 5 | "api_version" : "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Frameworks/libMoltenVK.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Frameworks/libMoltenVK.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/MacOS/libvulkan.1.1.85.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/MacOS/libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/Resources/LunarGIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/Resources/LunarGIcon.icns -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/Frameworks/libMoltenVK.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/Frameworks/libMoltenVK.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/MacOS/libvulkan.1.1.85.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/MacOS/libvulkan.1.1.85.dylib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/Info.plist -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/MainMenu.nib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/Info.plist -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/MainMenu.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/MainMenu.nib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.0.0", 3 | "ICD": { 4 | "library_path": "../../../Frameworks/libMoltenVK.dylib", 5 | "api_version" : "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.0.0", 3 | "ICD": { 4 | "library_path": "../../../Frameworks/libMoltenVK.dylib", 5 | "api_version" : "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/Resources/vulkan/icd.d/MoltenVK_icd.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.0.0", 3 | "ICD": { 4 | "library_path": "../../../Frameworks/libMoltenVK.dylib", 5 | "api_version" : "1.0.0" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /render-hal-vk/src/raw/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod buffer; 2 | pub mod command; 3 | pub mod device; 4 | pub mod errors; 5 | pub mod escape; 6 | pub mod fence; 7 | pub mod format; 8 | pub mod image; 9 | pub mod instance; 10 | pub mod memory; 11 | pub mod object; 12 | pub mod surface; 13 | pub mod swap_chain; 14 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/XfG-lQ-9wD-view-m2S-Jp-Qdl.nib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Resources/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gwihlidal/render-rs/HEAD/render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Resources/Main.storyboardc/NSWindowController-B8D-0N-5wS.nib -------------------------------------------------------------------------------- /osx_info.sh: -------------------------------------------------------------------------------- 1 | export SDK_PATH=/Users/graham/src/github.com/gwihlidal/render-rs/redist/vulkansdk-macos-1.1.85.0 2 | export DYLD_LIBRARY_PATH=$SDK_PATH/macOS/lib 3 | export VK_ICD_FILENAMES=$SDK_PATH/macOS/etc/vulkan/icd.d/MoltenVK_icd.json 4 | export VK_LAYER_PATH=$SDK_PATH/macOS/etc/vulkan/explicit_layer.d 5 | 6 | ./redist/vulkansdk-macos-1.1.85.0/macOS/bin/vulkaninfo -------------------------------------------------------------------------------- /osx_run.sh: -------------------------------------------------------------------------------- 1 | export SDK_PATH=/Users/graham/src/github.com/gwihlidal/render-rs/redist/vulkansdk-macos-1.1.85.0 2 | export DYLD_LIBRARY_PATH=$SDK_PATH/macOS/lib 3 | export VK_ICD_FILENAMES=$SDK_PATH/macOS/etc/vulkan/icd.d/MoltenVK_icd.json 4 | export VK_LAYER_PATH=$SDK_PATH/macOS/etc/vulkan/explicit_layer.d 5 | 6 | cargo +stable fmt 7 | cargo build --all 8 | cargo run --bin debug -------------------------------------------------------------------------------- /osx_build.sh: -------------------------------------------------------------------------------- 1 | export SDK_PATH=/Users/graham/src/github.com/gwihlidal/render-rs/redist/vulkansdk-macos-1.1.85.0 2 | export DYLD_LIBRARY_PATH=$SDK_PATH/macOS/lib 3 | export VK_ICD_FILENAMES=$SDK_PATH/macOS/etc/vulkan/icd.d/MoltenVK_icd.json 4 | export VK_LAYER_PATH=$SDK_PATH/macOS/etc/vulkan/explicit_layer.d 5 | 6 | cargo +stable fmt 7 | cargo build --all 8 | cargo build --bin debug -------------------------------------------------------------------------------- /osx_test.sh: -------------------------------------------------------------------------------- 1 | export RUST_BACKTRACE=1 2 | export SDK_PATH=/Users/graham/src/github.com/gwihlidal/render-rs/redist/vulkansdk-macos-1.1.85.0 3 | export DYLD_LIBRARY_PATH=$SDK_PATH/macOS/lib 4 | export VK_ICD_FILENAMES=$SDK_PATH/macOS/etc/vulkan/icd.d/MoltenVK_icd.json 5 | export VK_LAYER_PATH=$SDK_PATH/macOS/etc/vulkan/explicit_layer.d 6 | 7 | cargo +stable fmt 8 | cargo build --all 9 | cargo test -- --nocapture -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/pkgconfig/SPIRV-Tools-shared.pc: -------------------------------------------------------------------------------- 1 | prefix=/tmp/macos-sdk-build/glslang/build/install 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: SPIRV-Tools 7 | Description: Tools for SPIR-V 8 | Version: 2018.6.0 9 | URL: https://github.com/KhronosGroup/SPIRV-Tools 10 | 11 | Libs: -L${libdir} -lSPIRV-Tools-shared 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib/pkgconfig/SPIRV-Tools.pc: -------------------------------------------------------------------------------- 1 | prefix=/tmp/macos-sdk-build/glslang/build/install 2 | exec_prefix=${prefix} 3 | libdir=${prefix}/lib 4 | includedir=${prefix}/include 5 | 6 | Name: SPIRV-Tools 7 | Description: Tools for SPIR-V 8 | Version: 2018.6.0 9 | URL: https://github.com/KhronosGroup/SPIRV-Tools 10 | 11 | Libs: -L${libdir} -lSPIRV-Tools -lSPIRV-Tools-link -lSPIRV-Tools-opt 12 | Cflags: -I${includedir} 13 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/explicit_layer.d/VkLayer_unique_objects.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.1.0", 3 | "layer" : { 4 | "name": "VK_LAYER_GOOGLE_unique_objects", 5 | "type": "GLOBAL", 6 | "library_path": "../../../lib/libVkLayer_unique_objects.dylib", 7 | "api_version": "1.1.85", 8 | "implementation_version": "1", 9 | "description": "Google Validation Layer" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /render-hal-vk/src/raw/buffer.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use crate::raw::escape::Escape; 4 | use crate::raw::memory; 5 | use ash; 6 | use std::{ops::Range, sync::Arc}; 7 | 8 | pub type Usage = ash::vk::BufferUsageFlags; 9 | pub type RawBuffer = ash::vk::Buffer; 10 | 11 | pub struct Buffer { 12 | resource: Arc>, 13 | usage: Usage, 14 | memory: memory::RawMemory, 15 | range: Range, 16 | } 17 | 18 | impl Buffer { 19 | /// Get raw buffer handle. 20 | pub fn raw(&self) -> RawBuffer { 21 | **self.resource 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /render-hal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-hal" 3 | version = "0.1.0" 4 | authors = ["Graham Wihlidal "] 5 | keywords = ["rust", "render", "gfx", "graphics", "hal", "3d", "directx", "direct3d", "d3d", "dx12", "directx12", "vulkan", "vk", "metal"] 6 | homepage = "https://github.com/gwihlidal/render-hal-rs" 7 | repository = "https://github.com/gwihlidal/render-hal-rs" 8 | readme = "README.md" 9 | license = "MIT OR Apache-2.0" 10 | edition = "2018" 11 | 12 | [dependencies] 13 | render-core = { path = "../render-core" } 14 | 15 | [lib] 16 | test = false 17 | doctest = false -------------------------------------------------------------------------------- /render-hal-vk/src/shader_views.rs: -------------------------------------------------------------------------------- 1 | use ash; 2 | use render_core::state::{RenderBindingShaderResourceView, RenderBindingUnorderedAccessView}; 3 | 4 | #[derive(Debug, Default, Copy, Clone)] 5 | pub struct ShaderResourceViewBinding { 6 | pub desc: RenderBindingShaderResourceView, 7 | pub image_view: ash::vk::ImageView, 8 | pub buffer_view: ash::vk::BufferView, 9 | } 10 | 11 | #[derive(Debug, Default, Copy, Clone)] 12 | pub struct UnorderedAccessViewBinding { 13 | pub desc: RenderBindingUnorderedAccessView, 14 | pub image_view: ash::vk::ImageView, 15 | pub buffer_view: ash::vk::BufferView, 16 | } 17 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/explicit_layer.d/VkLayer_threading.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.1.0", 3 | "layer" : { 4 | "name": "VK_LAYER_GOOGLE_threading", 5 | "type": "GLOBAL", 6 | "library_path": "../../../lib/libVkLayer_threading.dylib", 7 | "api_version": "1.1.85", 8 | "implementation_version": "1", 9 | "description": "Google Validation Layer", 10 | "instance_extensions": [ 11 | { 12 | "name": "VK_EXT_debug_report", 13 | "spec_version": "6" 14 | } 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /render-core/src/constants.rs: -------------------------------------------------------------------------------- 1 | use crate::types::RAYTRACINGSHADERTYPE_COUNT; 2 | use crate::types::RENDERQUEUETYPE_COUNT; 3 | use crate::types::RENDERSHADERTYPE_COUNT; 4 | 5 | pub const MAX_RENDER_TARGET_COUNT: usize = 8; 6 | pub const MAX_VERTEX_ELEMENTS: usize = 16; 7 | pub const MAX_VERTEX_STREAMS: usize = 16; 8 | pub const MAX_SHADER_PARAMETERS: usize = 4; 9 | pub const MAX_SAMPLER_BINDINGS: usize = 16; 10 | pub const MAX_SHADER_ARGUMENTS: usize = 4; 11 | pub const MAX_SHADER_TYPE: usize = RENDERSHADERTYPE_COUNT; 12 | pub const MAX_RAY_TRACING_SHADER_TYPE: usize = RAYTRACINGSHADERTYPE_COUNT; 13 | pub const MAX_RENDER_QUEUES: usize = RENDERQUEUETYPE_COUNT; 14 | -------------------------------------------------------------------------------- /render-hal-mtl/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | #[macro_use] 4 | extern crate failure; 5 | #[macro_use] 6 | extern crate log; 7 | extern crate crossbeam_channel; 8 | extern crate smallvec; 9 | #[macro_use] 10 | extern crate enum_primitive; 11 | extern crate render_core; 12 | #[macro_use] 13 | extern crate downcast_rs; 14 | 15 | use crate::module::RenderBackendModuleMtl; 16 | use render_core::backend::{RenderBackend, RenderBackendModule}; 17 | 18 | mod backend; 19 | mod module; 20 | 21 | #[cfg(target_os = "macos")] 22 | #[no_mangle] 23 | pub extern "C" fn render_backend_factory() -> Box { 24 | Box::new(RenderBackendModuleMtl::new()) 25 | } 26 | -------------------------------------------------------------------------------- /render-hal-mock/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(unused_imports)] 3 | 4 | #[macro_use] 5 | extern crate failure; 6 | #[macro_use] 7 | extern crate log; 8 | extern crate crossbeam_channel; 9 | extern crate smallvec; 10 | #[macro_use] 11 | extern crate enum_primitive; 12 | extern crate render_core; 13 | #[macro_use] 14 | extern crate downcast_rs; 15 | 16 | use crate::module::RenderBackendModuleMock; 17 | use render_core::backend::{RenderBackend, RenderBackendModule}; 18 | 19 | mod backend; 20 | mod device; 21 | mod module; 22 | mod types; 23 | 24 | #[no_mangle] 25 | pub extern "C" fn render_backend_factory() -> Box { 26 | Box::new(RenderBackendModuleMock::new()) 27 | } 28 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/explicit_layer.d/VkLayer_standard_validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version": "1.1.1", 3 | "layer": { 4 | "name": "VK_LAYER_LUNARG_standard_validation", 5 | "type": "GLOBAL", 6 | "api_version": "1.1.85", 7 | "implementation_version": "1", 8 | "description": "LunarG Standard Validation", 9 | "component_layers": [ 10 | "VK_LAYER_GOOGLE_threading", 11 | "VK_LAYER_LUNARG_parameter_validation", 12 | "VK_LAYER_LUNARG_object_tracker", 13 | "VK_LAYER_LUNARG_core_validation", 14 | "VK_LAYER_GOOGLE_unique_objects" 15 | ] 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /render-hal-mock/src/module.rs: -------------------------------------------------------------------------------- 1 | use crate::backend::RenderBackendMock; 2 | use render_core::backend::{RenderBackend, RenderBackendModule}; 3 | 4 | #[derive(Debug)] 5 | pub(crate) struct RenderBackendModuleMock {} 6 | 7 | impl RenderBackendModuleMock { 8 | pub fn new() -> Self { 9 | RenderBackendModuleMock {} 10 | } 11 | } 12 | 13 | impl Drop for RenderBackendModuleMock { 14 | fn drop(&mut self) {} 15 | } 16 | 17 | impl RenderBackendModule for RenderBackendModuleMock { 18 | fn name(&self) -> &'static str { 19 | "Mock" 20 | } 21 | 22 | fn api(&self) -> &'static str { 23 | "mock" 24 | } 25 | 26 | fn create(&self) -> Box { 27 | Box::new(RenderBackendMock::new().unwrap()) 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /render-hal-mtl/src/module.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use crate::backend::RenderBackendMtl; 4 | use render_core::backend::{RenderBackend, RenderBackendModule}; 5 | 6 | #[derive(Debug)] 7 | pub(crate) struct RenderBackendModuleMtl {} 8 | 9 | impl RenderBackendModuleMtl { 10 | pub fn new() -> Self { 11 | RenderBackendModuleMtl {} 12 | } 13 | } 14 | 15 | impl Drop for RenderBackendModuleMtl { 16 | fn drop(&mut self) {} 17 | } 18 | 19 | impl RenderBackendModule for RenderBackendModuleMtl { 20 | fn name(&self) -> &'static str { 21 | "Metal 2" 22 | } 23 | 24 | fn api(&self) -> &'static str { 25 | "mtl" 26 | } 27 | 28 | fn create(&self) -> Box { 29 | Box::new(RenderBackendMtl::new()) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /render-hal-dx12/src/module.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use crate::backend::RenderBackendDx12; 4 | use render_core::backend::{RenderBackend, RenderBackendModule}; 5 | 6 | #[derive(Debug)] 7 | pub(crate) struct RenderBackendModuleDx12 {} 8 | 9 | impl RenderBackendModuleDx12 { 10 | pub fn new() -> Self { 11 | RenderBackendModuleDx12 {} 12 | } 13 | } 14 | 15 | impl Drop for RenderBackendModuleDx12 { 16 | fn drop(&mut self) {} 17 | } 18 | 19 | impl RenderBackendModule for RenderBackendModuleDx12 { 20 | fn name(&self) -> &'static str { 21 | "DirectX 12" 22 | } 23 | 24 | fn api(&self) -> &'static str { 25 | "dx12" 26 | } 27 | 28 | fn create(&self) -> Box { 29 | Box::new(RenderBackendDx12::new()) 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /render-hal-mock/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-hal-mock" 3 | version = "0.1.0" 4 | authors = ["Graham Wihlidal "] 5 | keywords = ["rust", "render", "gfx", "graphics", "hal", "3d", "directx", "direct3d", "d3d", "dx12", "directx12", "vulkan", "vk", "metal"] 6 | homepage = "https://github.com/gwihlidal/render-hal-rs" 7 | repository = "https://github.com/gwihlidal/render-hal-rs" 8 | readme = "README.md" 9 | license = "MIT OR Apache-2.0" 10 | edition = "2018" 11 | 12 | [dependencies] 13 | render-hal = { path = "../render-hal" } 14 | render-core = { path = "../render-core" } 15 | failure = "0.1.6" 16 | crossbeam-channel = "0.4.0" 17 | enum_primitive = "0.1.1" 18 | downcast-rs = "1.1.1" 19 | smallvec = "1.1.0" 20 | log = "0.4" 21 | 22 | [lib] 23 | crate-type = ["cdylib", "rlib"] 24 | test = false 25 | doctest = false -------------------------------------------------------------------------------- /render-hal-dx12/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(unused_imports)] 3 | 4 | #[macro_use] 5 | extern crate failure; 6 | #[macro_use] 7 | extern crate log; 8 | extern crate crossbeam_channel; 9 | extern crate smallvec; 10 | #[macro_use] 11 | extern crate enum_primitive; 12 | extern crate render_core; 13 | #[macro_use] 14 | extern crate downcast_rs; 15 | #[cfg(windows)] 16 | extern crate redirect; 17 | #[cfg(windows)] 18 | extern crate renderdoc; 19 | #[cfg(windows)] 20 | extern crate winapi; 21 | 22 | use crate::module::RenderBackendModuleDx12; 23 | use render_core::backend::{RenderBackend, RenderBackendModule}; 24 | 25 | mod backend; 26 | mod module; 27 | 28 | #[cfg(windows)] 29 | #[no_mangle] 30 | pub extern "C" fn render_backend_factory() -> Box { 31 | Box::new(RenderBackendModuleDx12::new()) 32 | } 33 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | vulkan 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.lunarg.vulkanFramework 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 21 | CFBundleShortVersionString 22 | 23 | CSResourcesFileMapped 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /render-hal-vk/src/module.rs: -------------------------------------------------------------------------------- 1 | use crate::backend::RenderBackendVk; 2 | use render_core::backend::{RenderBackend, RenderBackendModule}; 3 | 4 | #[derive(Debug)] 5 | pub(crate) struct RenderBackendModuleVk {} 6 | 7 | impl RenderBackendModuleVk { 8 | pub fn new() -> Self { 9 | RenderBackendModuleVk {} 10 | } 11 | } 12 | 13 | impl Drop for RenderBackendModuleVk { 14 | fn drop(&mut self) {} 15 | } 16 | 17 | impl RenderBackendModule for RenderBackendModuleVk { 18 | fn name(&self) -> &'static str { 19 | "Vulkan" 20 | } 21 | 22 | fn api(&self) -> &'static str { 23 | "vk" 24 | } 25 | 26 | fn create(&self) -> Box { 27 | // TODO: Proper result here 28 | let backend = RenderBackendVk::new(); 29 | match backend { 30 | Ok(backend) => Box::new(backend), 31 | Err(err) => { 32 | panic!("error occurred: {:?}", err); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /render-hal-mtl/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-hal-mtl" 3 | version = "0.1.0" 4 | authors = ["Graham Wihlidal "] 5 | keywords = ["rust", "render", "gfx", "graphics", "hal", "3d", "directx", "direct3d", "d3d", "dx12", "directx12", "vulkan", "vk", "metal"] 6 | homepage = "https://github.com/gwihlidal/render-hal-rs" 7 | repository = "https://github.com/gwihlidal/render-hal-rs" 8 | readme = "README.md" 9 | license = "MIT OR Apache-2.0" 10 | edition = "2018" 11 | 12 | [dependencies] 13 | render-hal = { path = "../render-hal" } 14 | render-core = { path = "../render-core" } 15 | failure = "0.1.6" 16 | crossbeam-channel = "0.4.0" 17 | enum_primitive = "0.1.1" 18 | downcast-rs = "1.1.1" 19 | smallvec = "1.1.0" 20 | log = "0.4.8" 21 | 22 | [target.'cfg(target_os = "macos")'.dependencies] 23 | cocoa = "0.20.0" 24 | core-graphics = "0.19.0" 25 | metal = "0.17.1" 26 | foreign-types = "0.5.0" 27 | objc = "0.2.7" 28 | 29 | [lib] 30 | crate-type = ["cdylib", "rlib"] 31 | test = false 32 | doctest = false -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/bin/spirv-lesspipe.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2016 The Khronos Group Inc. 3 | 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | 16 | # A script for automatically disassembling a .spv file 17 | # for less(1). This assumes spirv-dis is on our PATH. 18 | # 19 | # See https://github.com/KhronosGroup/SPIRV-Tools/issues/359 20 | 21 | case "$1" in 22 | *.spv) spirv-dis "$@" 2>/dev/null;; 23 | *) exit 1;; 24 | esac 25 | 26 | exit $? 27 | 28 | -------------------------------------------------------------------------------- /render-core/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-core" 3 | version = "0.1.0" 4 | authors = ["Graham Wihlidal "] 5 | keywords = ["rust", "render", "gfx", "graphics", "hal", "3d", "directx", "direct3d", "d3d", "dx12", "directx12", "vulkan", "vk", "metal"] 6 | homepage = "https://github.com/gwihlidal/render-rs" 7 | repository = "https://github.com/gwihlidal/render-rs" 8 | readme = "README.md" 9 | license = "MIT OR Apache-2.0" 10 | edition = "2018" 11 | 12 | [dependencies] 13 | option_set = "0.1.2" 14 | bitflags = "1.1.0" 15 | serde = "1.0.101" 16 | serde_json = "1.0.40" 17 | serde_derive = "1.0.101" 18 | enum_primitive = "0.1.1" 19 | failure = "0.1.5" 20 | downcast-rs = "1.0.4" 21 | libloading = "0.5.2" 22 | glob = "0.3" 23 | winit = "0.19.3" 24 | log = "0.4" 25 | fern = { version = "0.5.8", features = ["colored"] } 26 | chrono = "0.4.9" 27 | enum-count = { git = 'https://github.com/gwihlidal/enum-count' } 28 | enum-count-derive = { git = 'https://github.com/gwihlidal/enum-count-derive' } 29 | 30 | [lib] 31 | doctest = false -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | render-rs 2 | ======== 3 | 4 | ![MIT](https://img.shields.io/badge/license-MIT-blue.svg) 5 | ![APACHE2](https://img.shields.io/badge/license-APACHE2-blue.svg) 6 | 7 | ## License 8 | 9 | Licensed under either of 10 | 11 | * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) 12 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) 13 | 14 | at your option. 15 | 16 | ## Contribution 17 | 18 | Unless you explicitly state otherwise, any contribution intentionally submitted 19 | for inclusion in this crate by you, as defined in the Apache-2.0 license, shall 20 | be dual licensed as above, without any additional terms or conditions. 21 | 22 | Contributions are always welcome; please look at the [issue tracker](https://github.com/gwihlidal/render-rs/issues) to see what 23 | known improvements are documented. 24 | 25 | ## Code of Conduct 26 | 27 | Contribution to the render-rs crates is organized under the terms of the 28 | Contributor Covenant, the maintainer of render-rs, @gwihlidal, promises to 29 | intervene to uphold that code of conduct. 30 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Graham Wihlidal 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/VERSIONS.txt: -------------------------------------------------------------------------------- 1 | Revisions used to build this SDK on Thu Oct 4 23:48:52 UTC 2018 2 | 2fd5a24ec4a6df303b2155b3f85b6b8c1d56f6c0 : https://github.com/KhronosGroup/Vulkan-Headers.git 3 | 98d5fac6c461959e64bdbe27c710a93215147dd1 : https://github.com/KhronosGroup/Vulkan-Loader.git 4 | bdd65da74e39e0953a222275de9033543807ccdc : https://github.com/KhronosGroup/Vulkan-ValidationLayers.git 5 | 3796b651c94a8bfb383bf42384d6dabc7e60908d : https://github.com/KhronosGroup/Vulkan-Tools.git 6 | 26c7b69a3fbee8125ff6072f766c10147d00754d : https://github.com/KhronosGroup/MoltenVK.git 7 | 91ac4290bcf2cb930b4fb0981f09c00c0b6797e1 : https://github.com/KhronosGroup/glslang.git 8 | 9bfe0eb25e3dfdf4f3fd86ab6c0cda009c9bd661 : https://github.com/KhronosGroup/SPIRV-Tools 9 | d5b2e1255f706ce1f88812217e9a554f299848af : https://github.com/KhronosGroup/SPIRV-Headers 10 | 34014886e338e57940eef32859622d9ca31f7f53 : https://github.com/KhronosGroup/SPIRV-Cross.git 11 | c15f914b0f62bf24c58fb201ad6f4b10ecaa122c : https://github.com/google/shaderc.git 12 | f1aa87e59828fd2f71790b69d0c33f81ed4de2e1 : https://github.com/KhronosGroup/Vulkan-Docs.git 13 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/explicit_layer.d/VkLayer_object_tracker.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.1.0", 3 | "layer" : { 4 | "name": "VK_LAYER_LUNARG_object_tracker", 5 | "type": "GLOBAL", 6 | "library_path": "../../../lib/libVkLayer_object_tracker.dylib", 7 | "api_version": "1.1.85", 8 | "implementation_version": "1", 9 | "description": "LunarG Validation Layer", 10 | "instance_extensions": [ 11 | { 12 | "name": "VK_EXT_debug_report", 13 | "spec_version": "6" 14 | } 15 | ], 16 | "device_extensions": [ 17 | { 18 | "name": "VK_EXT_debug_marker", 19 | "spec_version": "4", 20 | "entrypoints": ["vkDebugMarkerSetObjectTagEXT", 21 | "vkDebugMarkerSetObjectNameEXT", 22 | "vkCmdDebugMarkerBeginEXT", 23 | "vkCmdDebugMarkerEndEXT", 24 | "vkCmdDebugMarkerInsertEXT" 25 | ] 26 | } 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/explicit_layer.d/VkLayer_parameter_validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.1.0", 3 | "layer" : { 4 | "name": "VK_LAYER_LUNARG_parameter_validation", 5 | "type": "GLOBAL", 6 | "library_path": "../../../lib/libVkLayer_parameter_validation.dylib", 7 | "api_version": "1.1.85", 8 | "implementation_version": "1", 9 | "description": "LunarG Validation Layer", 10 | "instance_extensions": [ 11 | { 12 | "name": "VK_EXT_debug_report", 13 | "spec_version": "6" 14 | } 15 | ], 16 | "device_extensions": [ 17 | { 18 | "name": "VK_EXT_debug_marker", 19 | "spec_version": "4", 20 | "entrypoints": ["vkDebugMarkerSetObjectTagEXT", 21 | "vkDebugMarkerSetObjectNameEXT", 22 | "vkCmdDebugMarkerBeginEXT", 23 | "vkCmdDebugMarkerEndEXT", 24 | "vkCmdDebugMarkerInsertEXT" 25 | ] 26 | } 27 | ] 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /render-hal-dx12/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-hal-dx12" 3 | version = "0.1.0" 4 | authors = ["Graham Wihlidal "] 5 | keywords = ["rust", "render", "gfx", "graphics", "hal", "3d", "directx", "direct3d", "d3d", "dx12", "directx12", "vulkan", "vk", "metal"] 6 | homepage = "https://github.com/gwihlidal/render-hal-rs" 7 | repository = "https://github.com/gwihlidal/render-hal-rs" 8 | readme = "README.md" 9 | license = "MIT OR Apache-2.0" 10 | edition = "2018" 11 | 12 | [dependencies] 13 | render-hal = { path = "../render-hal" } 14 | render-core = { path = "../render-core" } 15 | failure = "0.1.6" 16 | crossbeam-channel = "0.4.0" 17 | enum_primitive = "0.1.1" 18 | downcast-rs = "1.1.1" 19 | smallvec = "1.1.0" 20 | log = "0.4" 21 | 22 | [target.'cfg(windows)'.dependencies] 23 | winapi = { version = "0.3", features = ["basetsd", "d3d12", "d3d12sdklayers", "d3d12shader", "d3dcommon", "d3dcompiler", "dxgi1_2", "dxgi1_3", "dxgi1_4", "dxgiformat", "dxgitype", "handleapi", "minwindef", "synchapi", "unknwnbase", "winbase", "windef", "winerror", "winnt", "winuser"] } 24 | redirect = "0.3.0" 25 | renderdoc = "0.7.1" 26 | 27 | [lib] 28 | crate-type = ["cdylib", "rlib"] 29 | test = false 30 | doctest = false -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/vulkaninfo.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | vulkaninfo.sh 9 | CFBundleGetInfoString 10 | VulkanInfo 11 | CFBundleIconFile 12 | LunarGIcon.icns 13 | CFBundleIdentifier 14 | com.lunarg.vulkaninfo 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 1.0 19 | CFBundleName 20 | VulkanInfo 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1.0 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. 33 | 34 | 35 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cube.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | cube 9 | CFBundleGetInfoString 10 | Cube 11 | CFBundleIconFile 12 | LunarGIcon.icns 13 | CFBundleIdentifier 14 | com.lunarg.cube 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 1.0 19 | CFBundleName 20 | Cube 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1.0 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. 33 | NSMainStoryboardFile 34 | Main 35 | NSPrincipalClass 36 | NSApplication 37 | 38 | 39 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/Applications/cubepp.app/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | cubepp 9 | CFBundleGetInfoString 10 | Cubepp 11 | CFBundleIconFile 12 | LunarGIcon.icns 13 | CFBundleIdentifier 14 | com.lunarg.cubepp 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleLongVersionString 18 | 1.0 19 | CFBundleName 20 | Cubepp 21 | CFBundlePackageType 22 | APPL 23 | CFBundleShortVersionString 24 | 1.0 25 | CFBundleSignature 26 | ???? 27 | CFBundleVersion 28 | 1.0 29 | CSResourcesFileMapped 30 | 31 | NSHumanReadableCopyright 32 | Copyright (c) 2018 The Khronos Group Inc. LunarG Inc. All rights reserved. 33 | NSMainStoryboardFile 34 | Main 35 | NSPrincipalClass 36 | NSApplication 37 | 38 | 39 | -------------------------------------------------------------------------------- /render-hal-vk/build.rs: -------------------------------------------------------------------------------- 1 | fn main() { 2 | link_vulkan(); 3 | } 4 | 5 | fn link_vulkan() { 6 | use std::env; 7 | use std::path::PathBuf; 8 | let target = env::var("TARGET").unwrap(); 9 | if target.contains("windows") { 10 | if let Ok(vulkan_sdk) = env::var("VULKAN_SDK") { 11 | let mut vulkan_sdk_path = PathBuf::from(vulkan_sdk); 12 | 13 | if target.contains("x86_64") { 14 | vulkan_sdk_path.push("Lib"); 15 | } else { 16 | vulkan_sdk_path.push("Lib32"); 17 | } 18 | 19 | println!( 20 | "cargo:rustc-link-search=native={}", 21 | vulkan_sdk_path.to_str().unwrap() 22 | ); 23 | } 24 | 25 | println!("cargo:rustc-link-lib=dylib=vulkan-1"); 26 | } else { 27 | if target.contains("apple") { 28 | if let Ok(vulkan_sdk) = env::var("VULKAN_SDK") { 29 | let mut vulkan_sdk_path = PathBuf::from(vulkan_sdk); 30 | vulkan_sdk_path.push("macOS/lib"); 31 | println!( 32 | "cargo:rustc-link-search=native={}", 33 | vulkan_sdk_path.to_str().unwrap() 34 | ); 35 | } else { 36 | let lib_path = "render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/lib"; 37 | println!("cargo:rustc-link-search=native={}", lib_path); 38 | } 39 | 40 | println!("cargo:rustc-link-lib=dylib=vulkan"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/etc/vulkan/explicit_layer.d/VkLayer_core_validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "file_format_version" : "1.1.0", 3 | "layer" : { 4 | "name": "VK_LAYER_LUNARG_core_validation", 5 | "type": "GLOBAL", 6 | "library_path": "../../../lib/libVkLayer_core_validation.dylib", 7 | "api_version": "1.1.85", 8 | "implementation_version": "1", 9 | "description": "LunarG Validation Layer", 10 | "instance_extensions": [ 11 | { 12 | "name": "VK_EXT_debug_report", 13 | "spec_version": "6" 14 | } 15 | ], 16 | "device_extensions": [ 17 | { 18 | "name": "VK_EXT_debug_marker", 19 | "spec_version": "4", 20 | "entrypoints": ["vkDebugMarkerSetObjectTagEXT", 21 | "vkDebugMarkerSetObjectNameEXT", 22 | "vkCmdDebugMarkerBeginEXT", 23 | "vkCmdDebugMarkerEndEXT", 24 | "vkCmdDebugMarkerInsertEXT" 25 | ] 26 | }, 27 | { 28 | "name": "VK_EXT_validation_cache", 29 | "spec_version": "1", 30 | "entrypoints": ["vkCreateValidationCacheEXT", 31 | "vkDestroyValidationCacheEXT", 32 | "vkGetValidationCacheDataEXT", 33 | "vkMergeValidationCachesEXT" 34 | ] 35 | } 36 | ] 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /render-hal-vk/src/debug.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(unused_variables)] 3 | 4 | /// Raw mutable pointer to the OS-provided window handle. 5 | //pub type WindowHandle = *const c_void; 6 | 7 | #[cfg(target_os = "windows")] 8 | fn rd_test() { 9 | use renderdoc::{RenderDoc, V110}; 10 | 11 | let mut render_doc: RenderDoc = 12 | RenderDoc::new().expect("Failed to initialize RenderDoc v110"); 13 | 14 | let (major, minor, patch) = render_doc.get_api_version(); 15 | assert_eq!(major, 1u32); 16 | assert_eq!(minor, 1u32); 17 | 18 | //render_doc.set_active_window(window.context(), ::std::ptr::null()); 19 | //render_doc.set_focus_toggle_keys(&[glutin::VirtualKeyCode::F]); 20 | //render_doc.set_capture_keys(&[glutin::VirtualKeyCode::C]); 21 | //render_doc.mask_overlay_bits(OverlayBits::DEFAULT, OverlayBits::DEFAULT); 22 | 23 | // When a certain key is pressed, trigger a single-frame capture like this. 24 | render_doc.trigger_capture(); 25 | 26 | // If you specify version `V110` or newer, you can trigger a multi-frame 27 | // capture like this. 28 | render_doc.trigger_multi_frame_capture(3); 29 | 30 | // Query the details of an existing capture like this. 31 | match render_doc.get_capture(0) { 32 | Some(cap) => trace!("ID: 0, Path: {}, Timestamp: {}", cap.0, cap.1), 33 | None => trace!("No capture found with ID of 0!"), 34 | } 35 | 36 | //match rd.launch_replay_ui(None) { 37 | // Ok(pid) => trace!("Launched replay UI ({}).", pid), 38 | // Err(err) => trace!("{:?}", err), 39 | //} 40 | } 41 | -------------------------------------------------------------------------------- /render-core/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(unused_imports)] 3 | 4 | #[macro_use] 5 | extern crate option_set; 6 | #[macro_use] 7 | extern crate bitflags; 8 | extern crate serde; 9 | extern crate serde_json; 10 | #[macro_use] 11 | extern crate serde_derive; 12 | #[macro_use] 13 | extern crate enum_primitive; 14 | extern crate failure; 15 | #[macro_use] 16 | extern crate downcast_rs; 17 | extern crate glob; 18 | extern crate libloading; 19 | extern crate winit; 20 | #[macro_use] 21 | extern crate enum_count; 22 | #[macro_use] 23 | extern crate log; 24 | extern crate chrono; 25 | extern crate fern; 26 | 27 | pub mod allocator; 28 | pub mod backend; 29 | pub mod commands; 30 | pub mod constants; 31 | pub mod debug; 32 | pub mod device; 33 | pub mod encoder; 34 | pub mod error; 35 | pub mod format; 36 | pub mod handles; 37 | pub mod modules; 38 | pub mod profile; 39 | pub mod resources; 40 | pub mod state; 41 | pub mod system; 42 | pub mod types; 43 | pub mod utilities; 44 | 45 | pub use crate::error::{Error, ErrorKind, Result}; 46 | 47 | #[macro_export] 48 | #[cfg(feature = "profiling_enabled")] 49 | macro_rules! scoped_profile { 50 | ($section:ident, $name:ident) => { 51 | let section_name = concat!(stringify!($section), "\0"); 52 | let profile_name = concat!(stringify!($name), "\0"); 53 | ScopedProfile::start_region(profile_name.as_ptr() as _); 54 | let $name = ScopedProfile {}; 55 | }; 56 | } 57 | 58 | #[macro_export] 59 | #[cfg(not(feature = "profiling_enabled"))] 60 | macro_rules! scoped_profile { 61 | ($section:ident, $name:ident) => { 62 | () 63 | }; 64 | } 65 | -------------------------------------------------------------------------------- /render-core/tests/allocator.rs: -------------------------------------------------------------------------------- 1 | extern crate render_core; 2 | use render_core::allocator::{LinearAllocator, LinearAllocatorMark}; 3 | use render_core::utilities::*; 4 | 5 | #[test] 6 | fn allocator_is_empty() { 7 | let allocator = LinearAllocator::new(64); 8 | assert_eq!(allocator.is_empty(), true); 9 | assert_eq!(allocator.size(), 0); 10 | assert_eq!(allocator.capacity(), 64); 11 | assert_eq!(allocator.mark(), 0 as LinearAllocatorMark); 12 | } 13 | 14 | #[test] 15 | fn allocator_mark_insert() { 16 | let mut allocator = LinearAllocator::new(64); 17 | let mut test_data: Vec = Vec::with_capacity(12); 18 | for i in 0..12 { 19 | test_data.push(((i as f32) * 1234f32) + ((i as f32) * 1000f32)); 20 | } 21 | 22 | let byte_length = std::mem::size_of::() * 12; 23 | 24 | // Test slices going out of scope 25 | let data_mark = { 26 | let test_bytes = typed_to_bytes(&test_data); 27 | assert_eq!(test_bytes.len(), byte_length); 28 | 29 | let data_mark = allocator.allocate_raw(byte_length, 8, 0).unwrap(); 30 | allocator.mark_insert(data_mark, &test_bytes).unwrap(); 31 | 32 | assert_eq!(byte_length, allocator.size()); 33 | assert_eq!(allocator.mark(), byte_length); 34 | data_mark 35 | }; 36 | 37 | let test_bytes2 = typed_to_bytes(&test_data); 38 | assert_eq!(test_bytes2.len(), byte_length); 39 | 40 | let placed_data = allocator.mark_data(data_mark, byte_length).unwrap(); 41 | assert_eq!(test_bytes2, placed_data); 42 | assert_eq!(allocator.capacity(), 64); 43 | } 44 | -------------------------------------------------------------------------------- /render-hal-vk/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "render-hal-vk" 3 | version = "0.1.0" 4 | authors = ["Graham Wihlidal "] 5 | keywords = ["rust", "render", "gfx", "graphics", "hal", "3d", "directx", "direct3d", "d3d", "dx12", "directx12", "vulkan", "vk", "metal"] 6 | homepage = "https://github.com/gwihlidal/render-hal-rs" 7 | repository = "https://github.com/gwihlidal/render-hal-rs" 8 | readme = "README.md" 9 | license = "MIT OR Apache-2.0" 10 | edition = "2018" 11 | 12 | [dependencies] 13 | render-hal = { path = "../render-hal" } 14 | render-core = { path = "../render-core" } 15 | ash = "0.29" 16 | failure = "0.1.6" 17 | relevant = "0.4.2" 18 | log = "0.4" 19 | fern = { version = "0.5.9", features = ["colored"] } 20 | chrono = "0.4.10" 21 | crossbeam-channel = "0.4.0" 22 | smallvec = "1.1.0" 23 | enum_primitive = "0.1.1" 24 | downcast-rs = "1.1.1" 25 | vk-sync = "0.1.6" 26 | vk-mem = "0.2.0" 27 | spirv-reflect = "0.2.3" 28 | num-traits = "0.2.10" 29 | meowhash = "0.1.2" 30 | digest = "0.8.1" 31 | twox-hash = "1.5.0" 32 | 33 | [target.'cfg(windows)'.dependencies] 34 | winapi = { version = "0.3", features = ["libloaderapi", "windef", "winuser"] } 35 | renderdoc = "0.7.1" 36 | 37 | [target.'cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))'.dependencies] 38 | x11 = { version = "2.18.1", features = ["xlib"]} 39 | xcb = { version = "0.9.0" } 40 | renderdoc = "0.7.1" 41 | 42 | [target.'cfg(target_os = "macos")'.dependencies] 43 | cocoa = "0.20.0" 44 | core-graphics = "0.19.0" 45 | metal = "0.17.1" 46 | metal-rs = "0.10.6" 47 | foreign-types = "0.5.0" 48 | objc = "0.2.7" 49 | 50 | [lib] 51 | crate-type = ["cdylib", "rlib"] 52 | test = false 53 | doctest = false -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/MoltenVK/mvk_vulkan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mvk_vulkan.h 3 | * 4 | * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 20 | /** 21 | * This is a convenience header file that loads vulkan.h with the appropriate MoltenVK 22 | * Vulkan platform extensions automatically enabled for iOS or macOS. 23 | * 24 | * When building for iOS, this header automatically enables the VK_MVK_ios_surface Vulkan extension. 25 | * When building for macOS, this header automatically enables the VK_MVK_macos_surface Vulkan extension. 26 | * 27 | * Use the following form when including this header file: 28 | * 29 | * #include 30 | */ 31 | 32 | #ifndef __mvk_vulkan_h_ 33 | #define __mvk_vulkan_h_ 1 34 | 35 | 36 | #include 37 | 38 | #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED 39 | # define VK_USE_PLATFORM_IOS_MVK 1 40 | #endif 41 | 42 | #ifdef __MAC_OS_X_VERSION_MAX_ALLOWED 43 | # define VK_USE_PLATFORM_MACOS_MVK 1 44 | #endif 45 | 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/iOS/MoltenVK.framework/Headers/mvk_vulkan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mvk_vulkan.h 3 | * 4 | * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 20 | /** 21 | * This is a convenience header file that loads vulkan.h with the appropriate MoltenVK 22 | * Vulkan platform extensions automatically enabled for iOS or macOS. 23 | * 24 | * When building for iOS, this header automatically enables the VK_MVK_ios_surface Vulkan extension. 25 | * When building for macOS, this header automatically enables the VK_MVK_macos_surface Vulkan extension. 26 | * 27 | * Use the following form when including this header file: 28 | * 29 | * #include 30 | */ 31 | 32 | #ifndef __mvk_vulkan_h_ 33 | #define __mvk_vulkan_h_ 1 34 | 35 | 36 | #include 37 | 38 | #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED 39 | # define VK_USE_PLATFORM_IOS_MVK 1 40 | #endif 41 | 42 | #ifdef __MAC_OS_X_VERSION_MAX_ALLOWED 43 | # define VK_USE_PLATFORM_MACOS_MVK 1 44 | #endif 45 | 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /render-core/src/utilities.rs: -------------------------------------------------------------------------------- 1 | use std::mem; 2 | use std::slice; 3 | 4 | #[inline(always)] 5 | pub fn divide_up_multiple(val: u32, align: u32) -> u32 { 6 | (val + (align - 1)) / align 7 | } 8 | 9 | // TODO: Make generic 10 | #[inline(always)] 11 | pub fn divide_up_multiple_usize(val: usize, align: usize) -> usize { 12 | (val + (align - 1)) / align 13 | } 14 | 15 | #[inline(always)] 16 | pub fn any_as_u8_slice(p: &T) -> &[u8] { 17 | unsafe { slice::from_raw_parts((p as *const T) as *const u8, mem::size_of::()) } 18 | } 19 | 20 | #[inline(always)] 21 | pub fn typed_to_bytes(typed: &[T]) -> &[u8] { 22 | unsafe { 23 | slice::from_raw_parts( 24 | typed.as_ptr() as *const u8, 25 | typed.len() * mem::size_of::(), 26 | ) 27 | } 28 | } 29 | 30 | #[inline(always)] 31 | pub fn bytes_to_typed(bytes: &mut [u8]) -> &mut [T] { 32 | unsafe { 33 | slice::from_raw_parts_mut( 34 | bytes.as_mut_ptr() as *mut T, 35 | bytes.len() / mem::size_of::(), 36 | ) 37 | } 38 | } 39 | 40 | /// Aligns a pointer forward to the next value aligned with `align`. 41 | #[inline(always)] 42 | pub fn align_ptr_forward(ptr: *mut u8, align: usize) -> *mut u8 { 43 | ((ptr as usize + align - 1) & !(align - 1)) as *mut u8 44 | } 45 | 46 | /// Aligns an offset forward to the next value aligned with `align`. 47 | #[inline(always)] 48 | pub fn align_forward(offset: usize, align: usize) -> usize { 49 | ((offset + align - 1) & !(align - 1)) 50 | } 51 | 52 | /// Checks if an offset is aligned with 'align'. 53 | #[inline(always)] 54 | pub fn is_aligned(offset: usize, align: usize) -> bool { 55 | align_forward(offset, align) == offset 56 | } 57 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/macOS/MoltenVK.framework/Versions/A/Headers/mvk_vulkan.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mvk_vulkan.h 3 | * 4 | * Copyright (c) 2014-2018 The Brenwill Workshop Ltd. (http://www.brenwill.com) 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | */ 18 | 19 | 20 | /** 21 | * This is a convenience header file that loads vulkan.h with the appropriate MoltenVK 22 | * Vulkan platform extensions automatically enabled for iOS or macOS. 23 | * 24 | * When building for iOS, this header automatically enables the VK_MVK_ios_surface Vulkan extension. 25 | * When building for macOS, this header automatically enables the VK_MVK_macos_surface Vulkan extension. 26 | * 27 | * Use the following form when including this header file: 28 | * 29 | * #include 30 | */ 31 | 32 | #ifndef __mvk_vulkan_h_ 33 | #define __mvk_vulkan_h_ 1 34 | 35 | 36 | #include 37 | 38 | #ifdef __IPHONE_OS_VERSION_MAX_ALLOWED 39 | # define VK_USE_PLATFORM_IOS_MVK 1 40 | #endif 41 | 42 | #ifdef __MAC_OS_X_VERSION_MAX_ALLOWED 43 | # define VK_USE_PLATFORM_MACOS_MVK 1 44 | #endif 45 | 46 | #include 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/glslang/MachineIndependent/RemoveTree.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions 7 | // are met: 8 | // 9 | // Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // 12 | // Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following 14 | // disclaimer in the documentation and/or other materials provided 15 | // with the distribution. 16 | // 17 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 18 | // contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | // POSSIBILITY OF SUCH DAMAGE. 33 | // 34 | 35 | #pragma once 36 | 37 | namespace glslang { 38 | 39 | void RemoveAllTreeNodes(TIntermNode*); 40 | 41 | } // end namespace glslang 42 | -------------------------------------------------------------------------------- /render-hal-mtl/src/backend.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(unused_imports)] 3 | #![allow(unused_variables)] 4 | 5 | use failure::Fail; 6 | use render_core::backend::RenderBackend; 7 | use render_core::device::RenderDevice; 8 | use render_core::device::RenderDeviceId; 9 | use render_core::device::RenderDeviceInfo; 10 | use render_core::error::{Error, Result}; 11 | use std::sync::{Arc, RwLock}; 12 | 13 | #[derive(Debug)] 14 | pub(crate) struct RenderBackendMtl {} 15 | 16 | impl RenderBackendMtl { 17 | pub fn new() -> Self { 18 | RenderBackendMtl {} 19 | } 20 | } 21 | 22 | impl Drop for RenderBackendMtl { 23 | fn drop(&mut self) { 24 | trace!("Drop called for RenderBackendMtl!"); 25 | } 26 | } 27 | 28 | impl RenderBackend for RenderBackendMtl { 29 | fn is_initialized(&self) -> bool { 30 | unimplemented!() 31 | } 32 | 33 | fn enumerate_devices( 34 | &mut self, 35 | max_devices: u32, 36 | mirror_count: u32, 37 | software: bool, 38 | ) -> Result> { 39 | unimplemented!() 40 | } 41 | 42 | fn create_device(&mut self, device_id: RenderDeviceId) -> Result<()> { 43 | unimplemented!() 44 | } 45 | 46 | fn destroy_device(&mut self, device_id: RenderDeviceId) -> Result<()> { 47 | unimplemented!() 48 | } 49 | 50 | fn get_device( 51 | &self, 52 | device_id: RenderDeviceId, 53 | ) -> Result>>>> { 54 | unimplemented!() 55 | } 56 | 57 | fn begin_debug_capture(&self, name: &str) -> Result<()> { 58 | unimplemented!() 59 | } 60 | 61 | fn finish_debug_capture(&self) -> Result<()> { 62 | unimplemented!() 63 | } 64 | 65 | fn trigger_debug_capture(&self) -> Result<()> { 66 | unimplemented!() 67 | } 68 | 69 | fn launch_debug_capture(&self, quit: bool) -> Result<()> { 70 | unimplemented!() 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /render-hal-dx12/src/backend.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_variables)] 2 | #![allow(unused_imports)] 3 | #![allow(dead_code)] 4 | 5 | use failure::Fail; 6 | use render_core::backend::RenderBackend; 7 | use render_core::device::RenderDevice; 8 | use render_core::device::RenderDeviceId; 9 | use render_core::device::RenderDeviceInfo; 10 | use render_core::error::{Error, Result}; 11 | use std::sync::{Arc, RwLock}; 12 | 13 | #[derive(Debug)] 14 | pub(crate) struct RenderBackendDx12 {} 15 | 16 | impl RenderBackendDx12 { 17 | pub fn new() -> Self { 18 | RenderBackendDx12 {} 19 | } 20 | } 21 | 22 | impl Drop for RenderBackendDx12 { 23 | fn drop(&mut self) { 24 | trace!("Drop called for RenderBackendDx12!"); 25 | } 26 | } 27 | 28 | impl RenderBackend for RenderBackendDx12 { 29 | fn is_initialized(&self) -> bool { 30 | unimplemented!() 31 | } 32 | 33 | fn enumerate_devices( 34 | &mut self, 35 | max_devices: u32, 36 | mirror_count: u32, 37 | software: bool, 38 | ) -> Result> { 39 | unimplemented!() 40 | } 41 | 42 | fn create_device(&mut self, device_id: RenderDeviceId) -> Result<()> { 43 | unimplemented!() 44 | } 45 | 46 | fn destroy_device(&mut self, device_id: RenderDeviceId) -> Result<()> { 47 | unimplemented!() 48 | } 49 | 50 | fn get_device( 51 | &self, 52 | device_id: RenderDeviceId, 53 | ) -> Result>>>> { 54 | unimplemented!() 55 | } 56 | 57 | fn begin_debug_capture(&self, name: &str) -> Result<()> { 58 | unimplemented!() 59 | } 60 | 61 | fn finish_debug_capture(&self) -> Result<()> { 62 | unimplemented!() 63 | } 64 | 65 | fn trigger_debug_capture(&self) -> Result<()> { 66 | unimplemented!() 67 | } 68 | 69 | fn launch_debug_capture(&self, quit: bool) -> Result<()> { 70 | unimplemented!() 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_H_ 2 | #define VULKAN_H_ 1 3 | 4 | /* 5 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 6 | ** 7 | ** Licensed under the Apache License, Version 2.0 (the "License"); 8 | ** you may not use this file except in compliance with the License. 9 | ** You may obtain a copy of the License at 10 | ** 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | */ 19 | 20 | #include "vk_platform.h" 21 | #include "vulkan_core.h" 22 | 23 | #ifdef VK_USE_PLATFORM_ANDROID_KHR 24 | #include "vulkan_android.h" 25 | #endif 26 | 27 | 28 | #ifdef VK_USE_PLATFORM_IOS_MVK 29 | #include "vulkan_ios.h" 30 | #endif 31 | 32 | 33 | #ifdef VK_USE_PLATFORM_MACOS_MVK 34 | #include "vulkan_macos.h" 35 | #endif 36 | 37 | 38 | #ifdef VK_USE_PLATFORM_MIR_KHR 39 | #include 40 | #include "vulkan_mir.h" 41 | #endif 42 | 43 | 44 | #ifdef VK_USE_PLATFORM_VI_NN 45 | #include "vulkan_vi.h" 46 | #endif 47 | 48 | 49 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR 50 | #include 51 | #include "vulkan_wayland.h" 52 | #endif 53 | 54 | 55 | #ifdef VK_USE_PLATFORM_WIN32_KHR 56 | #include 57 | #include "vulkan_win32.h" 58 | #endif 59 | 60 | 61 | #ifdef VK_USE_PLATFORM_XCB_KHR 62 | #include 63 | #include "vulkan_xcb.h" 64 | #endif 65 | 66 | 67 | #ifdef VK_USE_PLATFORM_XLIB_KHR 68 | #include 69 | #include "vulkan_xlib.h" 70 | #endif 71 | 72 | 73 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 74 | #include 75 | #include 76 | #include "vulkan_xlib_xrandr.h" 77 | #endif 78 | 79 | #endif // VULKAN_H_ 80 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_H_ 2 | #define VULKAN_H_ 1 3 | 4 | /* 5 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 6 | ** 7 | ** Licensed under the Apache License, Version 2.0 (the "License"); 8 | ** you may not use this file except in compliance with the License. 9 | ** You may obtain a copy of the License at 10 | ** 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | */ 19 | 20 | #include "vk_platform.h" 21 | #include "vulkan_core.h" 22 | 23 | #ifdef VK_USE_PLATFORM_ANDROID_KHR 24 | #include "vulkan_android.h" 25 | #endif 26 | 27 | 28 | #ifdef VK_USE_PLATFORM_IOS_MVK 29 | #include "vulkan_ios.h" 30 | #endif 31 | 32 | 33 | #ifdef VK_USE_PLATFORM_MACOS_MVK 34 | #include "vulkan_macos.h" 35 | #endif 36 | 37 | 38 | #ifdef VK_USE_PLATFORM_MIR_KHR 39 | #include 40 | #include "vulkan_mir.h" 41 | #endif 42 | 43 | 44 | #ifdef VK_USE_PLATFORM_VI_NN 45 | #include "vulkan_vi.h" 46 | #endif 47 | 48 | 49 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR 50 | #include 51 | #include "vulkan_wayland.h" 52 | #endif 53 | 54 | 55 | #ifdef VK_USE_PLATFORM_WIN32_KHR 56 | #include 57 | #include "vulkan_win32.h" 58 | #endif 59 | 60 | 61 | #ifdef VK_USE_PLATFORM_XCB_KHR 62 | #include 63 | #include "vulkan_xcb.h" 64 | #endif 65 | 66 | 67 | #ifdef VK_USE_PLATFORM_XLIB_KHR 68 | #include 69 | #include "vulkan_xlib.h" 70 | #endif 71 | 72 | 73 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 74 | #include 75 | #include 76 | #include "vulkan_xlib_xrandr.h" 77 | #endif 78 | 79 | #endif // VULKAN_H_ 80 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_H_ 2 | #define VULKAN_H_ 1 3 | 4 | /* 5 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 6 | ** 7 | ** Licensed under the Apache License, Version 2.0 (the "License"); 8 | ** you may not use this file except in compliance with the License. 9 | ** You may obtain a copy of the License at 10 | ** 11 | ** http://www.apache.org/licenses/LICENSE-2.0 12 | ** 13 | ** Unless required by applicable law or agreed to in writing, software 14 | ** distributed under the License is distributed on an "AS IS" BASIS, 15 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | ** See the License for the specific language governing permissions and 17 | ** limitations under the License. 18 | */ 19 | 20 | #include "vk_platform.h" 21 | #include "vulkan_core.h" 22 | 23 | #ifdef VK_USE_PLATFORM_ANDROID_KHR 24 | #include "vulkan_android.h" 25 | #endif 26 | 27 | 28 | #ifdef VK_USE_PLATFORM_IOS_MVK 29 | #include "vulkan_ios.h" 30 | #endif 31 | 32 | 33 | #ifdef VK_USE_PLATFORM_MACOS_MVK 34 | #include "vulkan_macos.h" 35 | #endif 36 | 37 | 38 | #ifdef VK_USE_PLATFORM_MIR_KHR 39 | #include 40 | #include "vulkan_mir.h" 41 | #endif 42 | 43 | 44 | #ifdef VK_USE_PLATFORM_VI_NN 45 | #include "vulkan_vi.h" 46 | #endif 47 | 48 | 49 | #ifdef VK_USE_PLATFORM_WAYLAND_KHR 50 | #include 51 | #include "vulkan_wayland.h" 52 | #endif 53 | 54 | 55 | #ifdef VK_USE_PLATFORM_WIN32_KHR 56 | #include 57 | #include "vulkan_win32.h" 58 | #endif 59 | 60 | 61 | #ifdef VK_USE_PLATFORM_XCB_KHR 62 | #include 63 | #include "vulkan_xcb.h" 64 | #endif 65 | 66 | 67 | #ifdef VK_USE_PLATFORM_XLIB_KHR 68 | #include 69 | #include "vulkan_xlib.h" 70 | #endif 71 | 72 | 73 | #ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT 74 | #include 75 | #include 76 | #include "vulkan_xlib_xrandr.h" 77 | #endif 78 | 79 | #endif // VULKAN_H_ 80 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_vi.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_VI_H_ 2 | #define VULKAN_VI_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_NN_vi_surface 1 31 | #define VK_NN_VI_SURFACE_SPEC_VERSION 1 32 | #define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" 33 | 34 | typedef VkFlags VkViSurfaceCreateFlagsNN; 35 | 36 | typedef struct VkViSurfaceCreateInfoNN { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkViSurfaceCreateFlagsNN flags; 40 | void* window; 41 | } VkViSurfaceCreateInfoNN; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( 48 | VkInstance instance, 49 | const VkViSurfaceCreateInfoNN* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_vi.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_VI_H_ 2 | #define VULKAN_VI_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_NN_vi_surface 1 31 | #define VK_NN_VI_SURFACE_SPEC_VERSION 1 32 | #define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" 33 | 34 | typedef VkFlags VkViSurfaceCreateFlagsNN; 35 | 36 | typedef struct VkViSurfaceCreateInfoNN { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkViSurfaceCreateFlagsNN flags; 40 | void* window; 41 | } VkViSurfaceCreateInfoNN; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( 48 | VkInstance instance, 49 | const VkViSurfaceCreateInfoNN* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/GLSL.ext.EXT.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2014-2016 The Khronos Group Inc. 3 | ** 4 | ** Permission is hereby granted, free of charge, to any person obtaining a copy 5 | ** of this software and/or associated documentation files (the "Materials"), 6 | ** to deal in the Materials without restriction, including without limitation 7 | ** the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | ** and/or sell copies of the Materials, and to permit persons to whom the 9 | ** Materials are furnished to do so, subject to the following conditions: 10 | ** 11 | ** The above copyright notice and this permission notice shall be included in 12 | ** all copies or substantial portions of the Materials. 13 | ** 14 | ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS 15 | ** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND 16 | ** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 | ** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | ** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS 24 | ** IN THE MATERIALS. 25 | */ 26 | 27 | #ifndef GLSLextEXT_H 28 | #define GLSLextEXT_H 29 | 30 | static const int GLSLextEXTVersion = 100; 31 | static const int GLSLextEXTRevision = 1; 32 | 33 | static const char* const E_SPV_EXT_shader_stencil_export = "SPV_EXT_shader_stencil_export"; 34 | static const char* const E_SPV_EXT_shader_viewport_index_layer = "SPV_EXT_shader_viewport_index_layer"; 35 | static const char* const E_SPV_EXT_fragment_fully_covered = "SPV_EXT_fragment_fully_covered"; 36 | 37 | #endif // #ifndef GLSLextEXT_H 38 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/glslang/Include/InitializeGlobals.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2002-2005 3Dlabs Inc. Ltd. 3 | // All rights reserved. 4 | // 5 | // Redistribution and use in source and binary forms, with or without 6 | // modification, are permitted provided that the following conditions 7 | // are met: 8 | // 9 | // Redistributions of source code must retain the above copyright 10 | // notice, this list of conditions and the following disclaimer. 11 | // 12 | // Redistributions in binary form must reproduce the above 13 | // copyright notice, this list of conditions and the following 14 | // disclaimer in the documentation and/or other materials provided 15 | // with the distribution. 16 | // 17 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 18 | // contributors may be used to endorse or promote products derived 19 | // from this software without specific prior written permission. 20 | // 21 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 24 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 25 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 29 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 31 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | // POSSIBILITY OF SUCH DAMAGE. 33 | // 34 | 35 | #ifndef __INITIALIZE_GLOBALS_INCLUDED_ 36 | #define __INITIALIZE_GLOBALS_INCLUDED_ 37 | 38 | namespace glslang { 39 | 40 | bool InitializePoolIndex(); 41 | 42 | } // end namespace glslang 43 | 44 | #endif // __INITIALIZE_GLOBALS_INCLUDED_ 45 | -------------------------------------------------------------------------------- /render-hal-vk/src/lib.rs: -------------------------------------------------------------------------------- 1 | #![allow(unused_imports)] 2 | 3 | #[macro_use] 4 | extern crate failure; 5 | #[macro_use] 6 | extern crate log; 7 | extern crate chrono; 8 | extern crate crossbeam_channel; 9 | extern crate fern; 10 | extern crate relevant; 11 | extern crate smallvec; 12 | #[macro_use] 13 | extern crate enum_primitive; 14 | extern crate digest; 15 | extern crate meowhash; 16 | extern crate num_traits; 17 | extern crate render_core; 18 | #[cfg(not(target_os = "macos"))] 19 | extern crate renderdoc; 20 | extern crate spirv_reflect; 21 | extern crate twox_hash; 22 | 23 | #[macro_use] 24 | extern crate downcast_rs; 25 | 26 | #[macro_use] 27 | extern crate ash; 28 | extern crate vk_mem; 29 | extern crate vk_sync; 30 | 31 | #[cfg(target_os = "windows")] 32 | extern crate winapi; 33 | 34 | #[cfg(target_os = "macos")] 35 | extern crate cocoa; 36 | #[cfg(target_os = "macos")] 37 | extern crate metal_rs as metal; 38 | #[cfg(target_os = "macos")] 39 | #[macro_use] 40 | extern crate objc; 41 | #[cfg(target_os = "macos")] 42 | use cocoa::appkit::{NSView, NSWindow}; 43 | #[cfg(target_os = "macos")] 44 | use cocoa::base::id as cocoa_id; 45 | #[cfg(target_os = "macos")] 46 | use metal::CoreAnimationLayer; 47 | #[cfg(target_os = "macos")] 48 | use objc::runtime::YES; 49 | #[cfg(target_os = "macos")] 50 | use std::mem; 51 | 52 | #[cfg(target_os = "windows")] 53 | use ash::extensions::khr::Win32Surface; 54 | #[cfg(all(unix, not(target_os = "android"), not(target_os = "macos")))] 55 | use ash::extensions::khr::XlibSurface; 56 | #[cfg(target_os = "macos")] 57 | use ash::extensions::mvk::MacOSSurface; 58 | 59 | use crate::module::RenderBackendModuleVk; 60 | use render_core::backend::{RenderBackend, RenderBackendModule}; 61 | 62 | mod allocator; 63 | mod backend; 64 | mod compile; 65 | mod debug; 66 | mod descriptors; 67 | mod device; 68 | mod module; 69 | mod queue; 70 | mod raw; 71 | mod shader_views; 72 | mod types; 73 | 74 | #[no_mangle] 75 | pub extern "C" fn render_backend_factory() -> Box { 76 | Box::new(RenderBackendModuleVk::new()) 77 | } 78 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_ios.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_IOS_H_ 2 | #define VULKAN_IOS_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_MVK_ios_surface 1 31 | #define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 32 | #define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" 33 | 34 | typedef VkFlags VkIOSSurfaceCreateFlagsMVK; 35 | 36 | typedef struct VkIOSSurfaceCreateInfoMVK { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkIOSSurfaceCreateFlagsMVK flags; 40 | const void* pView; 41 | } VkIOSSurfaceCreateInfoMVK; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( 48 | VkInstance instance, 49 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_ios.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_IOS_H_ 2 | #define VULKAN_IOS_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_MVK_ios_surface 1 31 | #define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 32 | #define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" 33 | 34 | typedef VkFlags VkIOSSurfaceCreateFlagsMVK; 35 | 36 | typedef struct VkIOSSurfaceCreateInfoMVK { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkIOSSurfaceCreateFlagsMVK flags; 40 | const void* pView; 41 | } VkIOSSurfaceCreateInfoMVK; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( 48 | VkInstance instance, 49 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_vi.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_VI_H_ 2 | #define VULKAN_VI_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_NN_vi_surface 1 31 | #define VK_NN_VI_SURFACE_SPEC_VERSION 1 32 | #define VK_NN_VI_SURFACE_EXTENSION_NAME "VK_NN_vi_surface" 33 | 34 | typedef VkFlags VkViSurfaceCreateFlagsNN; 35 | 36 | typedef struct VkViSurfaceCreateInfoNN { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkViSurfaceCreateFlagsNN flags; 40 | void* window; 41 | } VkViSurfaceCreateInfoNN; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateViSurfaceNN)(VkInstance instance, const VkViSurfaceCreateInfoNN* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateViSurfaceNN( 48 | VkInstance instance, 49 | const VkViSurfaceCreateInfoNN* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_ios.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_IOS_H_ 2 | #define VULKAN_IOS_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_MVK_ios_surface 1 31 | #define VK_MVK_IOS_SURFACE_SPEC_VERSION 2 32 | #define VK_MVK_IOS_SURFACE_EXTENSION_NAME "VK_MVK_ios_surface" 33 | 34 | typedef VkFlags VkIOSSurfaceCreateFlagsMVK; 35 | 36 | typedef struct VkIOSSurfaceCreateInfoMVK { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkIOSSurfaceCreateFlagsMVK flags; 40 | const void* pView; 41 | } VkIOSSurfaceCreateInfoMVK; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateIOSSurfaceMVK)(VkInstance instance, const VkIOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateIOSSurfaceMVK( 48 | VkInstance instance, 49 | const VkIOSSurfaceCreateInfoMVK* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_macos.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_MACOS_H_ 2 | #define VULKAN_MACOS_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_MVK_macos_surface 1 31 | #define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 32 | #define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" 33 | 34 | typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; 35 | 36 | typedef struct VkMacOSSurfaceCreateInfoMVK { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMacOSSurfaceCreateFlagsMVK flags; 40 | const void* pView; 41 | } VkMacOSSurfaceCreateInfoMVK; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( 48 | VkInstance instance, 49 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_macos.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_MACOS_H_ 2 | #define VULKAN_MACOS_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_MVK_macos_surface 1 31 | #define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 32 | #define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" 33 | 34 | typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; 35 | 36 | typedef struct VkMacOSSurfaceCreateInfoMVK { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMacOSSurfaceCreateFlagsMVK flags; 40 | const void* pView; 41 | } VkMacOSSurfaceCreateInfoMVK; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( 48 | VkInstance instance, 49 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_macos.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_MACOS_H_ 2 | #define VULKAN_MACOS_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_MVK_macos_surface 1 31 | #define VK_MVK_MACOS_SURFACE_SPEC_VERSION 2 32 | #define VK_MVK_MACOS_SURFACE_EXTENSION_NAME "VK_MVK_macos_surface" 33 | 34 | typedef VkFlags VkMacOSSurfaceCreateFlagsMVK; 35 | 36 | typedef struct VkMacOSSurfaceCreateInfoMVK { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMacOSSurfaceCreateFlagsMVK flags; 40 | const void* pView; 41 | } VkMacOSSurfaceCreateInfoMVK; 42 | 43 | 44 | typedef VkResult (VKAPI_PTR *PFN_vkCreateMacOSSurfaceMVK)(VkInstance instance, const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 45 | 46 | #ifndef VK_NO_PROTOTYPES 47 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateMacOSSurfaceMVK( 48 | VkInstance instance, 49 | const VkMacOSSurfaceCreateInfoMVK* pCreateInfo, 50 | const VkAllocationCallbacks* pAllocator, 51 | VkSurfaceKHR* pSurface); 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_xlib_xrandr.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_XRANDR_H_ 2 | #define VULKAN_XLIB_XRANDR_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_EXT_acquire_xlib_display 1 31 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 32 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" 33 | 34 | typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); 35 | typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); 36 | 37 | #ifndef VK_NO_PROTOTYPES 38 | VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( 39 | VkPhysicalDevice physicalDevice, 40 | Display* dpy, 41 | VkDisplayKHR display); 42 | 43 | VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( 44 | VkPhysicalDevice physicalDevice, 45 | Display* dpy, 46 | RROutput rrOutput, 47 | VkDisplayKHR* pDisplay); 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_xlib_xrandr.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_XRANDR_H_ 2 | #define VULKAN_XLIB_XRANDR_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_EXT_acquire_xlib_display 1 31 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 32 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" 33 | 34 | typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); 35 | typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); 36 | 37 | #ifndef VK_NO_PROTOTYPES 38 | VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( 39 | VkPhysicalDevice physicalDevice, 40 | Display* dpy, 41 | VkDisplayKHR display); 42 | 43 | VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( 44 | VkPhysicalDevice physicalDevice, 45 | Display* dpy, 46 | RROutput rrOutput, 47 | VkDisplayKHR* pDisplay); 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_xlib_xrandr.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_XRANDR_H_ 2 | #define VULKAN_XLIB_XRANDR_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_EXT_acquire_xlib_display 1 31 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_SPEC_VERSION 1 32 | #define VK_EXT_ACQUIRE_XLIB_DISPLAY_EXTENSION_NAME "VK_EXT_acquire_xlib_display" 33 | 34 | typedef VkResult (VKAPI_PTR *PFN_vkAcquireXlibDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, VkDisplayKHR display); 35 | typedef VkResult (VKAPI_PTR *PFN_vkGetRandROutputDisplayEXT)(VkPhysicalDevice physicalDevice, Display* dpy, RROutput rrOutput, VkDisplayKHR* pDisplay); 36 | 37 | #ifndef VK_NO_PROTOTYPES 38 | VKAPI_ATTR VkResult VKAPI_CALL vkAcquireXlibDisplayEXT( 39 | VkPhysicalDevice physicalDevice, 40 | Display* dpy, 41 | VkDisplayKHR display); 42 | 43 | VKAPI_ATTR VkResult VKAPI_CALL vkGetRandROutputDisplayEXT( 44 | VkPhysicalDevice physicalDevice, 45 | Display* dpy, 46 | RROutput rrOutput, 47 | VkDisplayKHR* pDisplay); 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/disassemble.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014-2015 LunarG, Inc. 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions 8 | // are met: 9 | // 10 | // Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // 13 | // Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following 15 | // disclaimer in the documentation and/or other materials provided 16 | // with the distribution. 17 | // 18 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 19 | // contributors may be used to endorse or promote products derived 20 | // from this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | // POSSIBILITY OF SUCH DAMAGE. 34 | 35 | // 36 | // Disassembler for SPIR-V. 37 | // 38 | 39 | #pragma once 40 | #ifndef disassembler_H 41 | #define disassembler_H 42 | 43 | #include 44 | #include 45 | 46 | namespace spv { 47 | 48 | // disassemble with glslang custom disassembler 49 | void Disassemble(std::ostream& out, const std::vector&); 50 | 51 | }; // end namespace spv 52 | 53 | #endif // disassembler_H 54 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vk_sdk_platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // File: vk_sdk_platform.h 3 | // 4 | /* 5 | * Copyright (c) 2015-2016 The Khronos Group Inc. 6 | * Copyright (c) 2015-2016 Valve Corporation 7 | * Copyright (c) 2015-2016 LunarG, Inc. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef VK_SDK_PLATFORM_H 23 | #define VK_SDK_PLATFORM_H 24 | 25 | #if defined(_WIN32) 26 | #define NOMINMAX 27 | #ifndef __cplusplus 28 | #undef inline 29 | #define inline __inline 30 | #endif // __cplusplus 31 | 32 | #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) 33 | // C99: 34 | // Microsoft didn't implement C99 in Visual Studio; but started adding it with 35 | // VS2013. However, VS2013 still didn't have snprintf(). The following is a 36 | // work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the 37 | // "CMakeLists.txt" file). 38 | // NOTE: This is fixed in Visual Studio 2015. 39 | #define snprintf _snprintf 40 | #endif 41 | 42 | #define strdup _strdup 43 | 44 | #endif // _WIN32 45 | 46 | // Check for noexcept support using clang, with fallback to Windows or GCC version numbers 47 | #ifndef NOEXCEPT 48 | #if defined(__clang__) 49 | #if __has_feature(cxx_noexcept) 50 | #define HAS_NOEXCEPT 51 | #endif 52 | #else 53 | #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 54 | #define HAS_NOEXCEPT 55 | #else 56 | #if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS 57 | #define HAS_NOEXCEPT 58 | #endif 59 | #endif 60 | #endif 61 | 62 | #ifdef HAS_NOEXCEPT 63 | #define NOEXCEPT noexcept 64 | #else 65 | #define NOEXCEPT 66 | #endif 67 | #endif 68 | 69 | #endif // VK_SDK_PLATFORM_H 70 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vk_sdk_platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // File: vk_sdk_platform.h 3 | // 4 | /* 5 | * Copyright (c) 2015-2016 The Khronos Group Inc. 6 | * Copyright (c) 2015-2016 Valve Corporation 7 | * Copyright (c) 2015-2016 LunarG, Inc. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef VK_SDK_PLATFORM_H 23 | #define VK_SDK_PLATFORM_H 24 | 25 | #if defined(_WIN32) 26 | #define NOMINMAX 27 | #ifndef __cplusplus 28 | #undef inline 29 | #define inline __inline 30 | #endif // __cplusplus 31 | 32 | #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) 33 | // C99: 34 | // Microsoft didn't implement C99 in Visual Studio; but started adding it with 35 | // VS2013. However, VS2013 still didn't have snprintf(). The following is a 36 | // work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the 37 | // "CMakeLists.txt" file). 38 | // NOTE: This is fixed in Visual Studio 2015. 39 | #define snprintf _snprintf 40 | #endif 41 | 42 | #define strdup _strdup 43 | 44 | #endif // _WIN32 45 | 46 | // Check for noexcept support using clang, with fallback to Windows or GCC version numbers 47 | #ifndef NOEXCEPT 48 | #if defined(__clang__) 49 | #if __has_feature(cxx_noexcept) 50 | #define HAS_NOEXCEPT 51 | #endif 52 | #else 53 | #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 54 | #define HAS_NOEXCEPT 55 | #else 56 | #if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS 57 | #define HAS_NOEXCEPT 58 | #endif 59 | #endif 60 | #endif 61 | 62 | #ifdef HAS_NOEXCEPT 63 | #define NOEXCEPT noexcept 64 | #else 65 | #define NOEXCEPT 66 | #endif 67 | #endif 68 | 69 | #endif // VK_SDK_PLATFORM_H 70 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vk_sdk_platform.h: -------------------------------------------------------------------------------- 1 | // 2 | // File: vk_sdk_platform.h 3 | // 4 | /* 5 | * Copyright (c) 2015-2016 The Khronos Group Inc. 6 | * Copyright (c) 2015-2016 Valve Corporation 7 | * Copyright (c) 2015-2016 LunarG, Inc. 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, software 16 | * distributed under the License is distributed on an "AS IS" BASIS, 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 18 | * See the License for the specific language governing permissions and 19 | * limitations under the License. 20 | */ 21 | 22 | #ifndef VK_SDK_PLATFORM_H 23 | #define VK_SDK_PLATFORM_H 24 | 25 | #if defined(_WIN32) 26 | #define NOMINMAX 27 | #ifndef __cplusplus 28 | #undef inline 29 | #define inline __inline 30 | #endif // __cplusplus 31 | 32 | #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) 33 | // C99: 34 | // Microsoft didn't implement C99 in Visual Studio; but started adding it with 35 | // VS2013. However, VS2013 still didn't have snprintf(). The following is a 36 | // work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the 37 | // "CMakeLists.txt" file). 38 | // NOTE: This is fixed in Visual Studio 2015. 39 | #define snprintf _snprintf 40 | #endif 41 | 42 | #define strdup _strdup 43 | 44 | #endif // _WIN32 45 | 46 | // Check for noexcept support using clang, with fallback to Windows or GCC version numbers 47 | #ifndef NOEXCEPT 48 | #if defined(__clang__) 49 | #if __has_feature(cxx_noexcept) 50 | #define HAS_NOEXCEPT 51 | #endif 52 | #else 53 | #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ * 10 + __GNUC_MINOR__ >= 46 54 | #define HAS_NOEXCEPT 55 | #else 56 | #if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023026 && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS 57 | #define HAS_NOEXCEPT 58 | #endif 59 | #endif 60 | #endif 61 | 62 | #ifdef HAS_NOEXCEPT 63 | #define NOEXCEPT noexcept 64 | #else 65 | #define NOEXCEPT 66 | #endif 67 | #endif 68 | 69 | #endif // VK_SDK_PLATFORM_H 70 | -------------------------------------------------------------------------------- /render-core/src/modules.rs: -------------------------------------------------------------------------------- 1 | use crate::backend::RenderBackendModule; 2 | use crate::error::{Error, Result}; 3 | use failure::Fail; 4 | use glob::glob; 5 | use libloading::{Library, Symbol}; 6 | use std::borrow::Borrow; 7 | use std::env; 8 | use std::path::Path; 9 | 10 | pub(crate) type FactoryFunc = extern "C" fn() -> Box; 11 | 12 | type LibResult = ::std::io::Result; 13 | 14 | #[cfg(target_os = "windows")] 15 | const LIBRARY_EXT: &'static str = "dll"; 16 | 17 | #[cfg(target_os = "macos")] 18 | const LIBRARY_EXT: &'static str = "dylib"; 19 | 20 | #[cfg(all(unix, not(target_os = "macos")))] 21 | const LIBRARY_EXT: &'static str = "so"; 22 | 23 | pub(crate) fn is_backend_module(module_path: &Path) -> bool { 24 | if let Ok(library) = Library::new(&module_path) { 25 | let factory_func: LibResult> = 26 | unsafe { library.get(b"render_backend_factory") }; 27 | factory_func.is_ok() 28 | } else { 29 | false 30 | } 31 | } 32 | 33 | pub fn create_backend_module(library: &Box) -> Result> { 34 | let factory_func: LibResult> = 35 | unsafe { library.get(b"render_backend_factory") }; 36 | if let Ok(factory_func) = factory_func { 37 | let backend_module = factory_func(); 38 | Ok(backend_module) 39 | } else { 40 | Err(Error::backend("create backend module failed")) 41 | } 42 | } 43 | 44 | pub fn load_backend_modules(module_path: &Path) -> Result>> { 45 | info!("Loading render backend modules from {:?}", module_path); 46 | let path_str = module_path 47 | .as_os_str() 48 | .to_str() 49 | .expect("failed to parse module path"); 50 | //let path_glob = format!("{}/**/*.{}", path_str, LIBRARY_EXT); 51 | let path_glob = format!("{}/*.{}", path_str, LIBRARY_EXT); 52 | //info!("path glob: {}", path_glob); 53 | 54 | let mut modules: Vec> = vec![]; 55 | 56 | for entry in glob(&path_glob).expect("Failed to read glob pattern") { 57 | match entry { 58 | Ok(path) => { 59 | let valid_module = is_backend_module(&path); 60 | if valid_module { 61 | modules.push(Box::new(Library::new(&path).unwrap())); 62 | } 63 | } 64 | Err(e) => error!("{:?}", e), 65 | } 66 | } 67 | 68 | Ok(modules) 69 | } 70 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/glslang/MachineIndependent/iomapper.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2016 LunarG, Inc. 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions 8 | // are met: 9 | // 10 | // Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // 13 | // Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following 15 | // disclaimer in the documentation and/or other materials provided 16 | // with the distribution. 17 | // 18 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 19 | // contributors may be used to endorse or promote products derived 20 | // from this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | // POSSIBILITY OF SUCH DAMAGE. 34 | // 35 | 36 | #ifndef _IOMAPPER_INCLUDED 37 | #define _IOMAPPER_INCLUDED 38 | 39 | #include "../Public/ShaderLang.h" 40 | 41 | // 42 | // A reflection database and its interface, consistent with the OpenGL API reflection queries. 43 | // 44 | 45 | class TInfoSink; 46 | 47 | namespace glslang { 48 | 49 | class TIntermediate; 50 | 51 | // I/O mapper 52 | class TIoMapper { 53 | public: 54 | TIoMapper() {} 55 | virtual ~TIoMapper() {} 56 | 57 | // grow the reflection stage by stage 58 | bool addStage(EShLanguage, TIntermediate&, TInfoSink&, TIoMapResolver*); 59 | }; 60 | 61 | } // end namespace glslang 62 | 63 | #endif // _IOMAPPER_INCLUDED 64 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_mir.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_MIR_H_ 2 | #define VULKAN_MIR_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_mir_surface 1 31 | #define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 32 | #define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" 33 | 34 | typedef VkFlags VkMirSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkMirSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMirSurfaceCreateFlagsKHR flags; 40 | MirConnection* connection; 41 | MirSurface* mirSurface; 42 | } VkMirSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( 50 | VkInstance instance, 51 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | MirConnection* connection); 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_mir.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_MIR_H_ 2 | #define VULKAN_MIR_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_mir_surface 1 31 | #define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 32 | #define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" 33 | 34 | typedef VkFlags VkMirSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkMirSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMirSurfaceCreateFlagsKHR flags; 40 | MirConnection* connection; 41 | MirSurface* mirSurface; 42 | } VkMirSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( 50 | VkInstance instance, 51 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | MirConnection* connection); 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /render-core/src/backend.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | #![allow(unused_imports)] 3 | 4 | use crate::device::{RenderDevice, RenderDeviceId, RenderDeviceInfo}; 5 | use crate::error::{Error, Result}; 6 | use failure::Fail; 7 | use std::fmt; 8 | use std::sync::{Arc, RwLock}; 9 | 10 | bitflags! { 11 | pub struct RenderDebugFlags: u32 { 12 | /// No debugger support. 13 | const NONE = 0x0; 14 | 15 | /// Enable RenderDoc integration. 16 | const RENDER_DOC = 0x1; 17 | 18 | /// Enable PIX integration. 19 | const PIX = 0x2; 20 | 21 | /// Enable CPU validation layer(s) 22 | const CPU_VALIDATION = 0x4; 23 | 24 | /// Enable GPU validation layer(s) 25 | const GPU_VALIDATION = 0x8; 26 | 27 | /// Enable post crash analysis layer 28 | const POST_CRASH_ANALYSIS = 0x10; 29 | } 30 | } 31 | 32 | /*pub enum RenderBackendApi { 33 | Dx12, 34 | Vulkan, 35 | Metal, 36 | Mock, 37 | Proxy(String), 38 | }*/ 39 | 40 | #[derive(Clone, Debug, PartialEq, Eq)] 41 | pub struct RenderBackendSettings { 42 | /// API to use (i.e. "Dx12", "Vulkan", etc) 43 | pub api: String, //RenderBackendApi, 44 | 45 | /// Address to use (i.e. when routing through proxy) 46 | /// i.e. x.x.x.x:50080 47 | pub address: Option, 48 | 49 | //Handle deviceWindow = nullptr; 50 | pub debug_flags: RenderDebugFlags, 51 | } 52 | 53 | pub trait RenderBackend: fmt::Debug { 54 | fn is_initialized(&self) -> bool; 55 | 56 | fn enumerate_devices( 57 | &mut self, 58 | max_devices: u32, 59 | mirror_count: u32, 60 | software: bool, 61 | ) -> Result>; 62 | 63 | fn create_device(&mut self, device_id: RenderDeviceId) -> Result<()>; 64 | fn destroy_device(&mut self, device_id: RenderDeviceId) -> Result<()>; 65 | fn get_device( 66 | &self, 67 | device_id: RenderDeviceId, 68 | ) -> Result>>>>; 69 | 70 | fn begin_debug_capture(&self, name: &str) -> Result<()>; 71 | fn finish_debug_capture(&self) -> Result<()>; 72 | fn trigger_debug_capture(&self) -> Result<()>; 73 | fn launch_debug_capture(&self, quit: bool) -> Result<()>; 74 | } 75 | 76 | pub struct RenderBackendRegistry { 77 | pub settings: RenderBackendSettings, 78 | pub backend: Arc>>, 79 | } 80 | 81 | pub trait RenderBackendModule: fmt::Debug { 82 | fn name(&self) -> &'static str; 83 | fn api(&self) -> &'static str; 84 | fn create(&self) -> Box; 85 | } 86 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_mir.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_MIR_H_ 2 | #define VULKAN_MIR_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_mir_surface 1 31 | #define VK_KHR_MIR_SURFACE_SPEC_VERSION 4 32 | #define VK_KHR_MIR_SURFACE_EXTENSION_NAME "VK_KHR_mir_surface" 33 | 34 | typedef VkFlags VkMirSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkMirSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkMirSurfaceCreateFlagsKHR flags; 40 | MirConnection* connection; 41 | MirSurface* mirSurface; 42 | } VkMirSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateMirSurfaceKHR)(VkInstance instance, const VkMirSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceMirPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, MirConnection* connection); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateMirSurfaceKHR( 50 | VkInstance instance, 51 | const VkMirSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceMirPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | MirConnection* connection); 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_wayland.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_WAYLAND_H_ 2 | #define VULKAN_WAYLAND_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_wayland_surface 1 31 | #define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" 33 | 34 | typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkWaylandSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkWaylandSurfaceCreateFlagsKHR flags; 40 | struct wl_display* display; 41 | struct wl_surface* surface; 42 | } VkWaylandSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( 50 | VkInstance instance, 51 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | struct wl_display* display); 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_xlib.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_H_ 2 | #define VULKAN_XLIB_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_xlib_surface 1 31 | #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" 33 | 34 | typedef VkFlags VkXlibSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkXlibSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkXlibSurfaceCreateFlagsKHR flags; 40 | Display* dpy; 41 | Window window; 42 | } VkXlibSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( 50 | VkInstance instance, 51 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | Display* dpy, 59 | VisualID visualID); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_wayland.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_WAYLAND_H_ 2 | #define VULKAN_WAYLAND_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_wayland_surface 1 31 | #define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" 33 | 34 | typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkWaylandSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkWaylandSurfaceCreateFlagsKHR flags; 40 | struct wl_display* display; 41 | struct wl_surface* surface; 42 | } VkWaylandSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( 50 | VkInstance instance, 51 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | struct wl_display* display); 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_xlib.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_H_ 2 | #define VULKAN_XLIB_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_xlib_surface 1 31 | #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" 33 | 34 | typedef VkFlags VkXlibSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkXlibSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkXlibSurfaceCreateFlagsKHR flags; 40 | Display* dpy; 41 | Window window; 42 | } VkXlibSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( 50 | VkInstance instance, 51 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | Display* dpy, 59 | VisualID visualID); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/MoltenVK/include/vulkan/vulkan_xcb.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XCB_H_ 2 | #define VULKAN_XCB_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_xcb_surface 1 31 | #define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" 33 | 34 | typedef VkFlags VkXcbSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkXcbSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkXcbSurfaceCreateFlagsKHR flags; 40 | xcb_connection_t* connection; 41 | xcb_window_t window; 42 | } VkXcbSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( 50 | VkInstance instance, 51 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | xcb_connection_t* connection, 59 | xcb_visualid_t visual_id); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/vulkan/vulkan_xcb.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XCB_H_ 2 | #define VULKAN_XCB_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_xcb_surface 1 31 | #define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" 33 | 34 | typedef VkFlags VkXcbSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkXcbSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkXcbSurfaceCreateFlagsKHR flags; 40 | xcb_connection_t* connection; 41 | xcb_window_t window; 42 | } VkXcbSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( 50 | VkInstance instance, 51 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | xcb_connection_t* connection, 59 | xcb_visualid_t visual_id); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_wayland.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_WAYLAND_H_ 2 | #define VULKAN_WAYLAND_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_wayland_surface 1 31 | #define VK_KHR_WAYLAND_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME "VK_KHR_wayland_surface" 33 | 34 | typedef VkFlags VkWaylandSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkWaylandSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkWaylandSurfaceCreateFlagsKHR flags; 40 | struct wl_display* display; 41 | struct wl_surface* surface; 42 | } VkWaylandSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateWaylandSurfaceKHR)(VkInstance instance, const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, struct wl_display* display); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateWaylandSurfaceKHR( 50 | VkInstance instance, 51 | const VkWaylandSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceWaylandPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | struct wl_display* display); 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_xlib.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XLIB_H_ 2 | #define VULKAN_XLIB_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_xlib_surface 1 31 | #define VK_KHR_XLIB_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_XLIB_SURFACE_EXTENSION_NAME "VK_KHR_xlib_surface" 33 | 34 | typedef VkFlags VkXlibSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkXlibSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkXlibSurfaceCreateFlagsKHR flags; 40 | Display* dpy; 41 | Window window; 42 | } VkXlibSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXlibSurfaceKHR)(VkInstance instance, const VkXlibSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXlibPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, Display* dpy, VisualID visualID); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXlibSurfaceKHR( 50 | VkInstance instance, 51 | const VkXlibSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXlibPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | Display* dpy, 59 | VisualID visualID); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/Frameworks/vulkan.framework/Versions/A/Headers/vulkan_xcb.h: -------------------------------------------------------------------------------- 1 | #ifndef VULKAN_XCB_H_ 2 | #define VULKAN_XCB_H_ 1 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | /* 9 | ** Copyright (c) 2015-2018 The Khronos Group Inc. 10 | ** 11 | ** Licensed under the Apache License, Version 2.0 (the "License"); 12 | ** you may not use this file except in compliance with the License. 13 | ** You may obtain a copy of the License at 14 | ** 15 | ** http://www.apache.org/licenses/LICENSE-2.0 16 | ** 17 | ** Unless required by applicable law or agreed to in writing, software 18 | ** distributed under the License is distributed on an "AS IS" BASIS, 19 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 20 | ** See the License for the specific language governing permissions and 21 | ** limitations under the License. 22 | */ 23 | 24 | /* 25 | ** This header is generated from the Khronos Vulkan XML API Registry. 26 | ** 27 | */ 28 | 29 | 30 | #define VK_KHR_xcb_surface 1 31 | #define VK_KHR_XCB_SURFACE_SPEC_VERSION 6 32 | #define VK_KHR_XCB_SURFACE_EXTENSION_NAME "VK_KHR_xcb_surface" 33 | 34 | typedef VkFlags VkXcbSurfaceCreateFlagsKHR; 35 | 36 | typedef struct VkXcbSurfaceCreateInfoKHR { 37 | VkStructureType sType; 38 | const void* pNext; 39 | VkXcbSurfaceCreateFlagsKHR flags; 40 | xcb_connection_t* connection; 41 | xcb_window_t window; 42 | } VkXcbSurfaceCreateInfoKHR; 43 | 44 | 45 | typedef VkResult (VKAPI_PTR *PFN_vkCreateXcbSurfaceKHR)(VkInstance instance, const VkXcbSurfaceCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface); 46 | typedef VkBool32 (VKAPI_PTR *PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR)(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); 47 | 48 | #ifndef VK_NO_PROTOTYPES 49 | VKAPI_ATTR VkResult VKAPI_CALL vkCreateXcbSurfaceKHR( 50 | VkInstance instance, 51 | const VkXcbSurfaceCreateInfoKHR* pCreateInfo, 52 | const VkAllocationCallbacks* pAllocator, 53 | VkSurfaceKHR* pSurface); 54 | 55 | VKAPI_ATTR VkBool32 VKAPI_CALL vkGetPhysicalDeviceXcbPresentationSupportKHR( 56 | VkPhysicalDevice physicalDevice, 57 | uint32_t queueFamilyIndex, 58 | xcb_connection_t* connection, 59 | xcb_visualid_t visual_id); 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/GLSL.ext.KHR.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2014-2016 The Khronos Group Inc. 3 | ** 4 | ** Permission is hereby granted, free of charge, to any person obtaining a copy 5 | ** of this software and/or associated documentation files (the "Materials"), 6 | ** to deal in the Materials without restriction, including without limitation 7 | ** the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | ** and/or sell copies of the Materials, and to permit persons to whom the 9 | ** Materials are furnished to do so, subject to the following conditions: 10 | ** 11 | ** The above copyright notice and this permission notice shall be included in 12 | ** all copies or substantial portions of the Materials. 13 | ** 14 | ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS 15 | ** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND 16 | ** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 | ** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | ** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS 24 | ** IN THE MATERIALS. 25 | */ 26 | 27 | #ifndef GLSLextKHR_H 28 | #define GLSLextKHR_H 29 | 30 | static const int GLSLextKHRVersion = 100; 31 | static const int GLSLextKHRRevision = 2; 32 | 33 | static const char* const E_SPV_KHR_shader_ballot = "SPV_KHR_shader_ballot"; 34 | static const char* const E_SPV_KHR_subgroup_vote = "SPV_KHR_subgroup_vote"; 35 | static const char* const E_SPV_KHR_device_group = "SPV_KHR_device_group"; 36 | static const char* const E_SPV_KHR_multiview = "SPV_KHR_multiview"; 37 | static const char* const E_SPV_KHR_shader_draw_parameters = "SPV_KHR_shader_draw_parameters"; 38 | static const char* const E_SPV_KHR_16bit_storage = "SPV_KHR_16bit_storage"; 39 | static const char* const E_SPV_KHR_8bit_storage = "SPV_KHR_8bit_storage"; 40 | static const char* const E_SPV_KHR_storage_buffer_storage_class = "SPV_KHR_storage_buffer_storage_class"; 41 | static const char* const E_SPV_KHR_post_depth_coverage = "SPV_KHR_post_depth_coverage"; 42 | static const char* const E_SPV_KHR_vulkan_memory_model = "SPV_KHR_vulkan_memory_model"; 43 | 44 | #endif // #ifndef GLSLextKHR_H 45 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/glslang/MachineIndependent/propagateNoContraction.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2015-2016 Google, Inc. 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions 8 | // are met: 9 | // 10 | // Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // 13 | // Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following 15 | // disclaimer in the documentation and/or other materials provided 16 | // with the distribution. 17 | // 18 | // Neither the name of Google Inc. nor the names of its 19 | // contributors may be used to endorse or promote products derived 20 | // from this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | // POSSIBILITY OF SUCH DAMAGE. 34 | 35 | // 36 | // Visit the nodes in the glslang intermediate tree representation to 37 | // propagate 'noContraction' qualifier. 38 | // 39 | 40 | #pragma once 41 | 42 | #include "../Include/intermediate.h" 43 | 44 | namespace glslang { 45 | 46 | // Propagates the 'precise' qualifier for objects (objects marked with 47 | // 'noContraction' qualifier) from the shader source specified 'precise' 48 | // variables to all the involved objects, and add 'noContraction' qualifier for 49 | // the involved arithmetic operations. 50 | // Note that the same qualifier: 'noContraction' is used in both object nodes 51 | // and arithmetic operation nodes, but has different meaning. For object nodes, 52 | // 'noContraction' means the object is 'precise'; and for arithmetic operation 53 | // nodes, it means the operation should not be contracted. 54 | void PropagateNoContraction(const glslang::TIntermediate& intermediate); 55 | }; 56 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/GlslangToSpv.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014 LunarG, Inc. 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions 8 | // are met: 9 | // 10 | // Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // 13 | // Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following 15 | // disclaimer in the documentation and/or other materials provided 16 | // with the distribution. 17 | // 18 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 19 | // contributors may be used to endorse or promote products derived 20 | // from this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | // POSSIBILITY OF SUCH DAMAGE. 34 | 35 | #pragma once 36 | 37 | #if defined(_MSC_VER) && _MSC_VER >= 1900 38 | #pragma warning(disable : 4464) // relative include path contains '..' 39 | #endif 40 | 41 | #include "SpvTools.h" 42 | #include "../glslang/Include/intermediate.h" 43 | 44 | #include 45 | #include 46 | 47 | #include "Logger.h" 48 | 49 | namespace glslang { 50 | 51 | void GetSpirvVersion(std::string&); 52 | int GetSpirvGeneratorVersion(); 53 | void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, 54 | SpvOptions* options = nullptr); 55 | void GlslangToSpv(const glslang::TIntermediate& intermediate, std::vector& spirv, 56 | spv::SpvBuildLogger* logger, SpvOptions* options = nullptr); 57 | void OutputSpvBin(const std::vector& spirv, const char* baseName); 58 | void OutputSpvHex(const std::vector& spirv, const char* baseName, const char* varName); 59 | 60 | } 61 | -------------------------------------------------------------------------------- /render-core/tests/format.rs: -------------------------------------------------------------------------------- 1 | //use enum_count::EnumCount; 2 | use enum_primitive::FromPrimitive; 3 | use render_core::format::build_format; 4 | use render_core::format::channel_format_component_count; 5 | use render_core::format::channel_format_has_alpha; 6 | use render_core::format::channel_format_has_depth; 7 | use render_core::format::channel_format_has_stencil; 8 | use render_core::format::channel_format_is_compressed; 9 | use render_core::format::channel_format_min_dimensions; 10 | use render_core::format::format_has_depth; 11 | use render_core::format::format_has_stencil; 12 | use render_core::types::RenderChannelFormat; 13 | use render_core::types::RenderFormat; 14 | use render_core::types::RenderNumericFormat; 15 | use render_core::types::RENDERCHANNELFORMAT_COUNT; 16 | use render_core::types::RENDERNUMERICFORMAT_COUNT; 17 | 18 | #[test] 19 | fn formats() { 20 | for format_index in 0..RENDERCHANNELFORMAT_COUNT { 21 | let channel_format = RenderChannelFormat::from_u32(format_index as u32).unwrap(); 22 | if channel_format != RenderChannelFormat::Unknown { 23 | assert!(channel_format_component_count(channel_format) >= 1); 24 | } 25 | 26 | for numeric_index in 0..RENDERNUMERICFORMAT_COUNT { 27 | let numeric_format = RenderNumericFormat::from_u32(numeric_index as u32).unwrap(); 28 | 29 | let format = build_format(channel_format, numeric_format, false); 30 | if format == RenderFormat::Unknown { 31 | continue; 32 | } 33 | 34 | let channel_check: RenderChannelFormat = format.into(); 35 | let numeric_check: RenderNumericFormat = format.into(); 36 | assert_eq!(channel_check, channel_format); 37 | assert_eq!(numeric_check, numeric_format); 38 | 39 | match channel_format { 40 | RenderChannelFormat::D24S8 41 | | RenderChannelFormat::D32S8 42 | | RenderChannelFormat::D16 43 | | RenderChannelFormat::D24 44 | | RenderChannelFormat::D32 => { 45 | assert_eq!(channel_format_has_depth(channel_format), true); 46 | assert_eq!(format_has_depth(format), true); 47 | assert_eq!(channel_format_is_compressed(channel_format), false); 48 | assert_eq!(channel_format_has_alpha(channel_format), false); 49 | } 50 | _ => { 51 | assert_eq!(channel_format_has_depth(channel_format), false); 52 | assert_eq!(format_has_depth(format), false); 53 | assert_eq!(channel_format_has_stencil(channel_format), false); 54 | assert_eq!(format_has_stencil(format), false); 55 | } 56 | } 57 | 58 | let (min_width, min_height) = channel_format_min_dimensions(channel_format); 59 | assert!(min_width >= 1); 60 | assert!(min_height >= 1); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/Logger.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2016 Google, Inc. 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions 8 | // are met: 9 | // 10 | // Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // 13 | // Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following 15 | // disclaimer in the documentation and/or other materials provided 16 | // with the distribution. 17 | // 18 | // Neither the name of Google Inc. nor the names of its 19 | // contributors may be used to endorse or promote products derived 20 | // from this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | // POSSIBILITY OF SUCH DAMAGE. 34 | 35 | #ifndef GLSLANG_SPIRV_LOGGER_H 36 | #define GLSLANG_SPIRV_LOGGER_H 37 | 38 | #include 39 | #include 40 | 41 | namespace spv { 42 | 43 | // A class for holding all SPIR-V build status messages, including 44 | // missing/TBD functionalities, warnings, and errors. 45 | class SpvBuildLogger { 46 | public: 47 | SpvBuildLogger() {} 48 | 49 | // Registers a TBD functionality. 50 | void tbdFunctionality(const std::string& f); 51 | // Registers a missing functionality. 52 | void missingFunctionality(const std::string& f); 53 | 54 | // Logs a warning. 55 | void warning(const std::string& w) { warnings.push_back(w); } 56 | // Logs an error. 57 | void error(const std::string& e) { errors.push_back(e); } 58 | 59 | // Returns all messages accumulated in the order of: 60 | // TBD functionalities, missing functionalities, warnings, errors. 61 | std::string getAllMessages() const; 62 | 63 | private: 64 | SpvBuildLogger(const SpvBuildLogger&); 65 | 66 | std::vector tbdFeatures; 67 | std::vector missingFeatures; 68 | std::vector warnings; 69 | std::vector errors; 70 | }; 71 | 72 | } // end spv namespace 73 | 74 | #endif // GLSLANG_SPIRV_LOGGER_H 75 | -------------------------------------------------------------------------------- /render-hal-vk/src/raw/swap_chain.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | use ash; 4 | use std::ptr::null; 5 | 6 | use crate::raw::device::Device; 7 | use crate::raw::errors::SurfaceError; 8 | use crate::raw::surface::Surface; 9 | 10 | pub struct SwapChainConfig { 11 | pub min_image_count: u32, 12 | pub image_format: ash::vk::Format, 13 | pub image_extent: ash::vk::Extent2D, 14 | pub image_usage: ash::vk::ImageUsageFlags, 15 | pub present_mode: ash::vk::PresentModeKHR, 16 | } 17 | 18 | pub struct SwapChain { 19 | raw: ash::vk::SwapchainKHR, 20 | } 21 | 22 | impl SwapChain { 23 | pub fn extensions() -> Vec<&'static str> { 24 | // TODO: Clean this up 25 | vec![ 26 | ash::extensions::khr::Swapchain::name().to_str().unwrap(), 27 | "VK_KHR_maintenance1", 28 | "VK_KHR_maintenance2", 29 | "VK_KHR_sampler_mirror_clamp_to_edge", 30 | ] 31 | //vec![ash::extensions::Swapchain::name().to_str().unwrap()] 32 | } 33 | 34 | /// Create new swap chain 35 | pub fn create( 36 | device: &Device, 37 | surface: ash::vk::SurfaceKHR, 38 | //surface: &Surface, 39 | old_swap_chain: Option, 40 | config: SwapChainConfig, 41 | ) -> Result { 42 | let mut swap_chain = ash::vk::SwapchainKHR::null(); 43 | let result = unsafe { 44 | device.swap_chain.as_ref().unwrap().create_swapchain_khr( 45 | device.raw.handle(), 46 | &ash::vk::SwapchainCreateInfoKHR { 47 | s_type: ash::vk::StructureType::SWAPCHAIN_CREATE_INFO_KHR, 48 | p_next: null(), 49 | flags: ash::vk::SwapchainCreateFlagsKHR::empty(), 50 | surface, 51 | //surface: surface.raw, 52 | min_image_count: config.min_image_count, 53 | image_format: config.image_format, 54 | image_color_space: ash::vk::ColorSpaceKHR::SRGB_NONLINEAR, 55 | image_extent: config.image_extent, 56 | image_array_layers: 1, 57 | image_usage: config.image_usage, 58 | image_sharing_mode: ash::vk::SharingMode::EXCLUSIVE, 59 | queue_family_index_count: 0, 60 | p_queue_family_indices: null(), 61 | pre_transform: ash::vk::SurfaceTransformFlagsKHR::INHERIT, 62 | composite_alpha: ash::vk::CompositeAlphaFlagsKHR::INHERIT, 63 | present_mode: config.present_mode, 64 | clipped: 1, 65 | old_swapchain: old_swap_chain 66 | .map_or(ash::vk::SwapchainKHR::null(), |swap_chain| swap_chain.raw), 67 | }, 68 | null(), 69 | &mut swap_chain, 70 | ) 71 | }; 72 | 73 | match result { 74 | ash::vk::Result::SUCCESS => Ok(SwapChain { raw: swap_chain }), 75 | error => Err(SurfaceError::from_vk_result(error)), 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /render-hal-vk/src/raw/command/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | pub mod buffer; 4 | pub mod capability; 5 | pub mod family; 6 | pub mod fence; 7 | pub mod pool; 8 | pub mod queue; 9 | 10 | pub use self::buffer::*; 11 | pub use self::capability::*; 12 | pub use self::family::*; 13 | pub use self::fence::*; 14 | pub use self::pool::*; 15 | pub use self::queue::*; 16 | 17 | #[derive(Copy, Clone, Debug)] 18 | pub struct FamilyId { 19 | pub(crate) index: u32, 20 | pub(crate) capability: C, 21 | } 22 | 23 | impl FamilyId { 24 | /// Fetch capability of the family. 25 | pub fn capability(&self) -> Capability { 26 | self.capability 27 | } 28 | } 29 | 30 | impl PartialEq for FamilyId { 31 | fn eq(&self, rhs: &Self) -> bool { 32 | self.index == rhs.index 33 | } 34 | } 35 | 36 | impl Eq for FamilyId {} 37 | 38 | impl FamilyId { 39 | pub fn transfer(self) -> FamilyId { 40 | FamilyId { 41 | index: self.index, 42 | capability: self.capability.transfer(), 43 | } 44 | } 45 | 46 | pub fn graphics(self) -> FamilyId { 47 | FamilyId { 48 | index: self.index, 49 | capability: self.capability.graphics(), 50 | } 51 | } 52 | 53 | pub fn compute(self) -> FamilyId { 54 | FamilyId { 55 | index: self.index, 56 | capability: self.capability.compute(), 57 | } 58 | } 59 | 60 | pub fn general(self) -> FamilyId { 61 | FamilyId { 62 | index: self.index, 63 | capability: self.capability.general(), 64 | } 65 | } 66 | } 67 | 68 | #[derive(Copy, Clone, Debug)] 69 | pub struct QueueId { 70 | pub(crate) index: u32, 71 | pub(crate) family: FamilyId, 72 | } 73 | 74 | impl QueueId { 75 | /// Fetch capability of the queue. 76 | pub fn capability(&self) -> Capability { 77 | self.family.capability() 78 | } 79 | } 80 | 81 | impl PartialEq for QueueId { 82 | fn eq(&self, rhs: &Self) -> bool { 83 | self.index == rhs.index && self.family == rhs.family 84 | } 85 | } 86 | 87 | impl Eq for QueueId {} 88 | 89 | impl QueueId { 90 | pub fn transfer(self) -> QueueId { 91 | QueueId { 92 | index: self.index, 93 | family: self.family.transfer(), 94 | } 95 | } 96 | 97 | pub fn graphics(self) -> QueueId { 98 | QueueId { 99 | index: self.index, 100 | family: self.family.graphics(), 101 | } 102 | } 103 | 104 | pub fn compute(self) -> QueueId { 105 | QueueId { 106 | index: self.index, 107 | family: self.family.compute(), 108 | } 109 | } 110 | 111 | pub fn general(self) -> QueueId { 112 | QueueId { 113 | index: self.index, 114 | family: self.family.general(), 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /render-core/tests/system.rs: -------------------------------------------------------------------------------- 1 | extern crate render_core; 2 | //use render_core::backend::*; 3 | //use render_core::commands::*; 4 | //use render_core::device::*; 5 | //use render_core::encoder::*; 6 | //use render_core::handles::*; 7 | use render_core::system::*; 8 | //use render_core::types::*; 9 | //use render_core::utilities::*; 10 | //use std::path::{Path, PathBuf}; 11 | use std::sync::{Arc, RwLock}; 12 | mod common; 13 | 14 | #[test] 15 | fn system_initialize() { 16 | let render_system = Arc::new(RwLock::new(RenderSystem::new())); 17 | 18 | // Initialize 19 | { 20 | let mut rs_write = render_system.write().unwrap(); 21 | rs_write 22 | .initialize( 23 | &common::get_render_module_path(), 24 | &common::get_render_backend_settings(), 25 | ) 26 | .unwrap(); 27 | assert!(rs_write.is_initialized()); 28 | let registry = Arc::clone(&rs_write.get_registry().unwrap()); 29 | let registry_read = registry.read().unwrap(); 30 | assert!(registry_read.len() > 0); 31 | } 32 | 33 | // Release 34 | { 35 | let mut rs_write = render_system.write().unwrap(); 36 | rs_write.release().expect("failed to release render system"); 37 | } 38 | } 39 | 40 | #[test] 41 | fn system_harness() { 42 | common::SystemHarness::new(); 43 | } 44 | 45 | #[test] 46 | fn system_multi_harness() { 47 | common::SystemHarness::new(); 48 | common::SystemHarness::new(); 49 | common::SystemHarness::new(); 50 | } 51 | 52 | #[test] 53 | fn system_enumerate() { 54 | let harness = common::SystemHarness::new(); 55 | 56 | let mut rs_write = harness.render_system.write().unwrap(); 57 | let registry = Arc::clone(&rs_write.get_registry().unwrap()); 58 | let registry_read = registry.read().unwrap(); 59 | 60 | assert!(registry_read.len() > 0); 61 | 62 | for entry in registry_read.iter() { 63 | let device_info = Arc::new( 64 | rs_write 65 | .enumerate_devices(&entry, false, None, None) 66 | .unwrap(), 67 | ); 68 | let info_list = Arc::clone(&device_info); 69 | assert!(info_list.len() > 0); 70 | } 71 | } 72 | 73 | #[test] 74 | fn system_devices() { 75 | let harness = common::SystemHarness::new(); 76 | 77 | let mut rs_write = harness.render_system.write().unwrap(); 78 | let registry = Arc::clone(&rs_write.get_registry().unwrap()); 79 | let registry_read = registry.read().unwrap(); 80 | 81 | assert!(registry_read.len() > 0); 82 | 83 | for entry in registry_read.iter() { 84 | let device_info = Arc::new( 85 | rs_write 86 | .enumerate_devices(&entry, false, None, None) 87 | .unwrap(), 88 | ); 89 | let info_list = Arc::clone(&device_info); 90 | assert!(info_list.len() > 0); 91 | for info in &*info_list { 92 | assert!(rs_write.create_device(&entry, info.device_index).is_ok()); 93 | assert!(rs_write.get_device(&entry, info.device_index).is_ok()); 94 | assert!(rs_write.destroy_device(&entry, info.device_index).is_ok()); 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /render-core/tests/utilities.rs: -------------------------------------------------------------------------------- 1 | extern crate render_core; 2 | use render_core::utilities; 3 | 4 | #[test] 5 | fn align_forward() { 6 | let a = 12usize; 7 | assert_eq!(utilities::align_forward(a, 16), 16); 8 | assert_eq!(utilities::align_forward(a, 32), 32); 9 | assert_eq!(utilities::align_forward(a, 64), 64); 10 | assert_eq!(utilities::align_forward(a, 128), 128); 11 | assert_eq!(utilities::align_forward(a, 256), 256); 12 | assert_eq!(utilities::align_forward(a, 512), 512); 13 | assert_eq!(utilities::align_forward(a, 1024), 1024); 14 | 15 | let b = 3usize; 16 | assert_eq!(utilities::align_forward(b, 16), 16); 17 | assert_eq!(utilities::align_forward(b, 32), 32); 18 | assert_eq!(utilities::align_forward(b, 64), 64); 19 | assert_eq!(utilities::align_forward(b, 128), 128); 20 | assert_eq!(utilities::align_forward(b, 256), 256); 21 | assert_eq!(utilities::align_forward(b, 512), 512); 22 | assert_eq!(utilities::align_forward(b, 1024), 1024); 23 | 24 | let _c = 0usize; 25 | // TODO: Make this valid? 26 | //assert_eq!(utilities::align_forward(c, 16), 16); 27 | //assert_eq!(utilities::align_forward(c, 32), 32); 28 | //assert_eq!(utilities::align_forward(c, 64), 64); 29 | //assert_eq!(utilities::align_forward(c, 128), 128); 30 | //assert_eq!(utilities::align_forward(c, 256), 256); 31 | //assert_eq!(utilities::align_forward(c, 512), 512); 32 | //assert_eq!(utilities::align_forward(c, 1024), 1024); 33 | 34 | let d = 7usize; 35 | assert_eq!(utilities::align_forward(d, 16), 16); 36 | assert_eq!(utilities::align_forward(d, 32), 32); 37 | assert_eq!(utilities::align_forward(d, 64), 64); 38 | assert_eq!(utilities::align_forward(d, 128), 128); 39 | assert_eq!(utilities::align_forward(d, 256), 256); 40 | assert_eq!(utilities::align_forward(d, 512), 512); 41 | assert_eq!(utilities::align_forward(d, 1024), 1024); 42 | 43 | let e = 1usize; 44 | assert_eq!(utilities::align_forward(e, 16), 16); 45 | assert_eq!(utilities::align_forward(e, 32), 32); 46 | assert_eq!(utilities::align_forward(e, 64), 64); 47 | assert_eq!(utilities::align_forward(e, 128), 128); 48 | assert_eq!(utilities::align_forward(e, 256), 256); 49 | assert_eq!(utilities::align_forward(e, 512), 512); 50 | assert_eq!(utilities::align_forward(e, 1024), 1024); 51 | 52 | let f = 2usize; 53 | assert_eq!(utilities::align_forward(f, 2), 2); 54 | assert_eq!(utilities::align_forward(f, 4), 4); 55 | assert_eq!(utilities::align_forward(f, 128), 128); 56 | 57 | let g = 64usize; 58 | assert_eq!(utilities::align_forward(g, 64), 64); 59 | assert_eq!(utilities::align_forward(g, 32), 64); 60 | assert_eq!(utilities::align_forward(g, 65), 128); 61 | 62 | let h = 129; 63 | assert_eq!(utilities::align_forward(h, 256), 256); 64 | assert_eq!(utilities::align_forward(h, 64), 192); 65 | 66 | let i = 702; 67 | assert_eq!(utilities::align_forward(i, 4), 704); 68 | } 69 | 70 | // TODO: Add is_aligned, align_ptr_forward, bytes_to_typed, typed_to_bytes, any_as_u8_slice, divide_up_multiple_usize, divide_up_multiple 71 | -------------------------------------------------------------------------------- /render-hal-vk/src/raw/command/fence.rs: -------------------------------------------------------------------------------- 1 | use ash; 2 | use relevant::Relevant; 3 | use smallvec::SmallVec; 4 | use std::iter::FromIterator; 5 | 6 | use crate::raw::command::{Capability, QueueId}; 7 | use crate::raw::errors::{DeviceError, DeviceLost, OomError}; 8 | 9 | /// Fence that wasn't submitted to the queue 10 | pub struct UnarmedFence { 11 | pub(crate) raw: ash::vk::Fence, 12 | } 13 | 14 | /// Fence that was submitted to the queue 15 | pub struct ArmedFence { 16 | pub(crate) raw: ash::vk::Fence, 17 | pub(crate) queue: QueueId, 18 | pub(crate) epoch: u64, 19 | pub(crate) relevant: Relevant, 20 | } 21 | 22 | /// Fence that was successfully checked for signalling. 23 | pub struct ReadyFence { 24 | pub(crate) raw: ash::vk::Fence, 25 | pub(crate) queue: QueueId, 26 | pub(crate) epoch: u64, 27 | pub(crate) relevant: Relevant, 28 | } 29 | 30 | /// Flag to wait for... 31 | pub enum WaitFor { 32 | /// At least one fence. 33 | Any, 34 | 35 | /// All fences. 36 | All, 37 | } 38 | 39 | /// Wait for all fences. 40 | /// Returns collection of `ReadyFence` if all fences are signalled. 41 | /// Returns collection of `ArmedFence` if not all fences are signalled in before timeout. 42 | /// Returns error if failed otherwise. 43 | pub(crate) unsafe fn wait_for_all_fences( 44 | fp: ash::vk::DeviceFnV1_0, 45 | device: ash::vk::Device, 46 | fences: I, 47 | timeout: u64, 48 | ) -> Result< 49 | Result>, impl Iterator>>, 50 | DeviceError, 51 | > 52 | where 53 | I: IntoIterator>, 54 | { 55 | let fences = fences.into_iter().collect::>(); 56 | let raws = fences 57 | .iter() 58 | .map(|fence| fence.raw) 59 | .collect::>(); 60 | let result = fp.wait_for_fences(device, raws.len() as u32, raws.as_ptr(), 1, timeout); 61 | 62 | match result { 63 | ash::vk::Result::SUCCESS => Ok(Ok(fences.into_iter().map(|fence| ReadyFence { 64 | raw: fence.raw, 65 | queue: fence.queue, 66 | epoch: fence.epoch, 67 | relevant: fence.relevant, 68 | }))), 69 | ash::vk::Result::TIMEOUT => Ok(Err(fences.into_iter())), 70 | error => Err(DeviceError::from_vk_result(error)), 71 | } 72 | } 73 | 74 | /// Check fence status. 75 | /// Returns `ReadyFence` if fence is signalled. 76 | /// Returns back `ArmedFence` if fence is not signalled. 77 | /// Returns error if failed. 78 | pub(crate) unsafe fn get_fence_status( 79 | fp: ash::vk::DeviceFnV1_0, 80 | device: ash::vk::Device, 81 | fence: ArmedFence, 82 | ) -> Result, ArmedFence>, DeviceLost> { 83 | match fp.get_fence_status(device, fence.raw) { 84 | ash::vk::Result::SUCCESS => Ok(Ok(ReadyFence { 85 | raw: fence.raw, 86 | queue: fence.queue, 87 | epoch: fence.epoch, 88 | relevant: fence.relevant, 89 | })), 90 | ash::vk::Result::NOT_READY => Ok(Err(fence)), 91 | ash::vk::Result::ERROR_DEVICE_LOST => Err(DeviceLost), 92 | _ => unreachable!(), 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/SpvTools.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2014-2016 LunarG, Inc. 3 | // Copyright (C) 2018 Google, Inc. 4 | // 5 | // All rights reserved. 6 | // 7 | // Redistribution and use in source and binary forms, with or without 8 | // modification, are permitted provided that the following conditions 9 | // are met: 10 | // 11 | // Redistributions of source code must retain the above copyright 12 | // notice, this list of conditions and the following disclaimer. 13 | // 14 | // Redistributions in binary form must reproduce the above 15 | // copyright notice, this list of conditions and the following 16 | // disclaimer in the documentation and/or other materials provided 17 | // with the distribution. 18 | // 19 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 20 | // contributors may be used to endorse or promote products derived 21 | // from this software without specific prior written permission. 22 | // 23 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 24 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 25 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 26 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 27 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 28 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 29 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 33 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 | // POSSIBILITY OF SUCH DAMAGE. 35 | 36 | // 37 | // Call into SPIRV-Tools to disassemble, validate, and optimize. 38 | // 39 | 40 | #pragma once 41 | #ifndef GLSLANG_SPV_TOOLS_H 42 | #define GLSLANG_SPV_TOOLS_H 43 | 44 | #include 45 | #include 46 | 47 | #include "../glslang/MachineIndependent/localintermediate.h" 48 | #include "Logger.h" 49 | 50 | namespace glslang { 51 | 52 | struct SpvOptions { 53 | SpvOptions() : generateDebugInfo(false), disableOptimizer(true), 54 | optimizeSize(false), disassemble(false), validate(false) { } 55 | bool generateDebugInfo; 56 | bool disableOptimizer; 57 | bool optimizeSize; 58 | bool disassemble; 59 | bool validate; 60 | }; 61 | 62 | #if ENABLE_OPT 63 | 64 | // Use the SPIRV-Tools disassembler to print SPIR-V. 65 | void SpirvToolsDisassemble(std::ostream& out, const std::vector& spirv); 66 | 67 | // Apply the SPIRV-Tools validator to generated SPIR-V. 68 | void SpirvToolsValidate(const glslang::TIntermediate& intermediate, std::vector& spirv, 69 | spv::SpvBuildLogger*); 70 | 71 | // Apply the SPIRV-Tools optimizer to generated SPIR-V, for the purpose of 72 | // legalizing HLSL SPIR-V. 73 | void SpirvToolsLegalize(const glslang::TIntermediate& intermediate, std::vector& spirv, 74 | spv::SpvBuildLogger*, const SpvOptions*); 75 | 76 | #endif 77 | 78 | }; // end namespace glslang 79 | 80 | #endif // GLSLANG_SPV_TOOLS_H -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at graham@wihlidal.ca. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/GLSL.ext.NV.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** Copyright (c) 2014-2017 The Khronos Group Inc. 3 | ** 4 | ** Permission is hereby granted, free of charge, to any person obtaining a copy 5 | ** of this software and/or associated documentation files (the "Materials"), 6 | ** to deal in the Materials without restriction, including without limitation 7 | ** the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | ** and/or sell copies of the Materials, and to permit persons to whom the 9 | ** Materials are furnished to do so, subject to the following conditions: 10 | ** 11 | ** The above copyright notice and this permission notice shall be included in 12 | ** all copies or substantial portions of the Materials. 13 | ** 14 | ** MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS KHRONOS 15 | ** STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS SPECIFICATIONS AND 16 | ** HEADER INFORMATION ARE LOCATED AT https://www.khronos.org/registry/ 17 | ** 18 | ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 19 | ** OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 21 | ** THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 23 | ** FROM,OUT OF OR IN CONNECTION WITH THE MATERIALS OR THE USE OR OTHER DEALINGS 24 | ** IN THE MATERIALS. 25 | */ 26 | 27 | #ifndef GLSLextNV_H 28 | #define GLSLextNV_H 29 | 30 | enum BuiltIn; 31 | enum Decoration; 32 | enum Op; 33 | enum Capability; 34 | 35 | static const int GLSLextNVVersion = 100; 36 | static const int GLSLextNVRevision = 11; 37 | 38 | //SPV_NV_sample_mask_override_coverage 39 | const char* const E_SPV_NV_sample_mask_override_coverage = "SPV_NV_sample_mask_override_coverage"; 40 | 41 | //SPV_NV_geometry_shader_passthrough 42 | const char* const E_SPV_NV_geometry_shader_passthrough = "SPV_NV_geometry_shader_passthrough"; 43 | 44 | //SPV_NV_viewport_array2 45 | const char* const E_SPV_NV_viewport_array2 = "SPV_NV_viewport_array2"; 46 | const char* const E_ARB_shader_viewport_layer_array = "SPV_ARB_shader_viewport_layer_array"; 47 | 48 | //SPV_NV_stereo_view_rendering 49 | const char* const E_SPV_NV_stereo_view_rendering = "SPV_NV_stereo_view_rendering"; 50 | 51 | //SPV_NVX_multiview_per_view_attributes 52 | const char* const E_SPV_NVX_multiview_per_view_attributes = "SPV_NVX_multiview_per_view_attributes"; 53 | 54 | //SPV_NV_shader_subgroup_partitioned 55 | const char* const E_SPV_NV_shader_subgroup_partitioned = "SPV_NV_shader_subgroup_partitioned"; 56 | 57 | //SPV_NV_fragment_shader_barycentric 58 | const char* const E_SPV_NV_fragment_shader_barycentric = "SPV_NV_fragment_shader_barycentric"; 59 | 60 | //SPV_NV_compute_shader_derivatives 61 | const char* const E_SPV_NV_compute_shader_derivatives = "SPV_NV_compute_shader_derivatives"; 62 | 63 | //SPV_NV_shader_image_footprint 64 | const char* const E_SPV_NV_shader_image_footprint = "SPV_NV_shader_image_footprint"; 65 | 66 | //SPV_NV_mesh_shader 67 | const char* const E_SPV_NV_mesh_shader = "SPV_NV_mesh_shader"; 68 | 69 | //SPV_NVX_raytracing 70 | const char* const E_SPV_NVX_raytracing = "SPV_NVX_raytracing"; 71 | 72 | //SPV_NV_shading_rate 73 | const char* const E_SPV_NV_shading_rate = "SPV_NV_shading_rate"; 74 | 75 | #endif // #ifndef GLSLextNV_H 76 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/glslang/MachineIndependent/ScanContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (C) 2013 LunarG, Inc. 3 | // 4 | // All rights reserved. 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions 8 | // are met: 9 | // 10 | // Redistributions of source code must retain the above copyright 11 | // notice, this list of conditions and the following disclaimer. 12 | // 13 | // Redistributions in binary form must reproduce the above 14 | // copyright notice, this list of conditions and the following 15 | // disclaimer in the documentation and/or other materials provided 16 | // with the distribution. 17 | // 18 | // Neither the name of 3Dlabs Inc. Ltd. nor the names of its 19 | // contributors may be used to endorse or promote products derived 20 | // from this software without specific prior written permission. 21 | // 22 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 23 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 24 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 25 | // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 26 | // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 27 | // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 28 | // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 30 | // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 | // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 32 | // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 | // POSSIBILITY OF SUCH DAMAGE. 34 | // 35 | 36 | // 37 | // This holds context specific to the GLSL scanner, which 38 | // sits between the preprocessor scanner and parser. 39 | // 40 | 41 | #pragma once 42 | 43 | #include "ParseHelper.h" 44 | 45 | namespace glslang { 46 | 47 | class TPpContext; 48 | class TPpToken; 49 | class TParserToken; 50 | 51 | class TScanContext { 52 | public: 53 | explicit TScanContext(TParseContextBase& pc) : 54 | parseContext(pc), 55 | afterType(false), afterStruct(false), 56 | field(false) { } 57 | virtual ~TScanContext() { } 58 | 59 | static void fillInKeywordMap(); 60 | static void deleteKeywordMap(); 61 | 62 | int tokenize(TPpContext*, TParserToken&); 63 | 64 | protected: 65 | TScanContext(TScanContext&); 66 | TScanContext& operator=(TScanContext&); 67 | 68 | int tokenizeIdentifier(); 69 | int identifierOrType(); 70 | int reservedWord(); 71 | int identifierOrReserved(bool reserved); 72 | int es30ReservedFromGLSL(int version); 73 | int nonreservedKeyword(int esVersion, int nonEsVersion); 74 | int precisionKeyword(); 75 | int matNxM(); 76 | int dMat(); 77 | int firstGenerationImage(bool inEs310); 78 | int secondGenerationImage(); 79 | 80 | TParseContextBase& parseContext; 81 | bool afterType; // true if we've recognized a type, so can only be looking for an identifier 82 | bool afterStruct; // true if we've recognized the STRUCT keyword, so can only be looking for an identifier 83 | bool field; // true if we're on a field, right after a '.' 84 | TSourceLoc loc; 85 | TParserToken* parserToken; 86 | TPpToken* ppToken; 87 | 88 | const char* tokenText; 89 | int keyword; 90 | }; 91 | 92 | } // end namespace glslang 93 | -------------------------------------------------------------------------------- /render-core/tests/common/mod.rs: -------------------------------------------------------------------------------- 1 | use render_core::backend::*; 2 | //use render_core::commands::*; 3 | use render_core::device::*; 4 | //use render_core::encoder::*; 5 | use render_core::handles::*; 6 | use render_core::system::*; 7 | //use render_core::types::*; 8 | //use render_core::utilities::*; 9 | use std::env; 10 | use std::path::{Path, PathBuf}; 11 | use std::sync::{Arc, RwLock}; 12 | 13 | pub fn get_render_debug_flags() -> RenderDebugFlags { 14 | RenderDebugFlags::NONE 15 | } 16 | 17 | pub fn get_render_backend_settings() -> Vec { 18 | //let backends = ["mock", "vk", "dx12", "mtl", "proxy"]; 19 | //let backends = ["mock", "vk"]; 20 | let backends = ["vk"]; 21 | let mut backend_settings: Vec = Vec::new(); 22 | for backend in backends.iter() { 23 | backend_settings.push(RenderBackendSettings { 24 | api: backend.to_string(), 25 | address: None, // TODO: Specify for proxy 26 | debug_flags: get_render_debug_flags(), 27 | }); 28 | } 29 | backend_settings 30 | } 31 | 32 | pub fn get_render_module_path() -> PathBuf { 33 | let exe_path = env::current_exe().unwrap(); 34 | let module_path = exe_path.parent().unwrap(); 35 | module_path.to_path_buf() 36 | } 37 | 38 | pub struct SystemHarness { 39 | pub render_system: Arc>, 40 | pub device_info: Arc>, 41 | pub handles: Arc>, 42 | pub device: Arc>>>, 43 | } 44 | 45 | impl SystemHarness { 46 | pub fn new() -> SystemHarness { 47 | let render_system = Arc::new(RwLock::new(RenderSystem::new())); 48 | let mut harness = SystemHarness { 49 | render_system, 50 | device_info: Arc::new(Vec::new()), 51 | handles: Arc::new(RwLock::new(RenderResourceHandleAllocator::new())), 52 | device: Arc::new(RwLock::new(None)), 53 | }; 54 | 55 | harness.initialize(&get_render_module_path(), &get_render_backend_settings()); 56 | harness 57 | } 58 | 59 | pub fn initialize(&mut self, module_path: &Path, backend_settings: &[RenderBackendSettings]) { 60 | let mut rs_write = self.render_system.write().unwrap(); 61 | rs_write 62 | .initialize(&module_path, &backend_settings) 63 | .unwrap(); 64 | assert!(rs_write.is_initialized()); 65 | let registry = Arc::clone(&rs_write.get_registry().unwrap()); 66 | let registry_read = registry.read().unwrap(); 67 | if registry_read.len() == 0 { 68 | panic!("no registry entries"); 69 | } else { 70 | let backend_registry = ®istry_read[0]; 71 | self.device_info = Arc::new( 72 | rs_write 73 | .enumerate_devices(&backend_registry, false, None, None) 74 | .unwrap(), 75 | ); 76 | rs_write.create_device(&backend_registry, 0).unwrap(); 77 | self.device = rs_write.get_device(&backend_registry, 0).unwrap(); 78 | } 79 | } 80 | 81 | pub fn release(&mut self) { 82 | // Need to release this reference before the render system (TODO: solve lifetimes) 83 | self.device = Arc::new(RwLock::new(None)); 84 | let mut rs_write = self.render_system.write().unwrap(); 85 | rs_write.release().expect("failed to release render system"); 86 | } 87 | } 88 | 89 | impl Drop for SystemHarness { 90 | fn drop(&mut self) { 91 | self.release(); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /render-hal-vk/src/raw/escape.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | //! Module provides wrapper for types that cannot be dropped silently. 4 | //! Usually such types are required to be returned to their creator. 5 | //! `Escape` wrapper help the user to do so by sending underlying value to the `Terminal` when it is dropped. 6 | //! Users are encouraged to dispose of the values manually while `Escape` be just a safety net. 7 | 8 | use std::{ 9 | iter::repeat, 10 | mem::{forget, ManuallyDrop}, 11 | ops::{Deref, DerefMut}, 12 | ptr::read, 13 | }; 14 | 15 | use crossbeam_channel::{unbounded, Receiver, Sender}; 16 | use relevant::Relevant; 17 | 18 | use crate::raw::object::VulkanObject; 19 | 20 | /// Wraps value of any type and send it to the `Terminal` from which the wrapper was created. 21 | /// In case `Terminal` is already dropped then value will be cast into oblivion via `std::mem::forget`. 22 | #[derive(Debug, Clone)] 23 | pub struct Escape> { 24 | value: ManuallyDrop, 25 | sender: Sender, 26 | } 27 | 28 | impl Escape 29 | where 30 | T: Into, 31 | { 32 | /// Unwrap the value. 33 | pub fn into_inner(mut escape: Self) -> T { 34 | unsafe { read(&mut *escape.value) } 35 | } 36 | } 37 | 38 | impl Deref for Escape 39 | where 40 | T: Into, 41 | { 42 | type Target = T; 43 | fn deref(&self) -> &T { 44 | &*self.value 45 | } 46 | } 47 | 48 | impl DerefMut for Escape 49 | where 50 | T: Into, 51 | { 52 | fn deref_mut(&mut self) -> &mut T { 53 | &mut *self.value 54 | } 55 | } 56 | 57 | impl Drop for Escape 58 | where 59 | T: Into, 60 | { 61 | fn drop(&mut self) { 62 | let value = unsafe { read(&mut *self.value) }; 63 | self.sender.send(value.into()).unwrap(); 64 | } 65 | } 66 | 67 | /// This types allows the user to create `Escape` wrappers. 68 | /// Receives values from dropped `Escape` instances that was created by this `Terminal`. 69 | #[derive(Debug)] 70 | pub struct Terminal { 71 | sender: ManuallyDrop>, 72 | receiver: Receiver, 73 | } 74 | 75 | impl Default for Terminal { 76 | fn default() -> Self { 77 | Self::new() 78 | } 79 | } 80 | 81 | impl Terminal { 82 | /// Create new `Terminal`. 83 | pub fn new() -> Self { 84 | let (sender, receiver) = unbounded(); 85 | Terminal { 86 | sender: ManuallyDrop::new(sender), 87 | receiver, 88 | } 89 | } 90 | 91 | /// Wrap the value. It will be yielded by iterator returned by `Terminal::drain` if `Escape` will be dropped. 92 | pub fn escape(&self, value: T) -> Escape 93 | where 94 | T: Into, 95 | { 96 | Escape { 97 | value: ManuallyDrop::new(value), 98 | sender: Sender::clone(&self.sender), 99 | } 100 | } 101 | 102 | // Get iterator over values from dropped `Escape` instances that was created by this `Terminal`. 103 | /*pub fn drain<'a>(&'a mut self) -> impl Iterator + 'a { 104 | repeat(()).scan(&self.receiver, |receiver, ()| receiver.try_recv()) 105 | }*/ 106 | } 107 | 108 | impl Drop for Terminal { 109 | fn drop(&mut self) { 110 | unsafe { 111 | drop(read(&mut self.sender)); 112 | trace!("Sender dropped"); 113 | // TODO: assert!(self.receiver.try_recv().is_none()); 114 | trace!("Receiver checked"); 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /render-hal-vk/redist/vulkansdk-macos-1.1.85.0/macOS/include/SPIRV/bitutils.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2015-2016 The Khronos Group Inc. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef LIBSPIRV_UTIL_BITUTILS_H_ 16 | #define LIBSPIRV_UTIL_BITUTILS_H_ 17 | 18 | #include 19 | #include 20 | 21 | namespace spvutils { 22 | 23 | // Performs a bitwise copy of source to the destination type Dest. 24 | template 25 | Dest BitwiseCast(Src source) { 26 | Dest dest; 27 | static_assert(sizeof(source) == sizeof(dest), 28 | "BitwiseCast: Source and destination must have the same size"); 29 | std::memcpy(static_cast(&dest), &source, sizeof(dest)); 30 | return dest; 31 | } 32 | 33 | // SetBits returns an integer of type with bits set 34 | // for position through , counting from the least 35 | // significant bit. In particular when Num == 0, no positions are set to 1. 36 | // A static assert will be triggered if First + Num > sizeof(T) * 8, that is, 37 | // a bit that will not fit in the underlying type is set. 38 | template 39 | struct SetBits { 40 | static_assert(First < sizeof(T) * 8, 41 | "Tried to set a bit that is shifted too far."); 42 | const static T get = (T(1) << First) | SetBits::get; 43 | }; 44 | 45 | template 46 | struct SetBits { 47 | const static T get = T(0); 48 | }; 49 | 50 | // This is all compile-time so we can put our tests right here. 51 | static_assert(SetBits::get == uint32_t(0x00000000), 52 | "SetBits failed"); 53 | static_assert(SetBits::get == uint32_t(0x00000001), 54 | "SetBits failed"); 55 | static_assert(SetBits::get == uint32_t(0x80000000), 56 | "SetBits failed"); 57 | static_assert(SetBits::get == uint32_t(0x00000006), 58 | "SetBits failed"); 59 | static_assert(SetBits::get == uint32_t(0xc0000000), 60 | "SetBits failed"); 61 | static_assert(SetBits::get == uint32_t(0x7FFFFFFF), 62 | "SetBits failed"); 63 | static_assert(SetBits::get == uint32_t(0xFFFFFFFF), 64 | "SetBits failed"); 65 | static_assert(SetBits::get == uint32_t(0xFFFF0000), 66 | "SetBits failed"); 67 | 68 | static_assert(SetBits::get == uint64_t(0x0000000000000001LL), 69 | "SetBits failed"); 70 | static_assert(SetBits::get == uint64_t(0x8000000000000000LL), 71 | "SetBits failed"); 72 | static_assert(SetBits::get == uint64_t(0xc000000000000000LL), 73 | "SetBits failed"); 74 | static_assert(SetBits::get == uint64_t(0x0000000080000000LL), 75 | "SetBits failed"); 76 | static_assert(SetBits::get == uint64_t(0x00000000FFFF0000LL), 77 | "SetBits failed"); 78 | 79 | } // namespace spvutils 80 | 81 | #endif // LIBSPIRV_UTIL_BITUTILS_H_ 82 | --------------------------------------------------------------------------------