100: Add dx11 r=kvark a=fkaa



Co-authored-by: Felix Kaaman <trundmatu@gmail.com>
This commit is contained in:
bors[bot] 2018-06-24 02:16:43 +00:00
commit e7550ab1bb
6 changed files with 39 additions and 4 deletions

26
Cargo.lock generated
View file

@ -257,10 +257,26 @@ name = "gcc"
version = "0.3.54" version = "0.3.54"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "gfx-backend-dx11"
version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#842b9313d9391dc99dc215bc2dd01f9e4daffcda"
dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx-hal 0.1.0 (git+https://github.com/gfx-rs/gfx)",
"log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
"spirv_cross 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"winit 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"wio 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]] [[package]]
name = "gfx-backend-dx12" name = "gfx-backend-dx12"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#39aff0d7cf5e756fafdc310731d426c7883f9414" source = "git+https://github.com/gfx-rs/gfx#842b9313d9391dc99dc215bc2dd01f9e4daffcda"
dependencies = [ dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "derivative 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -276,7 +292,7 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-metal" name = "gfx-backend-metal"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#39aff0d7cf5e756fafdc310731d426c7883f9414" source = "git+https://github.com/gfx-rs/gfx#842b9313d9391dc99dc215bc2dd01f9e4daffcda"
dependencies = [ dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "block 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
@ -299,7 +315,7 @@ dependencies = [
[[package]] [[package]]
name = "gfx-backend-vulkan" name = "gfx-backend-vulkan"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#39aff0d7cf5e756fafdc310731d426c7883f9414" source = "git+https://github.com/gfx-rs/gfx#842b9313d9391dc99dc215bc2dd01f9e4daffcda"
dependencies = [ dependencies = [
"ash 0.24.3 (registry+https://github.com/rust-lang/crates.io-index)", "ash 0.24.3 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
@ -317,7 +333,7 @@ dependencies = [
[[package]] [[package]]
name = "gfx-hal" name = "gfx-hal"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/gfx-rs/gfx#39aff0d7cf5e756fafdc310731d426c7883f9414" source = "git+https://github.com/gfx-rs/gfx#842b9313d9391dc99dc215bc2dd01f9e4daffcda"
dependencies = [ dependencies = [
"bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -557,6 +573,7 @@ name = "portability-gfx"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx-backend-dx11 0.1.0 (git+https://github.com/gfx-rs/gfx)",
"gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx)", "gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx)",
"gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx)", "gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx)",
"gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx)", "gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx)",
@ -978,6 +995,7 @@ dependencies = [
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
"checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb" "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb"
"checksum gfx-backend-dx11 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>"
"checksum gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>" "checksum gfx-backend-dx12 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>"
"checksum gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>" "checksum gfx-backend-metal 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>"
"checksum gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>" "checksum gfx-backend-vulkan 0.1.0 (git+https://github.com/gfx-rs/gfx)" = "<none>"

View file

@ -41,6 +41,11 @@ git = "https://github.com/gfx-rs/gfx"
#path = "../../gfx/src/backend/dx12" #path = "../../gfx/src/backend/dx12"
optional = true optional = true
[target.'cfg(windows)'.dependencies.gfx-backend-dx11]
git = "https://github.com/gfx-rs/gfx"
#path = "../../gfx/src/backend/dx11"
optional = true
[target.'cfg(target_os = "macos")'.dependencies.gfx-backend-metal] [target.'cfg(target_os = "macos")'.dependencies.gfx-backend-metal]
git = "https://github.com/gfx-rs/gfx" git = "https://github.com/gfx-rs/gfx"
#path = "../../gfx/src/backend/metal" #path = "../../gfx/src/backend/metal"

View file

@ -4107,6 +4107,14 @@ pub extern "C" fn gfxCreateWin32SurfaceKHR(
VkResult::VK_SUCCESS VkResult::VK_SUCCESS
} }
} }
#[cfg(feature = "gfx-backend-dx11")]
{
unsafe {
assert_eq!(info.flags, 0);
*pSurface = Handle::new(instance.backend.create_surface_from_hwnd(info.hwnd));
VkResult::VK_SUCCESS
}
}
#[cfg(not(target_os = "windows"))] #[cfg(not(target_os = "windows"))]
{ {
let _ = (instance, info, pSurface); let _ = (instance, info, pSurface);

View file

@ -7,6 +7,8 @@
extern crate gfx_hal as hal; extern crate gfx_hal as hal;
#[cfg(feature = "gfx-backend-dx12")] #[cfg(feature = "gfx-backend-dx12")]
extern crate gfx_backend_dx12 as back; extern crate gfx_backend_dx12 as back;
#[cfg(feature = "gfx-backend-dx11")]
extern crate gfx_backend_dx11 as back;
#[cfg(feature = "gfx-backend-metal")] #[cfg(feature = "gfx-backend-metal")]
extern crate gfx_backend_metal as back; extern crate gfx_backend_metal as back;
#[cfg(feature = "gfx-backend-vulkan")] #[cfg(feature = "gfx-backend-vulkan")]

View file

@ -14,6 +14,7 @@ crate-type = ["cdylib"]
[features] [features]
default = [] default = []
dx12 = ["portability-gfx/gfx-backend-dx12"] dx12 = ["portability-gfx/gfx-backend-dx12"]
dx11 = ["portability-gfx/gfx-backend-dx11"]
metal = ["portability-gfx/gfx-backend-metal"] metal = ["portability-gfx/gfx-backend-metal"]
vulkan = ["portability-gfx/gfx-backend-vulkan"] vulkan = ["portability-gfx/gfx-backend-vulkan"]

View file

@ -15,6 +15,7 @@ crate-type = ["cdylib"]
default = [] default = []
debug = ["portability-gfx/env_logger", "portability-gfx/nightly"] debug = ["portability-gfx/env_logger", "portability-gfx/nightly"]
dx12 = ["portability-gfx/gfx-backend-dx12"] dx12 = ["portability-gfx/gfx-backend-dx12"]
dx11 = ["portability-gfx/gfx-backend-dx11"]
metal = ["portability-gfx/gfx-backend-metal"] metal = ["portability-gfx/gfx-backend-metal"]
vulkan = ["portability-gfx/gfx-backend-vulkan"] vulkan = ["portability-gfx/gfx-backend-vulkan"]