Skip to content

Commit

Permalink
Fix regionTexExtent.width
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar committed Feb 5, 2025
1 parent 5ecb3bf commit 5a2ba28
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cocos/gfx/webgl/webgl-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2772,8 +2772,8 @@ export function WebGLCmdFuncCopyBuffersToTexture (

offset.x = regionTexOffset.x === 0 ? 0 : alignTo(regionTexOffset.x, blockSizeWidth);
offset.y = regionTexOffset.y === 0 ? 0 : alignTo(regionTexOffset.y, blockSizeHeight);
extent.width = regionTexExtentWidth < blockSizeWidth ? regionTexExtent.width : alignTo(regionTexExtentWidth, blockSizeWidth);
extent.height = regionTexExtentHeight < blockSizeHeight ? regionTexExtent.width
extent.width = regionTexExtentWidth < blockSizeWidth ? regionTexExtentWidth : alignTo(regionTexExtentWidth, blockSizeWidth);
extent.height = regionTexExtentHeight < blockSizeHeight ? regionTexExtentWidth
: alignTo(regionTexExtentHeight, blockSizeHeight);
stride.width = region.buffStride > 0 ? region.buffStride : extent.width;
stride.height = region.buffTexHeight > 0 ? region.buffTexHeight : extent.height;
Expand Down
2 changes: 1 addition & 1 deletion cocos/gfx/webgl2/webgl2-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2884,7 +2884,7 @@ export function WebGL2CmdFuncCopyBuffersToTexture (
offset.y = regionTexOffset.y === 0 ? 0 : alignTo(regionTexOffset.y, blockSizeHeight);
extent.width = regionTexExtentWidth < blockSizeWidth ? regionTexExtentWidth : alignTo(regionTexExtentWidth, blockSizeWidth);
extent.height = regionTexExtentHeight < blockSizeHeight ? regionTexExtentWidth
: alignTo(regionTexExtent.height, blockSizeHeight);
: alignTo(regionTexExtentHeight, blockSizeHeight);
extent.depth = 1;
stride.width = regionBuffStride > 0 ? regionBuffStride : extent.width;
stride.height = region.buffTexHeight > 0 ? region.buffTexHeight : extent.height;
Expand Down

0 comments on commit 5a2ba28

Please sign in to comment.