mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 06:45:23 +00:00
fix warnings/errors (#1692)
This commit is contained in:
parent
f186ef80a5
commit
588f91dc59
@ -160,7 +160,8 @@ fn main() {
|
|||||||
let png_bytes = include_bytes!("image_img.png").to_vec();
|
let png_bytes = include_bytes!("image_img.png").to_vec();
|
||||||
let cursor = Cursor::new(png_bytes);
|
let cursor = Cursor::new(png_bytes);
|
||||||
let decoder = png::Decoder::new(cursor);
|
let decoder = png::Decoder::new(cursor);
|
||||||
let (info, mut reader) = decoder.read_info().unwrap();
|
let mut reader = decoder.read_info().unwrap();
|
||||||
|
let info = reader.info();
|
||||||
let dimensions = ImageDimensions::Dim2d {
|
let dimensions = ImageDimensions::Dim2d {
|
||||||
width: info.width,
|
width: info.width,
|
||||||
height: info.height,
|
height: info.height,
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
use std::borrow::Borrow;
|
use std::borrow::Borrow;
|
||||||
use std::error;
|
use std::error;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
#[cfg(target_os = "windows")]
|
|
||||||
use std::ptr;
|
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
@ -31,18 +31,28 @@ use crate::memory::pool::MemoryPoolAlloc;
|
|||||||
use crate::memory::pool::PotentialDedicatedAllocation;
|
use crate::memory::pool::PotentialDedicatedAllocation;
|
||||||
use crate::memory::pool::StdMemoryPoolAlloc;
|
use crate::memory::pool::StdMemoryPoolAlloc;
|
||||||
use crate::memory::{DedicatedAlloc, MemoryRequirements};
|
use crate::memory::{DedicatedAlloc, MemoryRequirements};
|
||||||
use crate::memory::{DeviceMemoryAllocError, ExternalMemoryHandleType};
|
use crate::memory::DeviceMemoryAllocError;
|
||||||
use crate::sync::AccessError;
|
use crate::sync::AccessError;
|
||||||
use crate::sync::Sharing;
|
use crate::sync::Sharing;
|
||||||
use crate::DeviceSize;
|
use crate::DeviceSize;
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
use std::fs::File;
|
|
||||||
use std::hash::Hash;
|
use std::hash::Hash;
|
||||||
use std::hash::Hasher;
|
use std::hash::Hasher;
|
||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::sync::Mutex;
|
use std::sync::Mutex;
|
||||||
|
#[cfg(any(
|
||||||
|
target_os = "linux",
|
||||||
|
target_os = "dragonflybsd",
|
||||||
|
target_os = "freebsd",
|
||||||
|
target_os = "netbsd",
|
||||||
|
target_os = "openbsd"
|
||||||
|
))]
|
||||||
|
use {
|
||||||
|
crate::memory::ExternalMemoryHandleType,
|
||||||
|
std::fs::File
|
||||||
|
};
|
||||||
|
|
||||||
/// Buffer whose content is in device-local memory.
|
/// Buffer whose content is in device-local memory.
|
||||||
///
|
///
|
||||||
|
@ -304,11 +304,8 @@ impl From<OomError> for SemaphoreError {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use crate::device::physical::PhysicalDevice;
|
|
||||||
use crate::device::{Device, DeviceExtensions};
|
|
||||||
use crate::instance::{Instance, InstanceExtensions};
|
|
||||||
use crate::VulkanObject;
|
use crate::VulkanObject;
|
||||||
use crate::{sync::Semaphore, Version};
|
use crate::sync::Semaphore;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn semaphore_create() {
|
fn semaphore_create() {
|
||||||
@ -342,6 +339,11 @@ mod tests {
|
|||||||
target_os = "openbsd"
|
target_os = "openbsd"
|
||||||
))]
|
))]
|
||||||
fn semaphore_export() {
|
fn semaphore_export() {
|
||||||
|
use crate::device::physical::PhysicalDevice;
|
||||||
|
use crate::device::{Device, DeviceExtensions};
|
||||||
|
use crate::instance::{Instance, InstanceExtensions};
|
||||||
|
use crate::Version;
|
||||||
|
|
||||||
let supported_ext = InstanceExtensions::supported_by_core().unwrap();
|
let supported_ext = InstanceExtensions::supported_by_core().unwrap();
|
||||||
if supported_ext.khr_get_display_properties2
|
if supported_ext.khr_get_display_properties2
|
||||||
&& supported_ext.khr_external_semaphore_capabilities
|
&& supported_ext.khr_external_semaphore_capabilities
|
||||||
|
Loading…
Reference in New Issue
Block a user