diff --git a/.pick_status.json b/.pick_status.json index c445212ce59..7be595fa659 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -14,7 +14,7 @@ "description": "rusticl/memory: fix clFillImage for buffer images", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/frontends/rusticl/core/memory.rs b/src/gallium/frontends/rusticl/core/memory.rs index 94f27318997..4dda18de3b2 100644 --- a/src/gallium/frontends/rusticl/core/memory.rs +++ b/src/gallium/frontends/rusticl/core/memory.rs @@ -1309,11 +1309,8 @@ impl Image { // make sure we allocate multiples of 4 bytes so drivers don't read out of bounds or // unaligned. // TODO: use div_ceil once it's available - let pixel_size = align( - self.image_format.pixel_size().unwrap().into(), - size_of::(), - ); - let mut new_pattern: Vec = vec![0; pixel_size / size_of::()]; + let pixel_size = self.image_format.pixel_size().unwrap().into(); + let mut new_pattern: Vec = vec![0; div_round_up(pixel_size, size_of::())]; // we don't support CL_DEPTH for now assert!(pattern.len() == 4); diff --git a/src/gallium/frontends/rusticl/mesa/pipe/context.rs b/src/gallium/frontends/rusticl/mesa/pipe/context.rs index 29f15905ca7..bc9781b3a2a 100644 --- a/src/gallium/frontends/rusticl/mesa/pipe/context.rs +++ b/src/gallium/frontends/rusticl/mesa/pipe/context.rs @@ -143,9 +143,6 @@ impl PipeContext { .map(|i| ((origin[i] + [0, y, z][i]) * pitch[i]) as u32) .sum(); - // SAFETY: clear_buffer arguments are specified - // in bytes, so pattern.len() dimension value - // should be multiplied by pixel_size unsafe { self.pipe.as_ref().clear_buffer.unwrap()( self.pipe.as_ptr(), @@ -153,7 +150,7 @@ impl PipeContext { offset, (region[0] * pixel_size) as u32, pattern.as_ptr().cast(), - (pattern.len() * pixel_size) as i32, + pixel_size as i32, ) }; }