Support sharing Pipeline state between TextAtlas (#95)

* Support sharing `Pipeline` state between `TextAtlas`

* Keep using `Vec` for pipeline cache

* Use `OnceCell` to keep `Pipeline` private

* Revert "Use `OnceCell` to keep `Pipeline` private"

This reverts commit 4112732b1734a3bb6b915d2103e699ef549b77c1.

* Rename `Pipeline` type to `Cache`
This commit is contained in:
Héctor Ramón 2024-05-08 15:39:19 +02:00 committed by GitHub
parent 670140e2a1
commit 5aed9e1477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 295 additions and 237 deletions

View file

@ -21,17 +21,17 @@ struct Params {
};
@group(0) @binding(0)
var<uniform> params: Params;
@group(1) @binding(0)
var color_atlas_texture: texture_2d<f32>;
@group(1) @binding(1)
@group(0) @binding(1)
var mask_atlas_texture: texture_2d<f32>;
@group(1) @binding(2)
@group(0) @binding(2)
var atlas_sampler: sampler;
@group(1) @binding(0)
var<uniform> params: Params;
fn srgb_to_linear(c: f32) -> f32 {
if c <= 0.04045 {
return c / 12.92;