@@ -951,15 +951,27 @@ impl GpuProcessor {
951951 let dummy_lut_view = dummy_lut_texture. create_view ( & Default :: default ( ) ) ;
952952 let dummy_lut_sampler = device. create_sampler ( & wgpu:: SamplerDescriptor :: default ( ) ) ;
953953
954- let max_tile_size = wgpu:: Extent3d {
954+ const TILE_SIZE : u32 = 2048 ;
955+ const TILE_OVERLAP : u32 = 128 ;
956+
957+ let clamped_tile_width = max_width. min ( TILE_SIZE + TILE_OVERLAP * 2 ) ;
958+ let clamped_tile_height = max_height. min ( TILE_SIZE + TILE_OVERLAP * 2 ) ;
959+
960+ let clamped_tile_size = wgpu:: Extent3d {
961+ width : clamped_tile_width,
962+ height : clamped_tile_height,
963+ depth_or_array_layers : 1 ,
964+ } ;
965+
966+ let full_image_size = wgpu:: Extent3d {
955967 width : max_width,
956968 height : max_height,
957969 depth_or_array_layers : 1 ,
958970 } ;
959971
960972 let reusable_texture_desc = wgpu:: TextureDescriptor {
961973 label : None ,
962- size : max_tile_size ,
974+ size : clamped_tile_size ,
963975 mip_level_count : 1 ,
964976 sample_count : 1 ,
965977 dimension : wgpu:: TextureDimension :: D2 ,
@@ -1000,7 +1012,7 @@ impl GpuProcessor {
10001012
10011013 let tile_output_texture = device. create_texture ( & wgpu:: TextureDescriptor {
10021014 label : Some ( "Tile Output Texture" ) ,
1003- size : max_tile_size ,
1015+ size : clamped_tile_size ,
10041016 mip_level_count : 1 ,
10051017 sample_count : 1 ,
10061018 dimension : wgpu:: TextureDimension :: D2 ,
@@ -1014,7 +1026,7 @@ impl GpuProcessor {
10141026
10151027 let working_texture = device. create_texture ( & wgpu:: TextureDescriptor {
10161028 label : Some ( "Working Output Texture" ) ,
1017- size : max_tile_size ,
1029+ size : full_image_size ,
10181030 mip_level_count : 1 ,
10191031 sample_count : 1 ,
10201032 dimension : wgpu:: TextureDimension :: D2 ,
@@ -1029,7 +1041,7 @@ impl GpuProcessor {
10291041
10301042 let output_texture = device. create_texture ( & wgpu:: TextureDescriptor {
10311043 label : Some ( "Full Output Texture" ) ,
1032- size : max_tile_size ,
1044+ size : full_image_size ,
10331045 mip_level_count : 1 ,
10341046 sample_count : 1 ,
10351047 dimension : wgpu:: TextureDimension :: D2 ,
0 commit comments