Jelajahi Sumber

Fix wrong auto dimension on MacOS while generate MipMaps (#24135)

sunag 3 tahun lalu
induk
melakukan
44d2ec9681
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  1. 3 1
      examples/jsm/renderers/webgpu/WebGPUTextureUtils.js

+ 3 - 1
examples/jsm/renderers/webgpu/WebGPUTextureUtils.js

@@ -18,7 +18,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 // SOFTWARE.
 
-import { GPUIndexFormat, GPUFilterMode, GPUPrimitiveTopology, GPULoadOp, GPUStoreOp } from './constants.js';
+import { GPUTextureViewDimension, GPUIndexFormat, GPUFilterMode, GPUPrimitiveTopology, GPULoadOp, GPUStoreOp } from './constants.js';
 
 // ported from https://github.com/toji/web-texture-tool/blob/master/src/webgpu-mipmap-generator.js
 
@@ -132,6 +132,7 @@ fn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {
 		let srcView = textureGPU.createView( {
 			baseMipLevel: 0,
 			mipLevelCount: 1,
+			dimension: GPUTextureViewDimension.TwoD,
 			baseArrayLayer
 		} );
 
@@ -140,6 +141,7 @@ fn main( @location( 0 ) vTex : vec2<f32> ) -> @location( 0 ) vec4<f32> {
 			const dstView = textureGPU.createView( {
 				baseMipLevel: i,
 				mipLevelCount: 1,
+				dimension: GPUTextureViewDimension.TwoD,
 				baseArrayLayer
 			} );