|
|
@@ -93,26 +93,6 @@ class WebGPUBindingUtils {
|
|
|
|
|
|
bindingGPU.buffer = buffer;
|
|
|
|
|
|
- } else if ( binding.isSampler ) {
|
|
|
-
|
|
|
- const sampler = {}; // GPUSamplerBindingLayout
|
|
|
-
|
|
|
- if ( binding.texture.isDepthTexture ) {
|
|
|
-
|
|
|
- if ( binding.texture.compareFunction !== null ) {
|
|
|
-
|
|
|
- sampler.type = GPUSamplerBindingType.Comparison;
|
|
|
-
|
|
|
- } else if ( backend.compatibilityMode ) {
|
|
|
-
|
|
|
- sampler.type = GPUSamplerBindingType.NonFiltering;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- bindingGPU.sampler = sampler;
|
|
|
-
|
|
|
} else if ( binding.isSampledTexture && binding.store ) {
|
|
|
|
|
|
const storageTexture = {}; // GPUStorageTextureBindingLayout
|
|
|
@@ -220,6 +200,26 @@ class WebGPUBindingUtils {
|
|
|
|
|
|
bindingGPU.texture = texture;
|
|
|
|
|
|
+ } else if ( binding.isSampler ) {
|
|
|
+
|
|
|
+ const sampler = {}; // GPUSamplerBindingLayout
|
|
|
+
|
|
|
+ if ( binding.texture.isDepthTexture ) {
|
|
|
+
|
|
|
+ if ( binding.texture.compareFunction !== null ) {
|
|
|
+
|
|
|
+ sampler.type = GPUSamplerBindingType.Comparison;
|
|
|
+
|
|
|
+ } else if ( backend.compatibilityMode ) {
|
|
|
+
|
|
|
+ sampler.type = GPUSamplerBindingType.NonFiltering;
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ bindingGPU.sampler = sampler;
|
|
|
+
|
|
|
} else {
|
|
|
|
|
|
console.error( `WebGPUBindingUtils: Unsupported binding "${ binding }".` );
|
|
|
@@ -401,12 +401,6 @@ class WebGPUBindingUtils {
|
|
|
|
|
|
entriesGPU.push( { binding: bindingPoint, resource: { buffer: bindingData.buffer } } );
|
|
|
|
|
|
- } else if ( binding.isSampler ) {
|
|
|
-
|
|
|
- const textureGPU = backend.get( binding.texture );
|
|
|
-
|
|
|
- entriesGPU.push( { binding: bindingPoint, resource: textureGPU.sampler } );
|
|
|
-
|
|
|
} else if ( binding.isSampledTexture ) {
|
|
|
|
|
|
const textureData = backend.get( binding.texture );
|
|
|
@@ -464,6 +458,12 @@ class WebGPUBindingUtils {
|
|
|
|
|
|
entriesGPU.push( { binding: bindingPoint, resource: resourceGPU } );
|
|
|
|
|
|
+ } else if ( binding.isSampler ) {
|
|
|
+
|
|
|
+ const textureGPU = backend.get( binding.texture );
|
|
|
+
|
|
|
+ entriesGPU.push( { binding: bindingPoint, resource: textureGPU.sampler } );
|
|
|
+
|
|
|
}
|
|
|
|
|
|
bindingPoint ++;
|