Use static samplers

This commit is contained in:
luboslenco
2025-04-19 12:29:49 +02:00
parent 639cae10e8
commit 35e52dbcb5
69 changed files with 262 additions and 1036 deletions
+3 -6
View File
@@ -2,14 +2,11 @@
#[set(everything)]
const tex0: tex2d;
#[set(everything)]
const tex0_sampler: sampler;
#[set(everything)]
const texa: tex2d;
#[set(everything)]
const texa_sampler: sampler;
const sampler_linear: sampler;
struct vert_in {
pos: float2;
@@ -29,8 +26,8 @@ fun inpaint_preview_vert(input: vert_in): vert_out {
}
fun inpaint_preview_frag(input: vert_out): float4 {
var col: float4 = sample_lod(tex0, tex0_sampler, input.tex, 0.0);
var mask: float = clamp(sample_lod(texa, texa_sampler, input.tex, 0.0).r + 0.5, 0.0, 1.0);
var col: float4 = sample_lod(tex0, sampler_linear, input.tex, 0.0);
var mask: float = clamp(sample_lod(texa, sampler_linear, input.tex, 0.0).r + 0.5, 0.0, 1.0);
return col * mask;
}
+2 -2
View File
@@ -3,7 +3,7 @@
const tex: tex2d;
#[set(everything)]
const tex_sampler: sampler;
const sampler_linear: sampler;
struct vert_in {
pos: float2;
@@ -23,7 +23,7 @@ fun layer_copy_rrrr_vert(input: vert_in): vert_out {
}
fun layer_copy_rrrr_frag(input: vert_out): float4 {
return sample_lod(tex, tex_sampler, input.tex, 0.0).rrrr;
return sample_lod(tex, sampler_linear, input.tex, 0.0).rrrr;
}
#[pipe]