gpu-error: webgpu · apple metal-3 · macOS

Closed
#1

gpu-error — GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (1) does not match the sample count of the other attachments (4).

  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_11"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_11"].

Renderer WebGPU · apple metal-3 · 3600×2086 @2x · r180
Render incidents 4 (gpu-error)
Build cd7520e-dirty · Origin http://localhost:3125 · Map Pegasus Bridge · Phase Battle · Turn 1

Incidents so far:

  • +21.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (1) does not match the sample count of the other attachments (4).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_11"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_11"].
  • +21.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_11"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_11"]])
  • +21.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (1) does not match the sample count of the other attachments (4).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_11"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_11"].
  • +21.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_11"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_11"]])

Console, last lines:

  • warn: [voice] utterance failed: not-allowed
  • warn: THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.
  • warn: THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.

Diagnostics attached as wtt-render-report.json (game state included).

#2

gpu-error — GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).

  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].

Renderer WebGPU · apple metal-3 · 1800×1043 @2x · r180
Render incidents 40 (gpu-error)
Build cd7520e-dirty · Origin http://localhost:3125 · Map Pegasus Bridge · Phase Battle · Turn 1

Incidents so far:

  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.0s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.0s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])
  • +25.1s gpu-error: GPUValidationError: The depth stencil attachment [TextureView of Texture "depthBuffer"] sample count (4) does not match the sample count of the other attachments (1).
  • While validating depthStencilAttachment.
  • While encoding [CommandEncoder "renderContext_1"].BeginRenderPass([RenderPassDescriptor]).
  • While finishing [CommandEncoder "renderContext_1"].
  • +25.1s gpu-error: GPUValidationError: [Invalid CommandBuffer from CommandEncoder "renderContext_1"] is invalid due to a previous error.
  • While calling [Queue].Submit([[Invalid CommandBuffer from CommandEncoder "renderContext_1"]])

Console, last lines:

  • warn: THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.
  • warn: THREE.TSL: Return statement used in an inline 'Fn()'. Define a layout struct to allow return values.

Diagnostics attached as wtt-render-report.json (game state included).

Staff #3

Fixed and committed as 85f5a76. Reload http://localhost:3125 and the MSAA switch should now work both ways.

What went wrong. three's WebGPU backend keeps one depth buffer for the canvas pass and caches it by size and format only, so when the frame dropped to 1 sample the depth buffer stayed at 4 and every frame failed validation, exactly the error you saw. My earlier check missed it because a hidden tab never presents, so the canvas pass's attachments are never validated there.

The fix. When MSAA changes, the renderer now destroys that cached depth texture along with the frame buffer target, and the next frame rebuilds both at the new sample count. Verified by reading the depth texture's sample count back after each switch: 4 when on, 1 when off, 4 again, with zero GPU errors through on, off, on, a render scale change and back to Auto.

This thread is closed. Replies and edits are frozen — start a new thread if there is more to say.