Fix #128827: GPv3: Bucket fill doesn't work on macOS

The issue was that the shader `gpu_shader_gpencil_stroke_vert_no_geom.glsl`
assumed a wrong format of the color attribute (`uchar4`  instead of `float4`).

The fix uses `vertex_fetch_attribute` with `float4`.

Pull Request: https://projects.blender.org/blender/blender/pulls/129072
This commit is contained in:
Falk David
2024-10-16 10:29:07 +02:00
committed by Falk David
parent ceea1a4d99
commit 30adc33730

View File

@@ -220,9 +220,8 @@ void main(void)
for (int i = 0; i < 4; i++) {
finalPos[i] = ModelViewProjectionMatrix *
vec4(vertex_fetch_attribute(input_prim_id + i, pos, vec3).xyz, 1.0);
/* Color attribute uses GPU_FETCH_INT_TO_FLOAT_UNIT with GPU_COMP_U8. */
finalColor[i] = uchar4_to_normalized_vec4(
vertex_fetch_attribute(input_prim_id + i, color, uchar4));
/* Attribute is expected to be in the float4 format. */
finalColor[i] = vertex_fetch_attribute(input_prim_id + i, color, float4);
float in_thickness = vertex_fetch_attribute(input_prim_id + i, thickness, float);
if (gpencil_stroke_data.keep_size) {