hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
11.13k stars 665 forks source link

bool uniform type in kage #3165

Open DanielAdolfsson opened 2 days ago

DanielAdolfsson commented 2 days ago

Ebitengine Version

2.8.5

Operating System

Go Version (go version)

1.23.3

What steps will reproduce the problem?

Create a shader with a uniform variable of type bool

What is the expected result?

I expect it to work

What happens instead?

Crashes with panic: runtime error: slice bounds out of range [:-1]

Anything else you feel useful to add?

After checking the source, it does look like bool types are not at all implemented for uniforms. If this is a technical limitation, it should instead be added to the documentation (or maybe it is and I didn't find it).

hajimehoshi commented 2 days ago

A bool value as a uniform value is not working so far. At least, this panic should not happen (so this is actually a bug), but I think it should be easy to implement a bool uniform variable.