Address pr review

This commit is contained in:
Dennis Kobert
2026-08-02 14:31:13 +00:00
parent 11c9ffa301
commit 479c2d2141
5 changed files with 15 additions and 6 deletions

View File

@@ -367,7 +367,7 @@ pub fn simplify_identifier_name(ty: &str) -> String {
/// Converts a Rust-internal type name to its user-facing form.
pub fn make_type_user_readable(ty: &str) -> String {
let ty = ty
.replace("Option<Arc<OwnedContextImpl>>", "Context")
.replace("ContextImpl", "Context")
.replace("Raster<CPU>", "Raster")
.replace("Raster<GPU>", "Raster")
.replace("DAffine2", "Transform")

View File

@@ -5,7 +5,7 @@ use core_types::shaders::buffer_struct::BufferStruct;
use raster_types::{GPU, Raster};
use std::borrow::Cow;
use std::collections::HashMap;
use std::sync::Mutex;
use std::sync::{Mutex, PoisonError};
use wgpu::util::{BufferInitDescriptor, DeviceExt};
use wgpu::{
BindGroupDescriptor, BindGroupEntry, BindGroupLayoutDescriptor, BindGroupLayoutEntry, BindingResource, BindingType, Buffer, BufferBinding, BufferBindingType, BufferUsages, ColorTargetState, Face,
@@ -34,7 +34,7 @@ impl PerPixelAdjustShaderRuntime {
impl ShaderRuntime {
pub fn run_per_pixel_adjust<T: BufferStruct>(&self, shaders: &Shaders<'_>, textures: List<Raster<GPU>>, args: Option<&T>) -> List<Raster<GPU>> {
let mut cache = self.per_pixel_adjust.pipeline_cache.lock().unwrap();
let mut cache = self.per_pixel_adjust.pipeline_cache.lock().unwrap_or_else(PoisonError::into_inner);
let pipeline = cache
.entry(shaders.fragment_shader_name.to_owned())
.or_insert_with(|| PerPixelAdjustGraphicsPipeline::new(&self.context, shaders));