Normalize logging levels (#8579)

This commit is contained in:
Connor Fitzgerald 2025-11-27 04:55:02 -05:00 committed by GitHub
parent f114138e52
commit dc01e6e213
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
27 changed files with 94 additions and 88 deletions

View File

@ -106,6 +106,20 @@ One other breaking change worth noting is that in WGSL `@builtin(view_index)` no
By @SupaMaggie70Incorporated in [#8206](https://github.com/gfx-rs/wgpu/pull/8206).
#### Log Levels
We have received complaints about wgpu being way too log spammy at log levels `info`/`warn`/`error`. We have
adjusted our log policy and changed logging such that `info` and above should be silent unless some exceptional
event happens. Our new log policy is as follows:
- Error: if we cant (for some reason, usually a bug) communicate an error any other way.
- Warning: similar, but there may be one-shot warnings about almost certainly sub-optimal.
- Info: do not use
- Debug: Used for interesting events happening inside wgpu.
- Trace: Used for all events that might be useful to either `wgpu` or application developers.
By @cwfitzgerald in [#8579](https://github.com/gfx-rs/wgpu/pull/8579).
### New Features
- Added support for transient textures on Vulkan and Metal. By @opstic in [#8247](https://github.com/gfx-rs/wgpu/pull/8247)

View File

@ -60,16 +60,11 @@ fn init_logger() {
let query_level: Option<log::LevelFilter> = parse_url_query_string(&query_string, "RUST_LOG")
.and_then(|x| x.parse().ok());
// We keep wgpu at Error level, as it's very noisy.
let base_level = query_level.unwrap_or(log::LevelFilter::Info);
let wgpu_level = query_level.unwrap_or(log::LevelFilter::Error);
// On web, we use fern, as console_log doesn't have filtering on a per-module level.
fern::Dispatch::new()
.level(base_level)
.level_for("wgpu_core", wgpu_level)
.level_for("wgpu_hal", wgpu_level)
.level_for("naga", wgpu_level)
.chain(fern::Output::call(console_log::log))
.apply()
.unwrap();
@ -79,10 +74,6 @@ fn init_logger() {
// of these default filters.
env_logger::builder()
.filter_level(log::LevelFilter::Info)
// We keep wgpu at Error level, as it's very noisy.
.filter_module("wgpu_core", log::LevelFilter::Info)
.filter_module("wgpu_hal", log::LevelFilter::Error)
.filter_module("naga", log::LevelFilter::Error)
.parse_default_env()
.init();
}

View File

@ -441,7 +441,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
_ => false,
})
{
log::info!(
log::debug!(
"Skipping function {:?} (name {:?}) because global {:?} is inaccessible",
handle,
function.name,
@ -945,7 +945,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
if let Some(ref binding) = global.binding {
if let Err(err) = self.options.resolve_resource_binding(binding) {
log::info!(
log::debug!(
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
handle,
global.name,
@ -1187,7 +1187,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
{
Ok(bindings) => bindings,
Err(err) => {
log::info!(
log::debug!(
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
handle,
global.name,

View File

@ -2666,7 +2666,7 @@ impl Writer {
// because the entry point and its callees didn't use them,
// then we must skip it.
if !ep_info.dominates_global_use(info) {
log::info!("Skip function {:?}", ir_function.name);
log::debug!("Skip function {:?}", ir_function.name);
continue;
}

View File

@ -1669,7 +1669,7 @@ impl MacroCall {
num_args += 1;
if shadow {
log::warn!("Assuming LOD {:?} is zero", args[2],);
log::debug!("Assuming LOD {:?} is zero", args[2],);
SampleLevel::Zero
} else {
@ -1681,7 +1681,7 @@ impl MacroCall {
num_args += 2;
if shadow {
log::warn!(
log::debug!(
"Assuming gradients {:?} and {:?} are not greater than 1",
args[2],
args[3],

View File

@ -799,7 +799,15 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
dec.specialization_constant_id = Some(self.next()?);
}
other => {
log::warn!("Unknown decoration {other:?}");
let level = match other {
// Block decorations show up everywhere and we don't
// really care about them, so to prevent log spam
// we demote them to debug level.
spirv::Decoration::Block => log::Level::Debug,
_ => log::Level::Warn,
};
log::log!(level, "Unknown decoration {other:?}");
for _ in base_words + 1..inst.wc {
let _var = self.next()?;
}
@ -4746,7 +4754,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
let generator = self.next()?;
let _bound = self.next()?;
let _schema = self.next()?;
log::info!("Generated by {generator} version {version_raw:x}");
log::debug!("Generated by {generator} version {version_raw:x}");
crate::Module::default()
};
@ -4816,7 +4824,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
}
if !self.upgrade_atomics.is_empty() {
log::info!("Upgrading atomic pointers...");
log::debug!("Upgrading atomic pointers...");
module.upgrade_atomics(&self.upgrade_atomics)?;
}
@ -4826,7 +4834,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
self.process_entry_point(&mut module, ep, fun_id)?;
}
log::info!("Patching...");
log::debug!("Patching...");
{
let mut nodes = petgraph::algo::toposort(&self.function_call_graph, None)
.map_err(|cycle| Error::FunctionCallCycle(cycle.node_id()))?;
@ -4866,11 +4874,11 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
}
if !self.future_decor.is_empty() {
log::warn!("Unused item decorations: {:?}", self.future_decor);
log::debug!("Unused item decorations: {:?}", self.future_decor);
self.future_decor.clear();
}
if !self.future_member_decor.is_empty() {
log::warn!("Unused member decorations: {:?}", self.future_member_decor);
log::debug!("Unused member decorations: {:?}", self.future_member_decor);
self.future_member_decor.clear();
}

View File

@ -65,8 +65,8 @@ pub enum VaryingError {
MissingInterpolation,
#[error("Built-in {0:?} is not available at this stage")]
InvalidBuiltInStage(crate::BuiltIn),
#[error("Built-in type for {0:?} is invalid")]
InvalidBuiltInType(crate::BuiltIn),
#[error("Built-in type for {0:?} is invalid. Found {1:?}")]
InvalidBuiltInType(crate::BuiltIn, crate::TypeInner),
#[error("Entry point arguments and return values must all have bindings")]
MissingBinding,
#[error("Struct member {0} is missing a binding")]
@ -426,8 +426,7 @@ impl VaryingContext<'_> {
return Err(VaryingError::InvalidBuiltInStage(built_in));
}
if !type_good {
log::warn!("Wrong builtin type: {ty_inner:?}");
return Err(VaryingError::InvalidBuiltInType(built_in));
return Err(VaryingError::InvalidBuiltInType(built_in, ty_inner.clone()));
}
}
crate::Binding::Location {

View File

@ -4090,7 +4090,7 @@ fn invalid_clip_distances() {
Err(naga::valid::ValidationError::EntryPoint {
stage: naga::ShaderStage::Vertex,
source: naga::valid::EntryPointError::Result(
naga::valid::VaryingError::InvalidBuiltInType(naga::ir::BuiltIn::ClipDistance)
naga::valid::VaryingError::InvalidBuiltInType(naga::ir::BuiltIn::ClipDistance, _)
),
..
}),

View File

@ -340,7 +340,7 @@ pub(crate) fn build_acceleration_structures(
} in &tlas_storage
{
if tlas.update_mode == wgt::AccelerationStructureUpdateMode::PreferUpdate {
log::info!("only rebuild implemented")
log::warn!("build_acceleration_structures called with PreferUpdate, but only rebuild is implemented");
}
tlas_descriptors.push(hal::BuildAccelerationStructureDescriptor {
entries,
@ -941,7 +941,7 @@ fn map_blas<'a>(
scratch_buffer_offset,
} = storage;
if blas.update_mode == wgt::AccelerationStructureUpdateMode::PreferUpdate {
log::info!("only rebuild implemented")
log::debug!("only rebuild implemented")
}
let raw = blas.try_raw(snatch_guard)?;

View File

@ -2306,9 +2306,6 @@ impl Device {
self.check_is_valid()?;
self.require_features(wgt::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)?;
// TODO: when we get to use if-let chains, this will be a little nicer!
log::info!("Backend: {}", self.backend());
let hal_shader = match self.backend() {
wgt::Backend::Vulkan => hal::ShaderInput::SpirV(
descriptor
@ -4433,7 +4430,7 @@ impl Device {
)?;
}
_ => {
log::warn!(
log::debug!(
"The fragment stage {:?} output @location({}) values are ignored",
fragment_stage
.as_ref()

View File

@ -53,7 +53,7 @@ pub struct Trace {
impl Trace {
pub fn new(path: std::path::PathBuf) -> Result<Self, std::io::Error> {
log::info!("Tracing into '{path:?}'");
log::debug!("Tracing into '{path:?}'");
let mut file = std::fs::File::create(path.join(FILE_NAME))?;
file.write_all(b"[\n")?;
Ok(Self {

View File

@ -952,8 +952,9 @@ impl Interface {
//Note: technically this should be at least `log::error`, but
// the reality is - every shader coming from `glslc` outputs an array
// of clip distances and hits this path :(
// So we lower it to `log::warn` to be less annoying.
log::warn!("Unexpected varying type: {other:?}");
// So we lower it to `log::debug` to be less annoying as
// there's nothing the user can do about it.
log::debug!("Unexpected varying type: {other:?}");
return;
}
};

View File

@ -31,8 +31,10 @@ const MESSAGE_PREFIXES: &[(&str, log::Level)] = &[
("CORRUPTION", log::Level::Error),
("ERROR", log::Level::Error),
("WARNING", log::Level::Warn),
("INFO", log::Level::Info),
("MESSAGE", log::Level::Debug),
// We intentionally suppress "INFO" messages down to debug
// so that users are not innundated with info messages from the runtime.
("INFO", log::Level::Debug),
("MESSAGE", log::Level::Trace),
];
unsafe extern "system" fn output_debug_string_handler(

View File

@ -364,12 +364,12 @@ impl super::Adapter {
Direct3D12::D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2,
64,
),
Direct3D12::D3D12_RESOURCE_BINDING_TIER_3 => (
tier if tier.0 >= Direct3D12::D3D12_RESOURCE_BINDING_TIER_3.0 => (
tier3_practical_descriptor_limit,
tier3_practical_descriptor_limit,
),
other => {
log::warn!("Unknown resource binding tier {other:?}");
log::debug!("Got zero or negative value for resource binding tier {other:?}");
(
Direct3D12::D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1,
8,

View File

@ -362,7 +362,7 @@ impl super::Device {
(source, entry_point)
};
log::info!(
log::debug!(
"Naga generated shader for {entry_point:?} at {naga_stage:?}:\n{source}"
);

View File

@ -327,7 +327,7 @@ impl super::Adapter {
// Windows doesn't recognize `GL_MAX_VERTEX_ATTRIB_STRIDE`.
let new = (unsafe { gl.get_parameter_i32(glow::MAX_COMPUTE_SHADER_STORAGE_BLOCKS) }
as u32);
log::warn!("Max vertex shader storage blocks is zero, but GL_ARB_shader_storage_buffer_object is specified. Assuming the compute value {new}");
log::debug!("Max vertex shader storage blocks is zero, but GL_ARB_shader_storage_buffer_object is specified. Assuming the compute value {new}");
new
} else {
value
@ -366,7 +366,7 @@ impl super::Adapter {
vertex_shader_storage_blocks == 0 && vertex_shader_storage_textures != 0;
if vertex_ssbo_false_zero {
// We only care about fragment here as the 0 is a lie.
log::warn!("Max vertex shader SSBO == 0 and SSTO != 0. Interpreting as false zero.");
log::debug!("Max vertex shader SSBO == 0 and SSTO != 0. Interpreting as false zero.");
}
let max_storage_buffers_per_shader_stage = if vertex_shader_storage_blocks == 0 {
@ -736,13 +736,13 @@ impl super::Adapter {
// This should be at least 2048, but the driver for AMD Radeon HD 5870 on
// Windows doesn't recognize `GL_MAX_VERTEX_ATTRIB_STRIDE`.
log::warn!("Max vertex attribute stride is 0. Assuming it is 2048");
log::debug!("Max vertex attribute stride is 0. Assuming it is the OpenGL minimum spec 2048");
2048
} else {
value
}
} else {
log::warn!("Max vertex attribute stride unknown. Assuming it is 2048");
log::debug!("Max vertex attribute stride unknown. Assuming it is the OpenGL minimum spec 2048");
2048
}
} else {
@ -832,7 +832,7 @@ impl super::Adapter {
&& r.split(&[' ', '(', ')'][..])
.any(|substr| substr.len() == 3 && substr.chars().nth(2) == Some('l'))
{
log::warn!(
log::debug!(
"Detected skylake derivative running on mesa i915. Clears to srgb textures will \
use manual shader clears."
);
@ -955,7 +955,7 @@ impl super::Adapter {
let linked_ok = unsafe { gl.get_program_link_status(program) };
let msg = unsafe { gl.get_program_info_log(program) };
if !msg.is_empty() {
log::warn!("Shader link error: {msg}");
log::error!("Shader link error: {msg}");
}
if !linked_ok {
return None;

View File

@ -194,7 +194,7 @@ impl super::Device {
let msg = unsafe { gl.get_shader_info_log(raw) };
if compiled_ok {
if !msg.is_empty() {
log::warn!("\tCompile: {msg}");
log::debug!("\tCompile message: {msg}");
}
Ok(raw)
} else {
@ -403,7 +403,7 @@ impl super::Device {
// Create empty fragment shader if only vertex shader is present
if has_stages == wgt::ShaderStages::VERTEX {
let shader_src = format!("#version {glsl_version}\n void main(void) {{}}",);
log::info!("Only vertex shader is present. Creating an empty fragment shader",);
log::debug!("Only vertex shader is present. Creating an empty fragment shader",);
let shader = unsafe {
Self::compile_shader(
gl,
@ -432,7 +432,7 @@ impl super::Device {
return Err(crate::PipelineError::Linkage(has_stages, msg));
}
if !msg.is_empty() {
log::warn!("\tLink: {msg}");
log::debug!("\tLink message: {msg}");
}
if !private_caps.contains(PrivateCapabilities::SHADER_BINDING_LAYOUT) {

View File

@ -88,8 +88,11 @@ unsafe extern "system" fn egl_debug_proc(
let log_severity = match message_type {
EGL_DEBUG_MSG_CRITICAL_KHR | EGL_DEBUG_MSG_ERROR_KHR => log::Level::Error,
EGL_DEBUG_MSG_WARN_KHR => log::Level::Warn,
EGL_DEBUG_MSG_INFO_KHR => log::Level::Info,
_ => log::Level::Debug,
// We intentionally suppress info messages down to debug
// so that users are not innundated with info messages from
// the runtime.
EGL_DEBUG_MSG_INFO_KHR => log::Level::Debug,
_ => log::Level::Trace,
};
let command = unsafe { ffi::CStr::from_ptr(command_raw) }.to_string_lossy();
let message = if message_raw.is_null() {
@ -263,7 +266,7 @@ fn choose_config(
if tier_max == 1 {
//Note: this has been confirmed to malfunction on Intel+NV laptops,
// but also on Angle.
log::warn!("EGL says it can present to the window but not natively",);
log::info!("EGL says it can present to the window but not natively",);
}
// Android emulator can't natively present either.
let tier_threshold =
@ -275,7 +278,7 @@ fn choose_config(
return Ok((config, tier_max >= tier_threshold));
}
Ok(None) => {
log::warn!("No config found!");
log::debug!("No config found!");
}
Err(e) => {
log::error!("error in choose_first_config: {e:?}");
@ -545,7 +548,7 @@ impl Inner {
log::debug!("\tEGL surface: +srgb khr");
SrgbFrameBufferKind::Khr
} else {
log::warn!("\tEGL surface: -srgb");
log::debug!("\tEGL surface: -srgb");
SrgbFrameBufferKind::None
};
@ -902,7 +905,7 @@ impl crate::Instance for Instance {
let (display, display_owner, wsi_kind) = if let (Some(library), Some(egl)) =
(wayland_library, egl1_5)
{
log::info!("Using Wayland platform");
log::debug!("Using Wayland platform");
let display_attributes = [khronos_egl::ATTRIB_NONE];
let display = unsafe {
egl.get_platform_display(
@ -914,7 +917,7 @@ impl crate::Instance for Instance {
.map_err(instance_err("failed to get Wayland display"))?;
(display, Some(Rc::new(library)), WindowKind::Wayland)
} else if let (Some(display_owner), Some(egl)) = (x11_display_library, egl1_5) {
log::info!("Using X11 platform");
log::debug!("Using X11 platform");
let display_attributes = [khronos_egl::ATTRIB_NONE];
let display = unsafe {
egl.get_platform_display(
@ -926,7 +929,7 @@ impl crate::Instance for Instance {
.map_err(instance_err("failed to get x11 display"))?;
(display, Some(Rc::new(display_owner)), WindowKind::X11)
} else if let (Some(display_owner), Some(egl)) = (angle_x11_display_library, egl1_5) {
log::info!("Using Angle platform with X11");
log::debug!("Using Angle platform with X11");
let display_attributes = [
EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE as khronos_egl::Attrib,
EGL_PLATFORM_X11_KHR as khronos_egl::Attrib,
@ -944,7 +947,7 @@ impl crate::Instance for Instance {
.map_err(instance_err("failed to get Angle display"))?;
(display, Some(Rc::new(display_owner)), WindowKind::AngleX11)
} else if client_ext_str.contains("EGL_MESA_platform_surfaceless") {
log::warn!("No windowing system present. Using surfaceless platform");
log::debug!("No windowing system present. Using surfaceless platform");
#[allow(clippy::unnecessary_literal_unwrap)] // This is only a literal on Emscripten
let egl = egl1_5.expect("Failed to get EGL 1.5 for surfaceless");
let display = unsafe {
@ -958,7 +961,7 @@ impl crate::Instance for Instance {
(display, None, WindowKind::Unknown)
} else {
log::warn!("EGL_MESA_platform_surfaceless not available. Using default platform");
log::debug!("EGL_MESA_platform_surfaceless not available. Using default platform");
let display = unsafe { egl.get_display(khronos_egl::DEFAULT_DISPLAY) }
.ok_or_else(|| crate::InstanceError::new("Failed to get default display".into()))?;
(display, None, WindowKind::Unknown)

View File

@ -1083,7 +1083,7 @@ fn gl_debug_message_callback(source: u32, gltype: u32, id: u32, severity: u32, m
let log_severity = match severity {
glow::DEBUG_SEVERITY_HIGH => log::Level::Error,
glow::DEBUG_SEVERITY_MEDIUM => log::Level::Warn,
glow::DEBUG_SEVERITY_LOW => log::Level::Info,
glow::DEBUG_SEVERITY_LOW => log::Level::Debug,
glow::DEBUG_SEVERITY_NOTIFICATION => log::Level::Trace,
_ => unreachable!(),
};

View File

@ -218,7 +218,7 @@ impl super::Device {
.lock()
.new_library_with_source(source.as_ref(), &options)
.map_err(|err| {
log::warn!("Naga generated shader:\n{source}");
log::debug!("Naga generated shader:\n{source}");
crate::PipelineError::Linkage(stage_bit, format!("Metal: {err}"))
})?;

View File

@ -1153,7 +1153,7 @@ impl PhysicalDeviceProperties {
if self.supports_extension(ext::memory_budget::NAME) {
extensions.push(ext::memory_budget::NAME);
} else {
log::warn!("VK_EXT_memory_budget is not available.")
log::debug!("VK_EXT_memory_budget is not available.")
}
// Require `VK_KHR_draw_indirect_count` if the associated feature was requested
@ -1812,9 +1812,9 @@ impl super::Instance {
.flags
.contains(wgt::InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER)
{
log::warn!("Adapter is not Vulkan compliant: {}", info.name);
log::debug!("Adapter is not Vulkan compliant: {}", info.name);
} else {
log::warn!(
log::debug!(
"Adapter is not Vulkan compliant, hiding adapter: {}",
info.name
);
@ -1825,7 +1825,7 @@ impl super::Instance {
if phd_capabilities.device_api_version == vk::API_VERSION_1_0
&& !phd_capabilities.supports_extension(khr::storage_buffer_storage_class::NAME)
{
log::warn!(
log::debug!(
"SPIR-V storage buffer class is not supported, hiding adapter: {}",
info.name
);
@ -1834,7 +1834,7 @@ impl super::Instance {
if !phd_capabilities.supports_extension(khr::maintenance1::NAME)
&& phd_capabilities.device_api_version < vk::API_VERSION_1_1
{
log::warn!(
log::debug!(
"VK_KHR_maintenance1 is not supported, hiding adapter: {}",
info.name
);
@ -1848,7 +1848,7 @@ impl super::Instance {
};
let queue_flags = queue_families.first()?.queue_flags;
if !queue_flags.contains(vk::QueueFlags::GRAPHICS) {
log::warn!("The first queue only exposes {queue_flags:?}");
log::debug!("The first queue only exposes {queue_flags:?}");
return None;
}
@ -1985,7 +1985,7 @@ impl super::Adapter {
});
if !unsupported_extensions.is_empty() {
log::warn!("Missing extensions: {unsupported_extensions:?}");
log::debug!("Missing extensions: {unsupported_extensions:?}");
}
log::debug!("Supported extensions: {supported_extensions:?}");
@ -2864,7 +2864,7 @@ fn is_intel_igpu_outdated_for_robustness2(
.unwrap_or_default();
if is_outdated {
log::warn!(
log::debug!(
"Disabling robustBufferAccess2 and robustImageAccess2: IntegratedGpu Intel Driver is outdated. Found with version 0x{:X}, less than the known good version 0x{:X} (31.0.101.2115)",
props.driver_version,
DRIVER_VERSION_WORKING

View File

@ -81,8 +81,10 @@ unsafe extern "system" fn debug_utils_messenger_callback(
}
let level = match message_severity {
vk::DebugUtilsMessageSeverityFlagsEXT::VERBOSE => log::Level::Debug,
vk::DebugUtilsMessageSeverityFlagsEXT::INFO => log::Level::Info,
// We intentionally suppress info messages down to debug
// so that users are not innundated with info messages from the runtime.
vk::DebugUtilsMessageSeverityFlagsEXT::VERBOSE => log::Level::Trace,
vk::DebugUtilsMessageSeverityFlagsEXT::INFO => log::Level::Debug,
vk::DebugUtilsMessageSeverityFlagsEXT::WARNING => log::Level::Warn,
vk::DebugUtilsMessageSeverityFlagsEXT::ERROR => log::Level::Error,
_ => log::Level::Warn,
@ -297,7 +299,7 @@ impl super::Instance {
{
true
} else {
log::warn!("Unable to find extension: {}", ext.to_string_lossy());
log::debug!("Unable to find extension: {}", ext.to_string_lossy());
false
}
});
@ -333,7 +335,7 @@ impl super::Instance {
let debug_utils = if let Some(debug_utils_create_info) = debug_utils_create_info {
if extensions.contains(&ext::debug_utils::NAME) {
log::info!("Enabling debug utils");
log::debug!("Enabling debug utils");
let extension = ext::debug_utils::Instance::new(&entry, &raw_instance);
let vk_info = debug_utils_create_info.to_vk_create_info();
@ -707,7 +709,7 @@ impl super::Instance {
});
}
} else {
log::warn!(
log::debug!(
"InstanceFlags::VALIDATION requested, but unable to find layer: {}",
validation_layer_name.to_string_lossy()
);
@ -964,7 +966,7 @@ impl crate::Instance for super::Instance {
}) {
if version < (21, 2) {
// See https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688
log::warn!(
log::debug!(
concat!(
"Disabling presentation on '{}' (id {:?}) ",
"due to NV Optimus and Intel Mesa < v21.2"

View File

@ -595,7 +595,7 @@ impl Swapchain for NativeSwapchain {
// (i.e `VkSwapchainCreateInfoKHR::preTransform` not being equal to the current device orientation).
// This is always the case when the device orientation is anything other than the identity one, as we unconditionally use `VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR`.
#[cfg(not(target_os = "android"))]
log::warn!("Suboptimal present of frame {}", texture.index);
log::debug!("Suboptimal present of frame {}", texture.index);
}
Ok(())
}

View File

@ -3957,8 +3957,7 @@ impl TextureFormat {
// Two chroma u16s and one luma u16 per block
Self::P010 => 6,
f => {
log::warn!("Memory footprint for format {f:?} is not implemented");
0
unimplemented!("Memory footprint for format {f:?} is not implemented");
}
},
};

View File

@ -643,7 +643,6 @@ impl<'a> BufferSlice<'a> {
size: self.size,
offset: self.offset,
inner: range,
readable: self.buffer.usage.contains(BufferUsages::MAP_READ),
}
}
@ -945,7 +944,6 @@ pub struct BufferViewMut {
offset: BufferAddress,
size: BufferSize,
inner: dispatch::DispatchBufferMappedRange,
readable: bool,
}
impl AsMut<[u8]> for BufferViewMut {
@ -959,10 +957,6 @@ impl Deref for BufferViewMut {
type Target = [u8];
fn deref(&self) -> &Self::Target {
if !self.readable {
log::warn!("Reading from a BufferViewMut is slow and not recommended.");
}
self.inner.slice()
}
}

View File

@ -79,7 +79,6 @@ impl Deref for QueueWriteBufferView {
type Target = [u8];
fn deref(&self) -> &Self::Target {
log::warn!("Reading from a QueueWriteBufferView won't yield the contents of the buffer and may be slow.");
self.inner.slice()
}
}

View File

@ -116,7 +116,6 @@ fn make_spirv_be_pass() {
macro_rules! include_spirv {
($($token:tt)*) => {
{
//log::info!("including '{}'", $($token)*);
$crate::ShaderModuleDescriptor {
label: Some($($token)*),
source: $crate::ShaderSource::SpirV(
@ -140,7 +139,6 @@ static SPIRV: crate::ShaderModuleDescriptor<'_> = include_spirv!("le-aligned.spv
macro_rules! include_spirv_raw {
($($token:tt)*) => {
{
//log::info!("including '{}'", $($token)*);
$crate::ShaderModuleDescriptorPassthrough {
label: $crate::__macro_helpers::Some($($token)*),
spirv: Some($crate::__macro_helpers::Cow::Borrowed($crate::include_spirv_source!($($token)*))),
@ -177,7 +175,6 @@ static SPIRV_RAW: crate::ShaderModuleDescriptorPassthrough<'_> =
macro_rules! include_wgsl {
($($token:tt)*) => {
{
//log::info!("including '{}'", $($token)*);
$crate::ShaderModuleDescriptor {
label: $crate::__macro_helpers::Some($($token)*),
source: $crate::ShaderSource::Wgsl($crate::__macro_helpers::Cow::Borrowed($crate::__macro_helpers::include_str!($($token)*))),