Repository: godotengine/godot (language: cpp)

Issue:
Accessing `TEXTURE_PIXEL_SIZE` in a light() function leads to shader compilation errors
### Tested versions

- Reproducible in Godot 4.4-stable.
- Reproducible in Godot 4.4-rc1.
- Reproducible in Godot 4.4-dev3.
- Not reproducible in Godot 4.3-stable.
- Not reproducible in Godot 4.4-dev1.
- Not reproducible in Godot 4.4-dev2.

Bisection result: a657ea42f1e656695f502a0e5f50ea9e0e041c3e is the first bad commit.

### System information

Godot v4.4.stable (cc10aa775) - Arch Linux #1 SMP PREEMPT_DYNAMIC Thu, 27 Feb 2025 18:09:44 +0000 on Wayland - Wayland display driver, Single-window, 2 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU - 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz (16 threads)

### Issue description

After opening our project in Godot 4.4, I noticed shader errors printed connected to our light shader code. I narrowed it down to using `TEXTURE_PIXEL_SIZE` in a light() function within a canvas item shader. Related shaders also stopped working.

[godot.log](https://github.com/user-attachments/files/19078527/godot.log)

### Steps to reproduce

Attach this shader to a canvas item node:
```shader
shader_type canvas_item;

void light() {
	vec2 something = TEXTURE_PIXEL_SIZE;
}

```

### Minimal reproduction project (MRP)

[reproduction.zip](https://github.com/user-attachments/files/19078540/reproduction.zip)


Discussion / hints:
Bisection result: a657ea42f1e656695f502a0e5f50ea9e0e041c3e is the first bad commit.

Fix patch:
diff --git a/servers/rendering/renderer_rd/shaders/canvas.glsl b/servers/rendering/renderer_rd/shaders/canvas.glsl
index 48420e06c9bf..e2d9086a5de5 100644
--- a/servers/rendering/renderer_rd/shaders/canvas.glsl
+++ b/servers/rendering/renderer_rd/shaders/canvas.glsl
@@ -306,6 +306,7 @@ vec4 light_compute(
 		vec2 screen_uv,
 		vec2 uv,
 		vec4 color, bool is_directional) {
+	const InstanceData draw_data = instances.data[instance_index];
 	vec4 light = vec4(0.0);
 	vec3 light_direction = vec3(0.0);
 


Test patch: