godotengine / godotengine/godot

2D instance uniform with source_color flag incorrectly shows in Vulkan

Open
#102,746 2 comments 3 reactions 0 assignees View on GitHub
bug topic:2d topic:rendering
Dominant language
C++
Stars
117k
Forks
26.8k
PR merge metrics
PR metrics pending

Description

### Tested versions

- Reproducible in 4.4.beta1, 4.4.beta2, 4.4.beta3

### System information

Godot v4.4.beta2 - Arch Linux #1 SMP PREEMPT_DYNAMIC Sat, 18 Jan 2025 02:26:57 +0000 on Wayland - X11 display driver, Multi-window, 1 monitor - Vulkan (Mobile) - integrated Intel(R) Graphics (ADL GT2) - 12th Gen Intel(R) Core(TM) i5-1235U (12 threads)

### Issue description

Looks like instance uniforms with source_color hint is self multiplicated on Vulkan
OpenGL:
![Image](https://github.com/user-attachments/assets/4a0e0b4a-5749-43f3-a818-ca496c76e393)
Vulkan:
![Image](https://github.com/user-attachments/assets/893044d2-ae7c-4619-8911-b3228bb8890a)
Nor reproducible in 3D.

### Steps to reproduce

1. Create CanvasItem Shader
2. Add instance uniform with source_color hint, make shader use this color
3. Assign to any CanvasItem
4. Change instance uniform color to something not white
5. Notice difference between color preview in inspector and actual color

### Minimal reproduction project (MRP)

[mrp.zip](https://github.com/user-attachments/files/18762044/mrp.zip)

Contributor guide

Open the contributing guide

Research direction

Start by running the attached MRP with the CanvasItem shader on both Vulkan and OpenGL, following the listed reproduction steps. Trace the 2D instance uniform using the source_color hint and compare the inspector preview with the rendered result; done means the Vulkan result matches the intended color without the reported self-multiplication.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.