commit | f842c206eed37d22954c33fe39b6583f14aca0fd | [log] [tgz] |
---|---|---|
author | Corentin Wallez <cwallez@chromium.org> | Fri Jun 20 09:32:44 2025 -0700 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Jun 20 09:32:44 2025 -0700 |
tree | 5156f7848cee73f9ec78ce298152ea17da1ac563 | |
parent | 63a5a6d2a7f4e6f603f1d5d13abb7be529419724 [diff] |
[dawn][opengl] Simplify GenerateCombinedSamplerInfo The GL backend needs to translate runtime combining of the textures and samplers in the shader to OpenGL's concept of combined textures and samplers. During shader compilation, reflection data from Tint is used to produce metadata related to that both for Dawn and Tint. The metadata for Tint tells the GLSL writer what to name the combined texture+sampler bindings that it generates. These names are then used to query the resulting GL uniform location and the metadata for Dawn is used to relate individual WebGPU texture or sampler bindings to a list of GL texture units they affect. GenerateCombinedSamplerInfo was very complicated as it went through multiple rewrites as surrounding code was modified. Simplify it by: - Factoring the logic ran when a new combined texture and sampler is determined. - Making the difference of handling between external texture and regular texture more clear. - Avoiding the use of the "placeholder" sampler in CombinedSampler and using an std::optional instead. - Fixed a preexisting bug in the implementation of operator < for that structure. - Make it more clear what parameters are inputs and outputs. - Removing the redundant needsPlaceholderSampler output. Also simplified the code in PipelineGL a bit since we only care about the total set of all CombinedSampler and not the per-stage sets. Bug: 411460085 Change-Id: Ic9b36aeaf8680deff5166efc66faa43090a53462 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/247035 Reviewed-by: Geoff Lang <geofflang@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: dan sinclair <dsinclair@chromium.org>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h
that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h
version that Dawn implements.webgpu.h
.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.