Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGPURenderer: cache renderPassDesciptors and associated views. #27518

Merged
merged 4 commits into from
Jan 8, 2024

Conversation

aardgoose
Copy link
Contributor

For the default null renderTarget cache descriptor, depth texture view and msaa texture view where appropriate.
For non null targets, use the renderTarget as a key for caching renderPassDescriptors to reduce per pass object creation .

The default descriptor members could be reused in the clear() method.

@mrdoob mrdoob added this to the r161 milestone Jan 7, 2024
@sunag
Copy link
Collaborator

sunag commented Jan 7, 2024

Some examples is warn the message bellow like webgpu_compute_particles_rain, webgpu_compute_particles_snow:

Both stencilLoadOp (LoadOp::Clear) and stencilStoreOp (StoreOp::Store) must not be set if the attachment ([TextureView]) has no stencil aspect or stencilReadOnly (0) is true.
 - While validating depthStencilAttachment.
 - While encoding [CommandEncoder "renderContext_2"].BeginRenderPass([RenderPassDescriptor]).

@aardgoose
Copy link
Contributor Author

I'll have a look

@aardgoose
Copy link
Contributor Author

Renderer now sets correct depth and stencil values for renderContext objects, and depth / depth+stencil objects created as required.

@sunag sunag merged commit aea1821 into mrdoob:dev Jan 8, 2024
11 checks passed
@aardgoose aardgoose deleted the cache-desc branch January 12, 2024 14:13
AdaRoseCannon pushed a commit to AdaRoseCannon/three.js that referenced this pull request Jan 15, 2024
…oob#27518)

* cache descriptors

* check sample count for msaa targets

* add missing ;

* set renderContext depth/stencil state correctly

---------

Co-authored-by: aardgoose <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants