1033: Missing label queries r=kvark a=scoopr

I missed few bits needed for labeling the resources in the errors.

Co-authored-by: Mikko Lehtonen <scoopr@iki.fi>
This commit is contained in:
bors[bot] 2020-11-19 22:25:04 +00:00 committed by GitHub
commit 9d35aea08e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 46 additions and 2 deletions

View File

@ -119,7 +119,7 @@ pub enum DispatchError {
/// Error encountered when performing a compute pass.
#[derive(Clone, Debug, Error)]
pub(super) enum ComputePassErrorInner {
pub enum ComputePassErrorInner {
#[error(transparent)]
Encoder(#[from] CommandEncoderError),
#[error("bind group {0:?} is invalid")]

View File

@ -318,7 +318,7 @@ impl State {
/// Error encountered when performing a render pass.
#[derive(Clone, Debug, Error)]
pub(super) enum RenderPassErrorInner {
pub enum RenderPassErrorInner {
#[error(transparent)]
Encoder(#[from] CommandEncoderError),
#[error("attachment texture view {0:?} is invalid")]

View File

@ -1616,6 +1616,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn texture_view_label<B: GfxBackend>(&self, id: id::TextureViewId) -> String {
B::hub(self).texture_views.label_for_resource(id)
}
pub fn texture_view_error<B: GfxBackend>(
&self,
id_in: Input<G, id::TextureViewId>,
@ -1775,6 +1779,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn sampler_label<B: GfxBackend>(&self, id: id::SamplerId) -> String {
B::hub(self).samplers.label_for_resource(id)
}
pub fn sampler_error<B: GfxBackend>(
&self,
id_in: Input<G, id::SamplerId>,
@ -1868,6 +1876,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn bind_group_layout_label<B: GfxBackend>(&self, id: id::BindGroupLayoutId) -> String {
B::hub(self).bind_group_layouts.label_for_resource(id)
}
pub fn bind_group_layout_error<B: GfxBackend>(
&self,
id_in: Input<G, id::BindGroupLayoutId>,
@ -1941,6 +1953,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn pipeline_layout_label<B: GfxBackend>(&self, id: id::PipelineLayoutId) -> String {
B::hub(self).pipeline_layouts.label_for_resource(id)
}
pub fn pipeline_layout_error<B: GfxBackend>(
&self,
id_in: Input<G, id::PipelineLayoutId>,
@ -2450,6 +2466,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn bind_group_label<B: GfxBackend>(&self, id: id::BindGroupId) -> String {
B::hub(self).bind_groups.label_for_resource(id)
}
pub fn bind_group_error<B: GfxBackend>(
&self,
id_in: Input<G, id::BindGroupId>,
@ -2591,6 +2611,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn shader_module_label<B: GfxBackend>(&self, id: id::ShaderModuleId) -> String {
B::hub(self).shader_modules.label_for_resource(id)
}
pub fn shader_module_error<B: GfxBackend>(
&self,
id_in: Input<G, id::ShaderModuleId>,
@ -2679,6 +2703,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
.register_error(id_in, "", &mut Token::root())
}
pub fn command_buffer_label<B: GfxBackend>(&self, id: id::CommandBufferId) -> String {
B::hub(self).command_buffers.label_for_resource(id)
}
pub fn command_buffer_error<B: GfxBackend>(
&self,
id_in: Input<G, id::CommandBufferId>,
@ -2721,6 +2749,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
encoder.map(|encoder| Box::into_raw(Box::new(encoder)))
}
pub fn render_bundle_label<B: GfxBackend>(&self, id: id::RenderBundleId) -> String {
B::hub(self).render_bundles.label_for_resource(id)
}
pub fn render_bundle_error<B: GfxBackend>(
&self,
id_in: Input<G, id::RenderBundleId>,
@ -3238,6 +3270,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn render_pipeline_label<B: GfxBackend>(&self, id: id::RenderPipelineId) -> String {
B::hub(self).render_pipelines.label_for_resource(id)
}
pub fn render_pipeline_error<B: GfxBackend>(
&self,
id_in: Input<G, id::RenderPipelineId>,
@ -3461,6 +3497,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(id.0)
}
pub fn compute_pipeline_label<B: GfxBackend>(&self, id: id::ComputePipelineId) -> String {
B::hub(self).compute_pipelines.label_for_resource(id)
}
pub fn compute_pipeline_error<B: GfxBackend>(
&self,
id_in: Input<G, id::ComputePipelineId>,
@ -3723,6 +3763,10 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
Ok(())
}
pub fn device_label<B: GfxBackend>(&self, id: id::DeviceId) -> String {
B::hub(self).devices.label_for_resource(id)
}
pub fn device_error<B: GfxBackend>(&self, id_in: Input<G, id::DeviceId>) -> id::DeviceId {
B::hub(self)
.devices