mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Add the first basic version of the GPU blend node (#1243)
* Implement Gpu Blend node * Remove duplicate shader input * Fix formatting --------- Co-authored-by: Dennis Kobert <dennis@kobert.dev>
This commit is contained in:
committed by
Keavon Chambers
parent
9da83d3280
commit
57415b948b
@@ -17,7 +17,7 @@ pub fn compile_spirv(request: &CompileRequest, compile_dir: Option<&str>, manife
|
||||
|
||||
println!("calling cargo run!");
|
||||
let non_cargo_env_vars = std::env::vars().filter(|(k, _)| k.starts_with("PATH")).collect::<Vec<_>>();
|
||||
let mut cargo_command = std::process::Command::new("/usr/bin/cargo")
|
||||
let mut cargo_command = std::process::Command::new("cargo")
|
||||
.arg("run")
|
||||
.arg("--release")
|
||||
.arg("--manifest-path")
|
||||
|
||||
@@ -71,7 +71,7 @@ pub fn construct_argument(input: &ShaderInput<()>, position: u32, binding_offset
|
||||
let line = match input {
|
||||
ShaderInput::Constant(constant) => format!("#[spirv({})] i{}: {}", constant_attribute(constant), position, constant.ty()),
|
||||
ShaderInput::UniformBuffer(_, ty) => {
|
||||
format!("#[spirv(uniform, descriptor_set = 0, binding = {})] i{}: &[{}]", position + binding_offset, position, ty,)
|
||||
format!("#[spirv(uniform, descriptor_set = 0, binding = {})] i{}: &{}", position + binding_offset, position, ty,)
|
||||
}
|
||||
ShaderInput::StorageBuffer(_, ty) | ShaderInput::ReadBackBuffer(_, ty) => {
|
||||
format!("#[spirv(storage_buffer, descriptor_set = 0, binding = {})] i{}: &[{}]", position + binding_offset, position, ty,)
|
||||
|
||||
@@ -8,7 +8,8 @@ extern crate spirv_std;
|
||||
//pub mod gpu {
|
||||
//use super::*;
|
||||
use spirv_std::spirv;
|
||||
use spirv_std::glam::UVec3;
|
||||
use spirv_std::glam;
|
||||
use spirv_std::glam::{UVec3, Vec2, Mat2, BVec2};
|
||||
|
||||
#[allow(unused)]
|
||||
#[spirv(compute(threads({{compute_threads}})))]
|
||||
@@ -19,6 +20,8 @@ extern crate spirv_std;
|
||||
{% endfor %}
|
||||
) {
|
||||
use graphene_core::Node;
|
||||
use graphene_core::raster::adjustments::{BlendMode, BlendNode};
|
||||
use graphene_core::Color;
|
||||
|
||||
/*
|
||||
{% for input in input_nodes %}
|
||||
@@ -34,7 +37,7 @@ extern crate spirv_std;
|
||||
|
||||
{% for output in output_nodes %}
|
||||
let v = {{output}}.eval(());
|
||||
o{{loop.index0}}[_global_index.x as usize] = v;
|
||||
o{{loop.index0}}[(_global_index.y * i0 + _global_index.x) as usize] = v;
|
||||
{% endfor %}
|
||||
// TODO: Write output to buffer
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user