[2023-04-11T22:39:26Z ERROR wgpu::backend::direct] Handling wgpu errors as fatal by default
thread 'main' panicked at 'wgpu error: Validation Error
Caused by:
In a RenderPass
note: encoder = `<CommandBuffer-(0, 2, Vulkan)>`
In a pass parameter
note: command buffer = `<CommandBuffer-(0, 2, Vulkan)>`
resource source format (Bgra8Unorm) must match the resolve destination format (Bgra8UnormSrgb)
I have triple cheked. My code does not contain any Bgra8UnormSrgb, though it does contain 1 Bgra8Unorm of the form
device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
label: None,
layout: Some(&pipeline_layout),
vertex: VertexState {
module: &vertex_shader_module,
entry_point: "main",
buffers: &[vertex_buffer_descriptor],},
primitive: PrimitiveState {
topology: primitive_topology,
strip_index_format: None,
front_face: Default::default(),
cull_mode: None,
unclipped_depth: false,
polygon_mode: Default::default(),
conservative: false,},
depth_stencil: Some(DepthStencilState {
format: crate::window::DEPTH_FORMAT,
depth_write_enabled: true,
depth_compare: CompareFunction::Less,
stencil: StencilState {
front: wgpu::StencilFaceState::IGNORE,
back: wgpu::StencilFaceState::IGNORE,
read_mask: 0,
write_mask: 0,},
bias: Default::default(),}),
multisample: MultisampleState {
count: crate::window::SAMPLE_COUNT,
mask: !0,
alpha_to_coverage_enabled: false,},
fragment: Some(FragmentState {
module: &fragment_shader_module,
entry_point: "main",
targets: &[Some(ColorTargetState {
format: TextureFormat::Bgra8Unorm,
blend: Some(BlendState {
color: BlendComponent {
src_factor: wgpu::BlendFactor::SrcAlpha,
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
operation: wgpu::BlendOperation::Add,},
alpha: BlendComponent {
src_factor: wgpu::BlendFactor::One,
dst_factor: wgpu::BlendFactor::OneMinusSrcAlpha,
operation: wgpu::BlendOperation::Add,},}),
write_mask: wgpu::ColorWrites::ALL,})],}),
multiview: None,})}
Question:
-
Any hints on how to debug this ?
-
What is Srgb, and what is triggering this ?
Thanks!