[wgpu-core] use device.instance_flags when possible

This commit is contained in:
teoxoy 2024-09-05 11:20:40 +02:00 committed by Teodor Tanasoaia
parent 5c7389a068
commit d550342f47
4 changed files with 13 additions and 13 deletions

View File

@ -503,7 +503,7 @@ impl Global {
};
let hal_desc = hal::ComputePassDescriptor {
label: hal_label(base.label.as_deref(), self.instance.flags),
label: hal_label(base.label.as_deref(), device.instance_flags),
timestamp_writes,
};

View File

@ -678,9 +678,9 @@ impl Global {
}
let cmd_buf_raw = cmd_buf_data.encoder.open(&cmd_buf.device)?;
if !self
.instance
.flags
if !cmd_buf
.device
.instance_flags
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
{
unsafe {
@ -714,9 +714,9 @@ impl Global {
list.push(TraceCommand::InsertDebugMarker(label.to_string()));
}
if !self
.instance
.flags
if !cmd_buf
.device
.instance_flags
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
{
let cmd_buf_raw = cmd_buf_data.encoder.open(&cmd_buf.device)?;
@ -751,9 +751,9 @@ impl Global {
}
let cmd_buf_raw = cmd_buf_data.encoder.open(&cmd_buf.device)?;
if !self
.instance
.flags
if !cmd_buf
.device
.instance_flags
.contains(wgt::InstanceFlags::DISCARD_HAL_LABELS)
{
unsafe {

View File

@ -1567,11 +1567,11 @@ impl Global {
};
cmd_buf.unlock_encoder().map_pass_err(pass_scope)?;
let hal_label = hal_label(base.label.as_deref(), self.instance.flags);
let device = &cmd_buf.device;
let snatch_guard = &device.snatchable_lock.read();
let hal_label = hal_label(base.label.as_deref(), device.instance_flags);
let (scope, pending_discard_init_fixups) = {
let mut cmd_buf_data = cmd_buf.data.lock();
let cmd_buf_data = cmd_buf_data.as_mut().unwrap();

View File

@ -179,7 +179,7 @@ impl Global {
let clear_view_desc = hal::TextureViewDescriptor {
label: hal_label(
Some("(wgpu internal) clear surface texture view"),
self.instance.flags,
device.instance_flags,
),
format: config.format,
dimension: wgt::TextureViewDimension::D2,