diff options
author | Jeroen Bakker <jeroen@blender.org> | 2022-09-28 14:04:18 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2022-09-28 14:04:18 +0300 |
commit | 854d3d4645ed2ab6475ce399c39189df29ba0a0d (patch) | |
tree | 169bbb9a2b3d9ae6cffb2d2eed4c7734815fa533 /source/blender/gpu/shaders | |
parent | 26dc50ac3414a54b13150b8d31ab08bcd71a72a3 (diff) |
Painting first pixels to intermediate buffer.
Diffstat (limited to 'source/blender/gpu/shaders')
-rw-r--r-- | source/blender/gpu/shaders/sculpt_paint/infos/sculpt_paint_image_info.hh | 3 | ||||
-rw-r--r-- | source/blender/gpu/shaders/sculpt_paint/sculpt_paint_image_comp.glsl | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/gpu/shaders/sculpt_paint/infos/sculpt_paint_image_info.hh b/source/blender/gpu/shaders/sculpt_paint/infos/sculpt_paint_image_info.hh index bc1f3b4ebf0..344533d7e8e 100644 --- a/source/blender/gpu/shaders/sculpt_paint/infos/sculpt_paint_image_info.hh +++ b/source/blender/gpu/shaders/sculpt_paint/infos/sculpt_paint_image_info.hh @@ -9,9 +9,10 @@ GPU_SHADER_CREATE_INFO(sculpt_paint_image_compute) .local_group_size(1, 1, 1) + .image(0, GPU_RGBA32F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "out_img") .storage_buf(0, Qualifier::READ, "PackedPixelRow", "pixel_row_buf[]") .storage_buf(1, Qualifier::READ, "TrianglePaintInput", "paint_input[]") - .image(0, GPU_RGBA32F, Qualifier::READ_WRITE, ImageType::FLOAT_2D, "out_img") + .push_constant(Type::INT, "pixel_row_offset") .compute_source("sculpt_paint_image_comp.glsl") .typedef_source("GPU_sculpt_shader_shared.h") .do_static_compilation(true); diff --git a/source/blender/gpu/shaders/sculpt_paint/sculpt_paint_image_comp.glsl b/source/blender/gpu/shaders/sculpt_paint/sculpt_paint_image_comp.glsl index 9954967c87e..c353c08067f 100644 --- a/source/blender/gpu/shaders/sculpt_paint/sculpt_paint_image_comp.glsl +++ b/source/blender/gpu/shaders/sculpt_paint/sculpt_paint_image_comp.glsl @@ -1,6 +1,6 @@ void main() { - PackedPixelRow row = pixel_row_buf[gl_GlobalInvocationID.x]; + PackedPixelRow row = pixel_row_buf[gl_GlobalInvocationID.x + pixel_row_offset]; ivec2 image_coord = PIXEL_ROW_START_IMAGE_COORD(row); uint row_len = PIXEL_ROW_LEN(row); |