fix(stage0-ci): satisfy strict clippy gates
This commit is contained in:
@@ -138,7 +138,7 @@ pub fn probe_vulkan_runtime_capabilities(
|
|||||||
instance,
|
instance,
|
||||||
surface,
|
surface,
|
||||||
drawable_extent,
|
drawable_extent,
|
||||||
&RenderRequest::conservative(),
|
RenderRequest::conservative(),
|
||||||
)?;
|
)?;
|
||||||
Ok(selected.runtime)
|
Ok(selected.runtime)
|
||||||
}
|
}
|
||||||
@@ -154,7 +154,7 @@ pub fn probe_vulkan_runtime_capabilities_for_request(
|
|||||||
instance: &VulkanInstanceProbe,
|
instance: &VulkanInstanceProbe,
|
||||||
surface: &VulkanSurfaceProbe,
|
surface: &VulkanSurfaceProbe,
|
||||||
drawable_extent: (u32, u32),
|
drawable_extent: (u32, u32),
|
||||||
render_request: &RenderRequest,
|
render_request: RenderRequest,
|
||||||
) -> Result<VulkanRuntimeCapabilityProbe, VulkanRuntimeCapabilityError> {
|
) -> Result<VulkanRuntimeCapabilityProbe, VulkanRuntimeCapabilityError> {
|
||||||
let selected = select_live_device_candidate_for_request(
|
let selected = select_live_device_candidate_for_request(
|
||||||
instance,
|
instance,
|
||||||
@@ -169,7 +169,7 @@ pub(super) fn select_live_device_candidate_for_request(
|
|||||||
instance: &VulkanInstanceProbe,
|
instance: &VulkanInstanceProbe,
|
||||||
surface: &VulkanSurfaceProbe,
|
surface: &VulkanSurfaceProbe,
|
||||||
drawable_extent: (u32, u32),
|
drawable_extent: (u32, u32),
|
||||||
render_request: &RenderRequest,
|
render_request: RenderRequest,
|
||||||
) -> Result<SelectedLiveDevice, VulkanRuntimeCapabilityError> {
|
) -> Result<SelectedLiveDevice, VulkanRuntimeCapabilityError> {
|
||||||
let devices = {
|
let devices = {
|
||||||
// SAFETY: The Vulkan instance is live for this query and no handles are retained.
|
// SAFETY: The Vulkan instance is live for this query and no handles are retained.
|
||||||
@@ -222,7 +222,7 @@ fn live_device_candidate(
|
|||||||
surface: &VulkanSurfaceProbe,
|
surface: &VulkanSurfaceProbe,
|
||||||
device: vk::PhysicalDevice,
|
device: vk::PhysicalDevice,
|
||||||
index: usize,
|
index: usize,
|
||||||
render_request: &RenderRequest,
|
render_request: RenderRequest,
|
||||||
) -> Result<LiveDeviceCandidate, VulkanRuntimeCapabilityError> {
|
) -> Result<LiveDeviceCandidate, VulkanRuntimeCapabilityError> {
|
||||||
let properties = {
|
let properties = {
|
||||||
// SAFETY: `device` was returned by this live instance and the result is copied by value.
|
// SAFETY: `device` was returned by this live instance and the result is copied by value.
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ pub fn create_vulkan_logical_device_probe(
|
|||||||
instance,
|
instance,
|
||||||
surface,
|
surface,
|
||||||
drawable_extent,
|
drawable_extent,
|
||||||
&RenderRequest::conservative(),
|
RenderRequest::conservative(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ pub fn create_vulkan_logical_device_probe_for_request(
|
|||||||
instance: &VulkanInstanceProbe,
|
instance: &VulkanInstanceProbe,
|
||||||
surface: &VulkanSurfaceProbe,
|
surface: &VulkanSurfaceProbe,
|
||||||
drawable_extent: (u32, u32),
|
drawable_extent: (u32, u32),
|
||||||
render_request: &RenderRequest,
|
render_request: RenderRequest,
|
||||||
) -> Result<VulkanLogicalDeviceProbe, VulkanLogicalDeviceError> {
|
) -> Result<VulkanLogicalDeviceProbe, VulkanLogicalDeviceError> {
|
||||||
let selected = select_live_device_candidate_for_request(
|
let selected = select_live_device_candidate_for_request(
|
||||||
instance,
|
instance,
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ impl VulkanSmokeRenderer {
|
|||||||
&instance,
|
&instance,
|
||||||
&surface,
|
&surface,
|
||||||
create_info.drawable_extent,
|
create_info.drawable_extent,
|
||||||
&create_info.render_request,
|
create_info.render_request,
|
||||||
)
|
)
|
||||||
.map_err(VulkanSmokeRendererError::LogicalDevice)?;
|
.map_err(VulkanSmokeRendererError::LogicalDevice)?;
|
||||||
if let Some(progress) = bootstrap_progress {
|
if let Some(progress) = bootstrap_progress {
|
||||||
|
|||||||
@@ -310,7 +310,7 @@ fn capability_gate_respects_request_specific_depth_profiles() {
|
|||||||
..RenderRequest::conservative()
|
..RenderRequest::conservative()
|
||||||
};
|
};
|
||||||
|
|
||||||
let report = select_physical_device_for_request(&[no_stencil], &relaxed_request)
|
let report = select_physical_device_for_request(&[no_stencil], relaxed_request)
|
||||||
.expect("selected device for depth-only request");
|
.expect("selected device for depth-only request");
|
||||||
|
|
||||||
assert_eq!(report.device_name, "No stencil");
|
assert_eq!(report.device_name, "No stencil");
|
||||||
|
|||||||
@@ -362,7 +362,7 @@ impl std::error::Error for VulkanCapabilityError {}
|
|||||||
pub fn select_physical_device(
|
pub fn select_physical_device(
|
||||||
devices: &[VulkanPhysicalDeviceRecord],
|
devices: &[VulkanPhysicalDeviceRecord],
|
||||||
) -> Result<VulkanCapabilityReport, VulkanCapabilityError> {
|
) -> Result<VulkanCapabilityReport, VulkanCapabilityError> {
|
||||||
select_physical_device_for_request(devices, &RenderRequest::conservative())
|
select_physical_device_for_request(devices, RenderRequest::conservative())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Selects a Vulkan physical device for a specific Stage 0 render request.
|
/// Selects a Vulkan physical device for a specific Stage 0 render request.
|
||||||
@@ -374,7 +374,7 @@ pub fn select_physical_device(
|
|||||||
/// requirements for the requested profile.
|
/// requirements for the requested profile.
|
||||||
pub fn select_physical_device_for_request(
|
pub fn select_physical_device_for_request(
|
||||||
devices: &[VulkanPhysicalDeviceRecord],
|
devices: &[VulkanPhysicalDeviceRecord],
|
||||||
render_request: &RenderRequest,
|
render_request: RenderRequest,
|
||||||
) -> Result<VulkanCapabilityReport, VulkanCapabilityError> {
|
) -> Result<VulkanCapabilityReport, VulkanCapabilityError> {
|
||||||
if devices.is_empty() {
|
if devices.is_empty() {
|
||||||
return Err(VulkanCapabilityError::NoPhysicalDevice);
|
return Err(VulkanCapabilityError::NoPhysicalDevice);
|
||||||
@@ -675,7 +675,7 @@ fn select_image_count(capabilities: VulkanSwapchainSurfaceCapabilities) -> u32 {
|
|||||||
|
|
||||||
pub(crate) fn validate_device_for_request(
|
pub(crate) fn validate_device_for_request(
|
||||||
device: &VulkanPhysicalDeviceRecord,
|
device: &VulkanPhysicalDeviceRecord,
|
||||||
render_request: &RenderRequest,
|
render_request: RenderRequest,
|
||||||
) -> Result<VulkanCapabilityReport, VulkanCapabilityError> {
|
) -> Result<VulkanCapabilityReport, VulkanCapabilityError> {
|
||||||
if device.api_version < MIN_VULKAN_API_VERSION {
|
if device.api_version < MIN_VULKAN_API_VERSION {
|
||||||
return Err(VulkanCapabilityError::ApiVersionTooLow {
|
return Err(VulkanCapabilityError::ApiVersionTooLow {
|
||||||
@@ -830,7 +830,6 @@ fn informational_capabilities(
|
|||||||
|
|
||||||
fn required_depth_stencil_formats(depth: DepthStencilSupport) -> &'static [vk::Format] {
|
fn required_depth_stencil_formats(depth: DepthStencilSupport) -> &'static [vk::Format] {
|
||||||
match (depth.depth_bits, depth.stencil_bits) {
|
match (depth.depth_bits, depth.stencil_bits) {
|
||||||
(0, 0) => &[],
|
|
||||||
(16, 0) => &[vk::Format::D16_UNORM, vk::Format::D32_SFLOAT],
|
(16, 0) => &[vk::Format::D16_UNORM, vk::Format::D32_SFLOAT],
|
||||||
(24, 0) => &[vk::Format::X8_D24_UNORM_PACK32, vk::Format::D32_SFLOAT],
|
(24, 0) => &[vk::Format::X8_D24_UNORM_PACK32, vk::Format::D32_SFLOAT],
|
||||||
(32, 0) => &[vk::Format::D32_SFLOAT],
|
(32, 0) => &[vk::Format::D32_SFLOAT],
|
||||||
|
|||||||
@@ -729,7 +729,11 @@ impl AtomicWindowPhase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn status(&self) -> &'static str {
|
fn status(&self) -> &'static str {
|
||||||
WindowPhase::from_u8(self.0.load(Ordering::SeqCst) as u8).status()
|
match u8::try_from(self.0.load(Ordering::SeqCst)) {
|
||||||
|
Ok(value) => WindowPhase::from_u8(value),
|
||||||
|
Err(_) => WindowPhase::NotStarted,
|
||||||
|
}
|
||||||
|
.status()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user