mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-12-08 21:26:17 +00:00
Normalize logging levels (#8579)
This commit is contained in:
parent
f114138e52
commit
dc01e6e213
14
CHANGELOG.md
14
CHANGELOG.md
@ -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).
|
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 can’t (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
|
### New Features
|
||||||
|
|
||||||
- Added support for transient textures on Vulkan and Metal. By @opstic in [#8247](https://github.com/gfx-rs/wgpu/pull/8247)
|
- Added support for transient textures on Vulkan and Metal. By @opstic in [#8247](https://github.com/gfx-rs/wgpu/pull/8247)
|
||||||
|
|||||||
@ -60,16 +60,11 @@ fn init_logger() {
|
|||||||
let query_level: Option<log::LevelFilter> = parse_url_query_string(&query_string, "RUST_LOG")
|
let query_level: Option<log::LevelFilter> = parse_url_query_string(&query_string, "RUST_LOG")
|
||||||
.and_then(|x| x.parse().ok());
|
.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 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.
|
// On web, we use fern, as console_log doesn't have filtering on a per-module level.
|
||||||
fern::Dispatch::new()
|
fern::Dispatch::new()
|
||||||
.level(base_level)
|
.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))
|
.chain(fern::Output::call(console_log::log))
|
||||||
.apply()
|
.apply()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
@ -79,10 +74,6 @@ fn init_logger() {
|
|||||||
// of these default filters.
|
// of these default filters.
|
||||||
env_logger::builder()
|
env_logger::builder()
|
||||||
.filter_level(log::LevelFilter::Info)
|
.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()
|
.parse_default_env()
|
||||||
.init();
|
.init();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -441,7 +441,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
|
|||||||
_ => false,
|
_ => false,
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
log::info!(
|
log::debug!(
|
||||||
"Skipping function {:?} (name {:?}) because global {:?} is inaccessible",
|
"Skipping function {:?} (name {:?}) because global {:?} is inaccessible",
|
||||||
handle,
|
handle,
|
||||||
function.name,
|
function.name,
|
||||||
@ -945,7 +945,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
|
|||||||
|
|
||||||
if let Some(ref binding) = global.binding {
|
if let Some(ref binding) = global.binding {
|
||||||
if let Err(err) = self.options.resolve_resource_binding(binding) {
|
if let Err(err) = self.options.resolve_resource_binding(binding) {
|
||||||
log::info!(
|
log::debug!(
|
||||||
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
|
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
|
||||||
handle,
|
handle,
|
||||||
global.name,
|
global.name,
|
||||||
@ -1187,7 +1187,7 @@ impl<'a, W: fmt::Write> super::Writer<'a, W> {
|
|||||||
{
|
{
|
||||||
Ok(bindings) => bindings,
|
Ok(bindings) => bindings,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
log::info!(
|
log::debug!(
|
||||||
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
|
"Skipping global {:?} (name {:?}) for being inaccessible: {}",
|
||||||
handle,
|
handle,
|
||||||
global.name,
|
global.name,
|
||||||
|
|||||||
@ -2666,7 +2666,7 @@ impl Writer {
|
|||||||
// because the entry point and its callees didn't use them,
|
// because the entry point and its callees didn't use them,
|
||||||
// then we must skip it.
|
// then we must skip it.
|
||||||
if !ep_info.dominates_global_use(info) {
|
if !ep_info.dominates_global_use(info) {
|
||||||
log::info!("Skip function {:?}", ir_function.name);
|
log::debug!("Skip function {:?}", ir_function.name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1669,7 +1669,7 @@ impl MacroCall {
|
|||||||
num_args += 1;
|
num_args += 1;
|
||||||
|
|
||||||
if shadow {
|
if shadow {
|
||||||
log::warn!("Assuming LOD {:?} is zero", args[2],);
|
log::debug!("Assuming LOD {:?} is zero", args[2],);
|
||||||
|
|
||||||
SampleLevel::Zero
|
SampleLevel::Zero
|
||||||
} else {
|
} else {
|
||||||
@ -1681,7 +1681,7 @@ impl MacroCall {
|
|||||||
num_args += 2;
|
num_args += 2;
|
||||||
|
|
||||||
if shadow {
|
if shadow {
|
||||||
log::warn!(
|
log::debug!(
|
||||||
"Assuming gradients {:?} and {:?} are not greater than 1",
|
"Assuming gradients {:?} and {:?} are not greater than 1",
|
||||||
args[2],
|
args[2],
|
||||||
args[3],
|
args[3],
|
||||||
|
|||||||
@ -799,7 +799,15 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
|
|||||||
dec.specialization_constant_id = Some(self.next()?);
|
dec.specialization_constant_id = Some(self.next()?);
|
||||||
}
|
}
|
||||||
other => {
|
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 {
|
for _ in base_words + 1..inst.wc {
|
||||||
let _var = self.next()?;
|
let _var = self.next()?;
|
||||||
}
|
}
|
||||||
@ -4746,7 +4754,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
|
|||||||
let generator = self.next()?;
|
let generator = self.next()?;
|
||||||
let _bound = self.next()?;
|
let _bound = self.next()?;
|
||||||
let _schema = 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()
|
crate::Module::default()
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -4816,7 +4824,7 @@ impl<I: Iterator<Item = u32>> Frontend<I> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !self.upgrade_atomics.is_empty() {
|
if !self.upgrade_atomics.is_empty() {
|
||||||
log::info!("Upgrading atomic pointers...");
|
log::debug!("Upgrading atomic pointers...");
|
||||||
module.upgrade_atomics(&self.upgrade_atomics)?;
|
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)?;
|
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)
|
let mut nodes = petgraph::algo::toposort(&self.function_call_graph, None)
|
||||||
.map_err(|cycle| Error::FunctionCallCycle(cycle.node_id()))?;
|
.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() {
|
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();
|
self.future_decor.clear();
|
||||||
}
|
}
|
||||||
if !self.future_member_decor.is_empty() {
|
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();
|
self.future_member_decor.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -65,8 +65,8 @@ pub enum VaryingError {
|
|||||||
MissingInterpolation,
|
MissingInterpolation,
|
||||||
#[error("Built-in {0:?} is not available at this stage")]
|
#[error("Built-in {0:?} is not available at this stage")]
|
||||||
InvalidBuiltInStage(crate::BuiltIn),
|
InvalidBuiltInStage(crate::BuiltIn),
|
||||||
#[error("Built-in type for {0:?} is invalid")]
|
#[error("Built-in type for {0:?} is invalid. Found {1:?}")]
|
||||||
InvalidBuiltInType(crate::BuiltIn),
|
InvalidBuiltInType(crate::BuiltIn, crate::TypeInner),
|
||||||
#[error("Entry point arguments and return values must all have bindings")]
|
#[error("Entry point arguments and return values must all have bindings")]
|
||||||
MissingBinding,
|
MissingBinding,
|
||||||
#[error("Struct member {0} is missing a binding")]
|
#[error("Struct member {0} is missing a binding")]
|
||||||
@ -426,8 +426,7 @@ impl VaryingContext<'_> {
|
|||||||
return Err(VaryingError::InvalidBuiltInStage(built_in));
|
return Err(VaryingError::InvalidBuiltInStage(built_in));
|
||||||
}
|
}
|
||||||
if !type_good {
|
if !type_good {
|
||||||
log::warn!("Wrong builtin type: {ty_inner:?}");
|
return Err(VaryingError::InvalidBuiltInType(built_in, ty_inner.clone()));
|
||||||
return Err(VaryingError::InvalidBuiltInType(built_in));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
crate::Binding::Location {
|
crate::Binding::Location {
|
||||||
|
|||||||
@ -4090,7 +4090,7 @@ fn invalid_clip_distances() {
|
|||||||
Err(naga::valid::ValidationError::EntryPoint {
|
Err(naga::valid::ValidationError::EntryPoint {
|
||||||
stage: naga::ShaderStage::Vertex,
|
stage: naga::ShaderStage::Vertex,
|
||||||
source: naga::valid::EntryPointError::Result(
|
source: naga::valid::EntryPointError::Result(
|
||||||
naga::valid::VaryingError::InvalidBuiltInType(naga::ir::BuiltIn::ClipDistance)
|
naga::valid::VaryingError::InvalidBuiltInType(naga::ir::BuiltIn::ClipDistance, _)
|
||||||
),
|
),
|
||||||
..
|
..
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -340,7 +340,7 @@ pub(crate) fn build_acceleration_structures(
|
|||||||
} in &tlas_storage
|
} in &tlas_storage
|
||||||
{
|
{
|
||||||
if tlas.update_mode == wgt::AccelerationStructureUpdateMode::PreferUpdate {
|
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 {
|
tlas_descriptors.push(hal::BuildAccelerationStructureDescriptor {
|
||||||
entries,
|
entries,
|
||||||
@ -941,7 +941,7 @@ fn map_blas<'a>(
|
|||||||
scratch_buffer_offset,
|
scratch_buffer_offset,
|
||||||
} = storage;
|
} = storage;
|
||||||
if blas.update_mode == wgt::AccelerationStructureUpdateMode::PreferUpdate {
|
if blas.update_mode == wgt::AccelerationStructureUpdateMode::PreferUpdate {
|
||||||
log::info!("only rebuild implemented")
|
log::debug!("only rebuild implemented")
|
||||||
}
|
}
|
||||||
let raw = blas.try_raw(snatch_guard)?;
|
let raw = blas.try_raw(snatch_guard)?;
|
||||||
|
|
||||||
|
|||||||
@ -2306,9 +2306,6 @@ impl Device {
|
|||||||
self.check_is_valid()?;
|
self.check_is_valid()?;
|
||||||
self.require_features(wgt::Features::EXPERIMENTAL_PASSTHROUGH_SHADERS)?;
|
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() {
|
let hal_shader = match self.backend() {
|
||||||
wgt::Backend::Vulkan => hal::ShaderInput::SpirV(
|
wgt::Backend::Vulkan => hal::ShaderInput::SpirV(
|
||||||
descriptor
|
descriptor
|
||||||
@ -4433,7 +4430,7 @@ impl Device {
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
log::warn!(
|
log::debug!(
|
||||||
"The fragment stage {:?} output @location({}) values are ignored",
|
"The fragment stage {:?} output @location({}) values are ignored",
|
||||||
fragment_stage
|
fragment_stage
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|||||||
@ -53,7 +53,7 @@ pub struct Trace {
|
|||||||
|
|
||||||
impl Trace {
|
impl Trace {
|
||||||
pub fn new(path: std::path::PathBuf) -> Result<Self, std::io::Error> {
|
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))?;
|
let mut file = std::fs::File::create(path.join(FILE_NAME))?;
|
||||||
file.write_all(b"[\n")?;
|
file.write_all(b"[\n")?;
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
|
|||||||
@ -952,8 +952,9 @@ impl Interface {
|
|||||||
//Note: technically this should be at least `log::error`, but
|
//Note: technically this should be at least `log::error`, but
|
||||||
// the reality is - every shader coming from `glslc` outputs an array
|
// the reality is - every shader coming from `glslc` outputs an array
|
||||||
// of clip distances and hits this path :(
|
// of clip distances and hits this path :(
|
||||||
// So we lower it to `log::warn` to be less annoying.
|
// So we lower it to `log::debug` to be less annoying as
|
||||||
log::warn!("Unexpected varying type: {other:?}");
|
// there's nothing the user can do about it.
|
||||||
|
log::debug!("Unexpected varying type: {other:?}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -31,8 +31,10 @@ const MESSAGE_PREFIXES: &[(&str, log::Level)] = &[
|
|||||||
("CORRUPTION", log::Level::Error),
|
("CORRUPTION", log::Level::Error),
|
||||||
("ERROR", log::Level::Error),
|
("ERROR", log::Level::Error),
|
||||||
("WARNING", log::Level::Warn),
|
("WARNING", log::Level::Warn),
|
||||||
("INFO", log::Level::Info),
|
// We intentionally suppress "INFO" messages down to debug
|
||||||
("MESSAGE", log::Level::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(
|
unsafe extern "system" fn output_debug_string_handler(
|
||||||
|
|||||||
@ -364,12 +364,12 @@ impl super::Adapter {
|
|||||||
Direct3D12::D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2,
|
Direct3D12::D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_2,
|
||||||
64,
|
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,
|
||||||
tier3_practical_descriptor_limit,
|
tier3_practical_descriptor_limit,
|
||||||
),
|
),
|
||||||
other => {
|
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,
|
Direct3D12::D3D12_MAX_SHADER_VISIBLE_DESCRIPTOR_HEAP_SIZE_TIER_1,
|
||||||
8,
|
8,
|
||||||
|
|||||||
@ -362,7 +362,7 @@ impl super::Device {
|
|||||||
|
|
||||||
(source, entry_point)
|
(source, entry_point)
|
||||||
};
|
};
|
||||||
log::info!(
|
log::debug!(
|
||||||
"Naga generated shader for {entry_point:?} at {naga_stage:?}:\n{source}"
|
"Naga generated shader for {entry_point:?} at {naga_stage:?}:\n{source}"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -327,7 +327,7 @@ impl super::Adapter {
|
|||||||
// Windows doesn't recognize `GL_MAX_VERTEX_ATTRIB_STRIDE`.
|
// Windows doesn't recognize `GL_MAX_VERTEX_ATTRIB_STRIDE`.
|
||||||
let new = (unsafe { gl.get_parameter_i32(glow::MAX_COMPUTE_SHADER_STORAGE_BLOCKS) }
|
let new = (unsafe { gl.get_parameter_i32(glow::MAX_COMPUTE_SHADER_STORAGE_BLOCKS) }
|
||||||
as u32);
|
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
|
new
|
||||||
} else {
|
} else {
|
||||||
value
|
value
|
||||||
@ -366,7 +366,7 @@ impl super::Adapter {
|
|||||||
vertex_shader_storage_blocks == 0 && vertex_shader_storage_textures != 0;
|
vertex_shader_storage_blocks == 0 && vertex_shader_storage_textures != 0;
|
||||||
if vertex_ssbo_false_zero {
|
if vertex_ssbo_false_zero {
|
||||||
// We only care about fragment here as the 0 is a lie.
|
// 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 {
|
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
|
// This should be at least 2048, but the driver for AMD Radeon HD 5870 on
|
||||||
// Windows doesn't recognize `GL_MAX_VERTEX_ATTRIB_STRIDE`.
|
// 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
|
2048
|
||||||
} else {
|
} else {
|
||||||
value
|
value
|
||||||
}
|
}
|
||||||
} else {
|
} 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
|
2048
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -832,7 +832,7 @@ impl super::Adapter {
|
|||||||
&& r.split(&[' ', '(', ')'][..])
|
&& r.split(&[' ', '(', ')'][..])
|
||||||
.any(|substr| substr.len() == 3 && substr.chars().nth(2) == Some('l'))
|
.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 \
|
"Detected skylake derivative running on mesa i915. Clears to srgb textures will \
|
||||||
use manual shader clears."
|
use manual shader clears."
|
||||||
);
|
);
|
||||||
@ -955,7 +955,7 @@ impl super::Adapter {
|
|||||||
let linked_ok = unsafe { gl.get_program_link_status(program) };
|
let linked_ok = unsafe { gl.get_program_link_status(program) };
|
||||||
let msg = unsafe { gl.get_program_info_log(program) };
|
let msg = unsafe { gl.get_program_info_log(program) };
|
||||||
if !msg.is_empty() {
|
if !msg.is_empty() {
|
||||||
log::warn!("Shader link error: {msg}");
|
log::error!("Shader link error: {msg}");
|
||||||
}
|
}
|
||||||
if !linked_ok {
|
if !linked_ok {
|
||||||
return None;
|
return None;
|
||||||
|
|||||||
@ -194,7 +194,7 @@ impl super::Device {
|
|||||||
let msg = unsafe { gl.get_shader_info_log(raw) };
|
let msg = unsafe { gl.get_shader_info_log(raw) };
|
||||||
if compiled_ok {
|
if compiled_ok {
|
||||||
if !msg.is_empty() {
|
if !msg.is_empty() {
|
||||||
log::warn!("\tCompile: {msg}");
|
log::debug!("\tCompile message: {msg}");
|
||||||
}
|
}
|
||||||
Ok(raw)
|
Ok(raw)
|
||||||
} else {
|
} else {
|
||||||
@ -403,7 +403,7 @@ impl super::Device {
|
|||||||
// Create empty fragment shader if only vertex shader is present
|
// Create empty fragment shader if only vertex shader is present
|
||||||
if has_stages == wgt::ShaderStages::VERTEX {
|
if has_stages == wgt::ShaderStages::VERTEX {
|
||||||
let shader_src = format!("#version {glsl_version}\n void main(void) {{}}",);
|
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 {
|
let shader = unsafe {
|
||||||
Self::compile_shader(
|
Self::compile_shader(
|
||||||
gl,
|
gl,
|
||||||
@ -432,7 +432,7 @@ impl super::Device {
|
|||||||
return Err(crate::PipelineError::Linkage(has_stages, msg));
|
return Err(crate::PipelineError::Linkage(has_stages, msg));
|
||||||
}
|
}
|
||||||
if !msg.is_empty() {
|
if !msg.is_empty() {
|
||||||
log::warn!("\tLink: {msg}");
|
log::debug!("\tLink message: {msg}");
|
||||||
}
|
}
|
||||||
|
|
||||||
if !private_caps.contains(PrivateCapabilities::SHADER_BINDING_LAYOUT) {
|
if !private_caps.contains(PrivateCapabilities::SHADER_BINDING_LAYOUT) {
|
||||||
|
|||||||
@ -88,8 +88,11 @@ unsafe extern "system" fn egl_debug_proc(
|
|||||||
let log_severity = match message_type {
|
let log_severity = match message_type {
|
||||||
EGL_DEBUG_MSG_CRITICAL_KHR | EGL_DEBUG_MSG_ERROR_KHR => log::Level::Error,
|
EGL_DEBUG_MSG_CRITICAL_KHR | EGL_DEBUG_MSG_ERROR_KHR => log::Level::Error,
|
||||||
EGL_DEBUG_MSG_WARN_KHR => log::Level::Warn,
|
EGL_DEBUG_MSG_WARN_KHR => log::Level::Warn,
|
||||||
EGL_DEBUG_MSG_INFO_KHR => log::Level::Info,
|
// We intentionally suppress info messages down to debug
|
||||||
_ => log::Level::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 command = unsafe { ffi::CStr::from_ptr(command_raw) }.to_string_lossy();
|
||||||
let message = if message_raw.is_null() {
|
let message = if message_raw.is_null() {
|
||||||
@ -263,7 +266,7 @@ fn choose_config(
|
|||||||
if tier_max == 1 {
|
if tier_max == 1 {
|
||||||
//Note: this has been confirmed to malfunction on Intel+NV laptops,
|
//Note: this has been confirmed to malfunction on Intel+NV laptops,
|
||||||
// but also on Angle.
|
// 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.
|
// Android emulator can't natively present either.
|
||||||
let tier_threshold =
|
let tier_threshold =
|
||||||
@ -275,7 +278,7 @@ fn choose_config(
|
|||||||
return Ok((config, tier_max >= tier_threshold));
|
return Ok((config, tier_max >= tier_threshold));
|
||||||
}
|
}
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
log::warn!("No config found!");
|
log::debug!("No config found!");
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
log::error!("error in choose_first_config: {e:?}");
|
log::error!("error in choose_first_config: {e:?}");
|
||||||
@ -545,7 +548,7 @@ impl Inner {
|
|||||||
log::debug!("\tEGL surface: +srgb khr");
|
log::debug!("\tEGL surface: +srgb khr");
|
||||||
SrgbFrameBufferKind::Khr
|
SrgbFrameBufferKind::Khr
|
||||||
} else {
|
} else {
|
||||||
log::warn!("\tEGL surface: -srgb");
|
log::debug!("\tEGL surface: -srgb");
|
||||||
SrgbFrameBufferKind::None
|
SrgbFrameBufferKind::None
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -902,7 +905,7 @@ impl crate::Instance for Instance {
|
|||||||
let (display, display_owner, wsi_kind) = if let (Some(library), Some(egl)) =
|
let (display, display_owner, wsi_kind) = if let (Some(library), Some(egl)) =
|
||||||
(wayland_library, egl1_5)
|
(wayland_library, egl1_5)
|
||||||
{
|
{
|
||||||
log::info!("Using Wayland platform");
|
log::debug!("Using Wayland platform");
|
||||||
let display_attributes = [khronos_egl::ATTRIB_NONE];
|
let display_attributes = [khronos_egl::ATTRIB_NONE];
|
||||||
let display = unsafe {
|
let display = unsafe {
|
||||||
egl.get_platform_display(
|
egl.get_platform_display(
|
||||||
@ -914,7 +917,7 @@ impl crate::Instance for Instance {
|
|||||||
.map_err(instance_err("failed to get Wayland display"))?;
|
.map_err(instance_err("failed to get Wayland display"))?;
|
||||||
(display, Some(Rc::new(library)), WindowKind::Wayland)
|
(display, Some(Rc::new(library)), WindowKind::Wayland)
|
||||||
} else if let (Some(display_owner), Some(egl)) = (x11_display_library, egl1_5) {
|
} 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_attributes = [khronos_egl::ATTRIB_NONE];
|
||||||
let display = unsafe {
|
let display = unsafe {
|
||||||
egl.get_platform_display(
|
egl.get_platform_display(
|
||||||
@ -926,7 +929,7 @@ impl crate::Instance for Instance {
|
|||||||
.map_err(instance_err("failed to get x11 display"))?;
|
.map_err(instance_err("failed to get x11 display"))?;
|
||||||
(display, Some(Rc::new(display_owner)), WindowKind::X11)
|
(display, Some(Rc::new(display_owner)), WindowKind::X11)
|
||||||
} else if let (Some(display_owner), Some(egl)) = (angle_x11_display_library, egl1_5) {
|
} 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 = [
|
let display_attributes = [
|
||||||
EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE as khronos_egl::Attrib,
|
EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE as khronos_egl::Attrib,
|
||||||
EGL_PLATFORM_X11_KHR 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"))?;
|
.map_err(instance_err("failed to get Angle display"))?;
|
||||||
(display, Some(Rc::new(display_owner)), WindowKind::AngleX11)
|
(display, Some(Rc::new(display_owner)), WindowKind::AngleX11)
|
||||||
} else if client_ext_str.contains("EGL_MESA_platform_surfaceless") {
|
} 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
|
#[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 egl = egl1_5.expect("Failed to get EGL 1.5 for surfaceless");
|
||||||
let display = unsafe {
|
let display = unsafe {
|
||||||
@ -958,7 +961,7 @@ impl crate::Instance for Instance {
|
|||||||
|
|
||||||
(display, None, WindowKind::Unknown)
|
(display, None, WindowKind::Unknown)
|
||||||
} else {
|
} 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) }
|
let display = unsafe { egl.get_display(khronos_egl::DEFAULT_DISPLAY) }
|
||||||
.ok_or_else(|| crate::InstanceError::new("Failed to get default display".into()))?;
|
.ok_or_else(|| crate::InstanceError::new("Failed to get default display".into()))?;
|
||||||
(display, None, WindowKind::Unknown)
|
(display, None, WindowKind::Unknown)
|
||||||
|
|||||||
@ -1083,7 +1083,7 @@ fn gl_debug_message_callback(source: u32, gltype: u32, id: u32, severity: u32, m
|
|||||||
let log_severity = match severity {
|
let log_severity = match severity {
|
||||||
glow::DEBUG_SEVERITY_HIGH => log::Level::Error,
|
glow::DEBUG_SEVERITY_HIGH => log::Level::Error,
|
||||||
glow::DEBUG_SEVERITY_MEDIUM => log::Level::Warn,
|
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,
|
glow::DEBUG_SEVERITY_NOTIFICATION => log::Level::Trace,
|
||||||
_ => unreachable!(),
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|||||||
@ -218,7 +218,7 @@ impl super::Device {
|
|||||||
.lock()
|
.lock()
|
||||||
.new_library_with_source(source.as_ref(), &options)
|
.new_library_with_source(source.as_ref(), &options)
|
||||||
.map_err(|err| {
|
.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}"))
|
crate::PipelineError::Linkage(stage_bit, format!("Metal: {err}"))
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
|||||||
@ -1153,7 +1153,7 @@ impl PhysicalDeviceProperties {
|
|||||||
if self.supports_extension(ext::memory_budget::NAME) {
|
if self.supports_extension(ext::memory_budget::NAME) {
|
||||||
extensions.push(ext::memory_budget::NAME);
|
extensions.push(ext::memory_budget::NAME);
|
||||||
} else {
|
} 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
|
// Require `VK_KHR_draw_indirect_count` if the associated feature was requested
|
||||||
@ -1812,9 +1812,9 @@ impl super::Instance {
|
|||||||
.flags
|
.flags
|
||||||
.contains(wgt::InstanceFlags::ALLOW_UNDERLYING_NONCOMPLIANT_ADAPTER)
|
.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 {
|
} else {
|
||||||
log::warn!(
|
log::debug!(
|
||||||
"Adapter is not Vulkan compliant, hiding adapter: {}",
|
"Adapter is not Vulkan compliant, hiding adapter: {}",
|
||||||
info.name
|
info.name
|
||||||
);
|
);
|
||||||
@ -1825,7 +1825,7 @@ impl super::Instance {
|
|||||||
if phd_capabilities.device_api_version == vk::API_VERSION_1_0
|
if phd_capabilities.device_api_version == vk::API_VERSION_1_0
|
||||||
&& !phd_capabilities.supports_extension(khr::storage_buffer_storage_class::NAME)
|
&& !phd_capabilities.supports_extension(khr::storage_buffer_storage_class::NAME)
|
||||||
{
|
{
|
||||||
log::warn!(
|
log::debug!(
|
||||||
"SPIR-V storage buffer class is not supported, hiding adapter: {}",
|
"SPIR-V storage buffer class is not supported, hiding adapter: {}",
|
||||||
info.name
|
info.name
|
||||||
);
|
);
|
||||||
@ -1834,7 +1834,7 @@ impl super::Instance {
|
|||||||
if !phd_capabilities.supports_extension(khr::maintenance1::NAME)
|
if !phd_capabilities.supports_extension(khr::maintenance1::NAME)
|
||||||
&& phd_capabilities.device_api_version < vk::API_VERSION_1_1
|
&& phd_capabilities.device_api_version < vk::API_VERSION_1_1
|
||||||
{
|
{
|
||||||
log::warn!(
|
log::debug!(
|
||||||
"VK_KHR_maintenance1 is not supported, hiding adapter: {}",
|
"VK_KHR_maintenance1 is not supported, hiding adapter: {}",
|
||||||
info.name
|
info.name
|
||||||
);
|
);
|
||||||
@ -1848,7 +1848,7 @@ impl super::Instance {
|
|||||||
};
|
};
|
||||||
let queue_flags = queue_families.first()?.queue_flags;
|
let queue_flags = queue_families.first()?.queue_flags;
|
||||||
if !queue_flags.contains(vk::QueueFlags::GRAPHICS) {
|
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;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1985,7 +1985,7 @@ impl super::Adapter {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if !unsupported_extensions.is_empty() {
|
if !unsupported_extensions.is_empty() {
|
||||||
log::warn!("Missing extensions: {unsupported_extensions:?}");
|
log::debug!("Missing extensions: {unsupported_extensions:?}");
|
||||||
}
|
}
|
||||||
|
|
||||||
log::debug!("Supported extensions: {supported_extensions:?}");
|
log::debug!("Supported extensions: {supported_extensions:?}");
|
||||||
@ -2864,7 +2864,7 @@ fn is_intel_igpu_outdated_for_robustness2(
|
|||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
if is_outdated {
|
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)",
|
"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,
|
props.driver_version,
|
||||||
DRIVER_VERSION_WORKING
|
DRIVER_VERSION_WORKING
|
||||||
|
|||||||
@ -81,8 +81,10 @@ unsafe extern "system" fn debug_utils_messenger_callback(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let level = match message_severity {
|
let level = match message_severity {
|
||||||
vk::DebugUtilsMessageSeverityFlagsEXT::VERBOSE => log::Level::Debug,
|
// We intentionally suppress info messages down to debug
|
||||||
vk::DebugUtilsMessageSeverityFlagsEXT::INFO => log::Level::Info,
|
// 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::WARNING => log::Level::Warn,
|
||||||
vk::DebugUtilsMessageSeverityFlagsEXT::ERROR => log::Level::Error,
|
vk::DebugUtilsMessageSeverityFlagsEXT::ERROR => log::Level::Error,
|
||||||
_ => log::Level::Warn,
|
_ => log::Level::Warn,
|
||||||
@ -297,7 +299,7 @@ impl super::Instance {
|
|||||||
{
|
{
|
||||||
true
|
true
|
||||||
} else {
|
} else {
|
||||||
log::warn!("Unable to find extension: {}", ext.to_string_lossy());
|
log::debug!("Unable to find extension: {}", ext.to_string_lossy());
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -333,7 +335,7 @@ impl super::Instance {
|
|||||||
|
|
||||||
let debug_utils = if let Some(debug_utils_create_info) = debug_utils_create_info {
|
let debug_utils = if let Some(debug_utils_create_info) = debug_utils_create_info {
|
||||||
if extensions.contains(&ext::debug_utils::NAME) {
|
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 extension = ext::debug_utils::Instance::new(&entry, &raw_instance);
|
||||||
let vk_info = debug_utils_create_info.to_vk_create_info();
|
let vk_info = debug_utils_create_info.to_vk_create_info();
|
||||||
@ -707,7 +709,7 @@ impl super::Instance {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log::warn!(
|
log::debug!(
|
||||||
"InstanceFlags::VALIDATION requested, but unable to find layer: {}",
|
"InstanceFlags::VALIDATION requested, but unable to find layer: {}",
|
||||||
validation_layer_name.to_string_lossy()
|
validation_layer_name.to_string_lossy()
|
||||||
);
|
);
|
||||||
@ -964,7 +966,7 @@ impl crate::Instance for super::Instance {
|
|||||||
}) {
|
}) {
|
||||||
if version < (21, 2) {
|
if version < (21, 2) {
|
||||||
// See https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688
|
// See https://gitlab.freedesktop.org/mesa/mesa/-/issues/4688
|
||||||
log::warn!(
|
log::debug!(
|
||||||
concat!(
|
concat!(
|
||||||
"Disabling presentation on '{}' (id {:?}) ",
|
"Disabling presentation on '{}' (id {:?}) ",
|
||||||
"due to NV Optimus and Intel Mesa < v21.2"
|
"due to NV Optimus and Intel Mesa < v21.2"
|
||||||
|
|||||||
@ -595,7 +595,7 @@ impl Swapchain for NativeSwapchain {
|
|||||||
// (i.e `VkSwapchainCreateInfoKHR::preTransform` not being equal to the current device orientation).
|
// (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`.
|
// 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"))]
|
#[cfg(not(target_os = "android"))]
|
||||||
log::warn!("Suboptimal present of frame {}", texture.index);
|
log::debug!("Suboptimal present of frame {}", texture.index);
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3957,8 +3957,7 @@ impl TextureFormat {
|
|||||||
// Two chroma u16s and one luma u16 per block
|
// Two chroma u16s and one luma u16 per block
|
||||||
Self::P010 => 6,
|
Self::P010 => 6,
|
||||||
f => {
|
f => {
|
||||||
log::warn!("Memory footprint for format {f:?} is not implemented");
|
unimplemented!("Memory footprint for format {f:?} is not implemented");
|
||||||
0
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -643,7 +643,6 @@ impl<'a> BufferSlice<'a> {
|
|||||||
size: self.size,
|
size: self.size,
|
||||||
offset: self.offset,
|
offset: self.offset,
|
||||||
inner: range,
|
inner: range,
|
||||||
readable: self.buffer.usage.contains(BufferUsages::MAP_READ),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -945,7 +944,6 @@ pub struct BufferViewMut {
|
|||||||
offset: BufferAddress,
|
offset: BufferAddress,
|
||||||
size: BufferSize,
|
size: BufferSize,
|
||||||
inner: dispatch::DispatchBufferMappedRange,
|
inner: dispatch::DispatchBufferMappedRange,
|
||||||
readable: bool,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AsMut<[u8]> for BufferViewMut {
|
impl AsMut<[u8]> for BufferViewMut {
|
||||||
@ -959,10 +957,6 @@ impl Deref for BufferViewMut {
|
|||||||
type Target = [u8];
|
type Target = [u8];
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
fn deref(&self) -> &Self::Target {
|
||||||
if !self.readable {
|
|
||||||
log::warn!("Reading from a BufferViewMut is slow and not recommended.");
|
|
||||||
}
|
|
||||||
|
|
||||||
self.inner.slice()
|
self.inner.slice()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,6 @@ impl Deref for QueueWriteBufferView {
|
|||||||
type Target = [u8];
|
type Target = [u8];
|
||||||
|
|
||||||
fn deref(&self) -> &Self::Target {
|
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()
|
self.inner.slice()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,7 +116,6 @@ fn make_spirv_be_pass() {
|
|||||||
macro_rules! include_spirv {
|
macro_rules! include_spirv {
|
||||||
($($token:tt)*) => {
|
($($token:tt)*) => {
|
||||||
{
|
{
|
||||||
//log::info!("including '{}'", $($token)*);
|
|
||||||
$crate::ShaderModuleDescriptor {
|
$crate::ShaderModuleDescriptor {
|
||||||
label: Some($($token)*),
|
label: Some($($token)*),
|
||||||
source: $crate::ShaderSource::SpirV(
|
source: $crate::ShaderSource::SpirV(
|
||||||
@ -140,7 +139,6 @@ static SPIRV: crate::ShaderModuleDescriptor<'_> = include_spirv!("le-aligned.spv
|
|||||||
macro_rules! include_spirv_raw {
|
macro_rules! include_spirv_raw {
|
||||||
($($token:tt)*) => {
|
($($token:tt)*) => {
|
||||||
{
|
{
|
||||||
//log::info!("including '{}'", $($token)*);
|
|
||||||
$crate::ShaderModuleDescriptorPassthrough {
|
$crate::ShaderModuleDescriptorPassthrough {
|
||||||
label: $crate::__macro_helpers::Some($($token)*),
|
label: $crate::__macro_helpers::Some($($token)*),
|
||||||
spirv: Some($crate::__macro_helpers::Cow::Borrowed($crate::include_spirv_source!($($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 {
|
macro_rules! include_wgsl {
|
||||||
($($token:tt)*) => {
|
($($token:tt)*) => {
|
||||||
{
|
{
|
||||||
//log::info!("including '{}'", $($token)*);
|
|
||||||
$crate::ShaderModuleDescriptor {
|
$crate::ShaderModuleDescriptor {
|
||||||
label: $crate::__macro_helpers::Some($($token)*),
|
label: $crate::__macro_helpers::Some($($token)*),
|
||||||
source: $crate::ShaderSource::Wgsl($crate::__macro_helpers::Cow::Borrowed($crate::__macro_helpers::include_str!($($token)*))),
|
source: $crate::ShaderSource::Wgsl($crate::__macro_helpers::Cow::Borrowed($crate::__macro_helpers::include_str!($($token)*))),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user