Why is { load: LoadOp::Load, store: StoreOp::Discard }
treated as read_only: false
?
#4956
Unanswered
LukasKalbertodt
asked this question in
Q&A
Replies: 1 comment 3 replies
-
It's perfectly valid to do Load -> Discard and still write to the attachment. An example could be a depth buffer that you used in a previous pass, will do rendering against, but then don't need again. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Setting the following in my
RenderPassDescriptor::depth_stencil_attachment
:Results in an error because I also want to read from the same texture in my shader. I dug a bit into the code and I think it comes down to this:
wgpu/wgpu/src/backend/direct.rs
Lines 419 to 448 in e26a853
It makes sense to me that
LoadOp::Clear
as well asStoreOp::Store
would both write to the texture. But the aboveOperations
seemsread_only: true
to me, so why is it treated asread_only: false
?I can make this work simply by setting
depth_ops: None
. But I only came up with this after reading the above code. So I'm curious.Beta Was this translation helpful? Give feedback.
All reactions