kong + metal test

This commit is contained in:
luboslenco
2025-04-18 09:28:41 +02:00
parent 66f2b7b324
commit ee9ec10f7b
18 changed files with 112 additions and 112 deletions
+6 -6
View File
@@ -1,16 +1,16 @@
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
#[set(everything)]
const constants: {
screen_size_inv: float2;
current_mip_level: int;
};
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
struct vert_in {
pos: float2;
}
+6 -6
View File
@@ -1,10 +1,4 @@
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
#[set(everything)]
const constants: {
screen_size_inv: float2;
@@ -12,6 +6,12 @@ const constants: {
sample_scale: float;
};
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
struct vert_in {
pos: float2;
}
+6 -6
View File
@@ -1,4 +1,10 @@
#[set(everything)]
const constants: {
vignette_strength: float;
grain_strength: float;
};
#[set(everything)]
const tex: tex2d;
@@ -11,12 +17,6 @@ const tex_sampler: sampler;
// #[set(everything)]
// const histogram_sampler: sampler;
#[set(everything)]
const constants: {
vignette_strength: float;
grain_strength: float;
};
struct vert_in {
pos: float2;
}
+17 -17
View File
@@ -1,4 +1,21 @@
#[set(everything)]
const constants: {
invVP: float4x4;
eye: float3;
envmap_data: float4; // angle, sin(angle), cos(angle), strength
envmap_num_mipmaps: int;
camera_proj: float2;
eye_look: float3;
shirr0: float4;
shirr1: float4;
shirr2: float4;
shirr3: float4;
shirr4: float4;
shirr5: float4;
shirr6: float4;
};
#[set(everything)]
const gbufferD: tex2d;
@@ -35,23 +52,6 @@ const ssaotex: tex2d;
#[set(everything)]
const ssaotex_sampler: sampler;
#[set(everything)]
const constants: {
invVP: float4x4;
eye: float3;
envmap_data: float4; // angle, sin(angle), cos(angle), strength
envmap_num_mipmaps: int;
camera_proj: float2;
eye_look: float3;
shirr0: float4;
shirr1: float4;
shirr2: float4;
shirr3: float4;
shirr4: float4;
shirr5: float4;
shirr6: float4;
};
const PI: float = 3.14159265358979;
const PI2: float = 6.28318530718;
+5 -5
View File
@@ -1,15 +1,15 @@
#[set(everything)]
const constants: {
P: float4x4;
};
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
#[set(everything)]
const constants: {
P: float4x4;
};
struct vert_in {
pos: float3;
tex: float2;
+5 -5
View File
@@ -1,15 +1,15 @@
#[set(everything)]
const constants: {
P: float4x4;
};
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
#[set(everything)]
const constants: {
P: float4x4;
};
struct vert_in {
pos: float3;
tex: float2;
+5 -5
View File
@@ -1,15 +1,15 @@
#[set(everything)]
const constants: {
params: float4;
};
#[set(everything)]
const radiance: tex2d;
#[set(everything)]
const radiance_sampler: sampler;
#[set(everything)]
const constants: {
params: float4;
};
const PI: float = 3.14159265358979;
const PI2: float = 6.28318530718;
// #ifdef METAL
+5 -5
View File
@@ -1,4 +1,9 @@
#[set(everything)]
const constants: {
dir_inv: float2;
};
#[set(everything)]
const tex: tex2d;
@@ -11,11 +16,6 @@ const gbuffer0: tex2d;
#[set(everything)]
const gbuffer0_sampler: sampler;
#[set(everything)]
const constants: {
dir_inv: float2;
};
// const blur_weights: float[] = {
// 0.132572, 0.125472, 0.106373, 0.08078, 0.05495, 0.033482, 0.018275, 0.008934, 0.003912, 0.001535
// };
+8 -8
View File
@@ -1,4 +1,12 @@
#[set(everything)]
const constants: {
invP: float4x4;
P: float4x4;
V3: float3x3;
camera_proj: float2;
};
#[set(everything)]
const gbufferD: tex2d;
@@ -11,14 +19,6 @@ const gbuffer0: tex2d;
#[set(everything)]
const gbuffer0_sampler: sampler;
#[set(everything)]
const constants: {
invP: float4x4;
P: float4x4;
V3: float3x3;
camera_proj: float2;
};
const max_steps: float = 32;
const ray_step: float = 0.001;
+5 -5
View File
@@ -1,15 +1,15 @@
#[set(everything)]
const constants: {
screen_size_inv: float2;
};
#[set(everything)]
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
#[set(everything)]
const constants: {
screen_size_inv: float2;
};
struct vert_in {
pos: float2;
}
+5 -5
View File
@@ -1,4 +1,9 @@
#[set(everything)]
const constants: {
taa_blend: float;
};
#[set(everything)]
const tex: tex2d;
@@ -11,11 +16,6 @@ const tex2: tex2d;
#[set(everything)]
const tex2_sampler: sampler;
#[set(everything)]
const constants: {
taa_blend: float;
};
struct vert_in {
pos: float2;
}
+1 -1
View File
@@ -464,7 +464,7 @@ void iron_gpu_command_list_set_vertex_constant_buffer(iron_gpu_command_list_t *l
void iron_gpu_command_list_set_fragment_constant_buffer(iron_gpu_command_list_t *list, struct iron_gpu_buffer *buffer, int offset, size_t size) {
id<MTLBuffer> buf = (__bridge id<MTLBuffer>)buffer->impl._buffer;
id<MTLRenderCommandEncoder> encoder = getMetalEncoder();
[encoder setFragmentBuffer:buf offset:offset atIndex:0];
[encoder setFragmentBuffer:buf offset:offset atIndex:1];
}
void iron_gpu_command_list_render_target_to_texture_barrier(iron_gpu_command_list_t *list, struct iron_gpu_texture *renderTarget) {
+8 -8
View File
@@ -195,14 +195,6 @@ function node_shader_get(raw: node_shader_t): string {
}
s += "}\n\n";
for (let i: i32 = 0; i < raw.textures.length; ++i) {
let a: string = raw.textures[i];
s += "#[set(everything)]\n";
s += "const " + a + ": tex2d;\n";
s += "#[set(everything)]\n";
s += "const " + a + "_sampler: sampler;\n\n";
}
if (raw.constants.length > 0) {
s += "#[set(everything)]\n";
s += "const constants: {\n";
@@ -213,6 +205,14 @@ function node_shader_get(raw: node_shader_t): string {
s += "};\n\n";
}
for (let i: i32 = 0; i < raw.textures.length; ++i) {
let a: string = raw.textures[i];
s += "#[set(everything)]\n";
s += "const " + a + ": tex2d;\n";
s += "#[set(everything)]\n";
s += "const " + a + "_sampler: sampler;\n\n";
}
for (let i: i32 = 0; i < raw.shared_samplers.length; ++i) {
let a: string = raw.shared_samplers[i];
s += "#[set(everything)]\n";