Fix #143691: Out of bounds 2d painting
When doing 2D image painting the region on the GPU that is updated could be out of bounds of the texture, resulting in a crash. This PR fixes this by clamping the gpu region to update to the actual image size. Pull Request: https://projects.blender.org/blender/blender/pulls/144545
This commit is contained in:
@@ -188,6 +188,10 @@ void ScreenSpaceDrawingMode::do_partial_update(
|
||||
texture_height / BLI_rctf_size_y(&info.clipping_uv_bounds)),
|
||||
ceil((changed_overlapping_region_in_uv_space.ymax - info.clipping_uv_bounds.ymin) *
|
||||
texture_height / BLI_rctf_size_y(&info.clipping_uv_bounds)));
|
||||
gpu_texture_region_to_update.xmax = min_ii(gpu_texture_region_to_update.xmax,
|
||||
info.clipping_bounds.xmax);
|
||||
gpu_texture_region_to_update.ymax = min_ii(gpu_texture_region_to_update.ymax,
|
||||
info.clipping_bounds.ymax);
|
||||
|
||||
rcti tile_region_to_extract;
|
||||
BLI_rcti_init(
|
||||
|
||||
Reference in New Issue
Block a user