let open_pass handle hal label mapping

This commit is contained in:
teoxoy authored and Teodor Tanasoaia committed 2024-12-20 15:44:15 +01:00
1 parent 38e09d02cc
commit 062999658a
3 files changed
+14 -18

No files matched your search

+4 -2
View File
@@ -37,8 +37,8 @@ use crate::ray_tracing::{BlasAction, TlasAction};
use crate::resource::{Fallible, InvalidResourceError, Labeled, ParentDevice as _, QuerySet};
use crate::storage::Storage;
use crate::track::{DeviceTracker, Tracker, UsageScope};
use crate::LabelHelpers;
use crate::{api_log, global::Global, id, resource_log, Label};
use crate::{hal_label, LabelHelpers};
use thiserror::Error;
@@ -377,10 +377,12 @@ impl CommandEncoder {
/// The underlying hal encoder is put in the "recording" state.
pub(crate) fn open_pass(
&mut self,
hal_label: Option<&str>,
label: Option<&str>,
device: &Device,
) -> Result<(), DeviceError> {
self.is_open = true;
let hal_label = hal_label(label, device.instance_flags);
unsafe { self.raw.begin_encoding(hal_label) }.map_err(|e| device.handle_hal_error(e))?;
Ok(())
+2 -4
View File
@@ -1651,8 +1651,6 @@ impl Global {
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) = {
device.check_is_valid().map_pass_err(pass_scope)?;
@@ -1667,12 +1665,12 @@ impl Global {
// we need to make sure to close the previous one.
encoder.close(&cmd_buf.device).map_pass_err(pass_scope)?;
encoder
.open_pass(hal_label, &cmd_buf.device)
.open_pass(base.label.as_deref(), &cmd_buf.device)
.map_pass_err(pass_scope)?;
let info = RenderPassInfo::start(
device,
hal_label,
hal_label(base.label.as_deref(), device.instance_flags),
pass.color_attachments.take(),
pass.depth_stencil_attachment.take(),
pass.timestamp_writes.take(),
+8 -12
View File
@@ -11,7 +11,6 @@ use crate::{
device::{DeviceError, WaitIdleError},
get_lowest_common_denom,
global::Global,
hal_label,
id::{self, QueueId},
init_tracker::{has_copy_partial_init_tracker_coverage, TextureInitRange},
lock::{rank, Mutex, MutexGuard, RwLockWriteGuard},
@@ -1165,10 +1164,10 @@ impl Queue {
};
// execute resource transitions
if let Err(e) = baked.encoder.open_pass(
hal_label(Some("(wgpu internal) Transit"), self.device.instance_flags),
&self.device,
) {
if let Err(e) = baked
.encoder
.open_pass(Some("(wgpu internal) Transit"), &self.device)
{
break 'error Err(e.into());
}
@@ -1203,13 +1202,10 @@ impl Queue {
// Note: we could technically do it after all of the command buffers,
// but here we have a command encoder by hand, so it's easier to use it.
if !used_surface_textures.is_empty() {
if let Err(e) = baked.encoder.open_pass(
hal_label(
Some("(wgpu internal) Present"),
self.device.instance_flags,
),
&self.device,
) {
if let Err(e) = baked
.encoder
.open_pass(Some("(wgpu internal) Present"), &self.device)
{
break 'error Err(e.into());
}
let texture_barriers = trackers