Skip to content

Commit d69f4d7

Browse files
mvaligurskyMartin Valigursky
and
Martin Valigursky
authored
Support for unfiltrable texture in WGSL (#7655)
* Support for unfiltrable texture in WGSL * rename to make more obvious --------- Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
1 parent b818145 commit d69f4d7

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/platform/graphics/webgpu/webgpu-shader-processor-wgsl.js

+3
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ const getTextureInfo = (baseType, componentType) => {
7171
case 'u32': finalSampleType = SAMPLETYPE_UINT; break;
7272
case 'i32': finalSampleType = SAMPLETYPE_INT; break;
7373
case 'f32': finalSampleType = SAMPLETYPE_FLOAT; break;
74+
75+
// custom 'uff' type for unfilterable float, allowing us to create correct bind, which is automatically generated based on the shader
76+
case 'uff': finalSampleType = SAMPLETYPE_UNFILTERABLE_FLOAT; break;
7477
}
7578
}
7679

src/scene/immediate/immediate.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ class Immediate {
174174
`, /* wgsl */`
175175
176176
varying uv0: vec2f;
177-
var colorMap: texture_2d<f32>;
177+
var colorMap: texture_2d<uff>;
178178
@fragment fn fragmentMain(input : FragmentInput) -> FragmentOutput {
179179
var output: FragmentOutput;
180180
let uv : vec2<i32> = vec2<i32>(input.uv0 * vec2f(textureDimensions(colorMap, 0)));

0 commit comments

Comments
 (0)