Просмотр исходного кода

WebGPURenderer: Fix `flipY` and cache key when `generateMipmap` (#32922)

sunag 3 недель назад
Родитель
Сommit
d887959ff0

+ 2 - 2
src/renderers/webgpu/utils/WebGPUTexturePassUtils.js

@@ -49,7 +49,7 @@ fn mainVS(
 
 	let p = pos[ vertexIndex ];
 	let mult = select( vec2f( 0.5, -0.5 ), vec2f( 0.5, 0.5 ), flipY != 0 );
-	Varys.vTex = p * vec2f( 0.5, -0.5 ) + vec2f( 0.5 );
+	Varys.vTex = p * mult + vec2f( 0.5 );
 	Varys.Position = vec4f( p, 0, 1 );
 	Varys.vBaseArrayLayer = instanceIndex;
 
@@ -182,7 +182,7 @@ fn main_cube( Varys: VarysStruct ) -> @location( 0 ) vec4<f32> {
 				layout: 'auto'
 			} );
 
-			this.transferPipelines[ format ] = pipeline;
+			this.transferPipelines[ key ] = pipeline;
 
 		}
 

+ 2 - 4
src/renderers/webgpu/utils/WebGPUTextureUtils.js

@@ -822,13 +822,11 @@ class WebGPUTextureUtils {
 	 *
 	 * @private
 	 * @param {GPUTexture} textureGPU - The GPU texture object.
-	 * @param {Object} textureDescriptorGPU - The texture descriptor.
-	 * @param {number} [baseArrayLayer=0] - The index of the first array layer accessible to the texture view.
 	 * @param {?GPUCommandEncoder} [encoder=null] - An optional command encoder used to generate mipmaps.
 	 */
-	_generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer = 0, encoder = null ) {
+	_generateMipmaps( textureGPU, encoder = null ) {
 
-		this._getPassUtils().generateMipmaps( textureGPU, textureDescriptorGPU, baseArrayLayer, encoder );
+		this._getPassUtils().generateMipmaps( textureGPU, encoder );
 
 	}
 

粤ICP备19079148号