Fix macro to allow disabling dx12 feature. (#3590)

* Fix macro for DX12 conditional compilation

* Update CHANGELOG.md

* Apply suggestions from code review

---------

Co-authored-by: Teodor Tanasoaia <28601907+teoxoy@users.noreply.github.com>
This commit is contained in:
Andrew Numrich
2023-03-15 11:48:47 -06:00
committed by GitHub
parent c3dd533bd5
commit 110e62aed2
3 changed files with 5 additions and 4 deletions

View File

@@ -118,6 +118,7 @@ By @teoxoy in [#3534](https://github.com/gfx-rs/wgpu/pull/3534)
- Fix DXC validation issues when using a custom `dxil_path`. By @Elabajaba in [#3434](https://github.com/gfx-rs/wgpu/pull/3434)
- Use typeless formats for textures that might be viewed as srgb or non-srgb. By @teoxoy in [#3555](https://github.com/gfx-rs/wgpu/pull/3555)
- Fix conditional compilation for `dx12` feature. By @toastmod in [#3590](https://github.com/gfx-rs/wgpu/pull/3590)
#### GLES

View File

@@ -232,7 +232,7 @@ impl Context {
})
}
#[cfg(target_os = "windows")]
#[cfg(all(feature = "dx12", windows))]
pub unsafe fn create_surface_from_visual(&self, visual: *mut std::ffi::c_void) -> Surface {
let id = unsafe { self.0.instance_create_surface_from_visual(visual, ()) };
Surface {
@@ -241,7 +241,7 @@ impl Context {
}
}
#[cfg(target_os = "windows")]
#[cfg(all(feature = "dx12", windows))]
pub unsafe fn create_surface_from_surface_handle(
&self,
surface_handle: *mut std::ffi::c_void,

View File

@@ -1544,7 +1544,7 @@ impl Instance {
/// # Safety
///
/// - visual must be a valid IDCompositionVisual to create a surface upon.
#[cfg(target_os = "windows")]
#[cfg(all(feature = "dx12", windows))]
pub unsafe fn create_surface_from_visual(&self, visual: *mut std::ffi::c_void) -> Surface {
let surface = unsafe {
self.context
@@ -1566,7 +1566,7 @@ impl Instance {
/// # Safety
///
/// - surface_handle must be a valid SurfaceHandle to create a surface upon.
#[cfg(target_os = "windows")]
#[cfg(all(feature = "dx12", windows))]
pub unsafe fn create_surface_from_surface_handle(
&self,
surface_handle: *mut std::ffi::c_void,