Address pr review

This commit is contained in:
Dennis Kobert
2026-08-02 14:31:13 +00:00
parent 8686b2c891
commit e372f78b7e
5 changed files with 15 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ fn execute_to_final(executor: &DynamicExecutor, render_config: RenderConfig) ->
GPoll::Final(value) => Ok(value),
GPoll::Fallback(boxed) => {
let (value, error) = *boxed;
log::error!("Node graph evaluation reported an error alongside its fallback output: {error:?}");
log::warn!("Node graph evaluation reported an error alongside its fallback output: {error:?}");
Ok(value)
}
GPoll::Partial(_) | GPoll::Pending => Err("Node graph evaluation did not complete".into()),

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));

View File

@@ -231,9 +231,9 @@ impl PerPixelAdjustCodegen<'_> {
description: "".to_string(),
widget_override: Default::default(),
ty: ParsedFieldType::Regular(RegularParsedField {
ty: parse_quote!(std::sync::Arc<WgpuExecutor>),
ty: parse_quote!(#wgpu_executor::WgpuExecutorHandle),
exposed: true,
value_source: ParsedValueSource::Scope(Box::new(parse_quote!("graphene_std::platform_application_io::WgpuExecutorArcNode"))),
value_source: ParsedValueSource::Scope(Box::new(parse_quote!("graphene_std::platform_application_io::WgpuExecutorNode"))),
number_soft_min: None,
number_soft_max: None,
number_hard_min: None,

View File

@@ -24,6 +24,15 @@ pub fn validate_node_fn(parsed: &ParsedNodeFn) -> syn::Result<()> {
fn validate_async_source(parsed: &ParsedNodeFn) {
let snapshot_ctx = matches!(&parsed.input.ty, Type::Path(path) if path.path.segments.last().is_some_and(|segment| segment.ident == "CtxSnapshot"));
let future_kernel = crate::codegen::is_source_kernel(&parsed.output_type);
if let Some(placeholder) = &parsed.attributes.placeholder
&& !parsed.is_async
&& !future_kernel
{
emit_error!(
placeholder.span(),
"`placeholder` applies only to async and source kernels; a synchronous node never reports `Partial`, so the stand-in is unused"
);
}
if parsed.is_async && future_kernel {
emit_error!(
parsed.output_type.span(),