Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kage: if-none condition #2993

Open
11 tasks
tinne26 opened this issue May 17, 2024 · 0 comments
Open
11 tasks

Kage: if-none condition #2993

tinne26 opened this issue May 17, 2024 · 0 comments
Labels
Milestone

Comments

@tinne26
Copy link

tinne26 commented May 17, 2024

Ebitengine Version

v2.7.3

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • OpenBSD
  • Android
  • iOS
  • Nintendo Switch
  • PlayStation 5
  • Xbox
  • Web Browsers

Go Version (go version)

go1.22.2

What steps will reproduce the problem?

//kage:unit pixels
package main

func Fragment(_ vec4, sourceCoords vec2, _ vec4) vec4 {
	const Red = false
	if Red {
		return vec4(1, 0, 0, 1)
	} else {
		return imageSrc0At(sourceCoords)
	}
}

What is the expected result?

Shader compiles.

What happens instead?

Panic:

6:2: if-condition must be bool but: none

Anything else you feel useful to add?

I've seen #2797, but this is not exactly the same, and it's happening on v.2.7.3.

Notice that using a bool directly (or 0 == 0, as in the previous issue) instead of the constant does work correctly.

@tinne26 tinne26 added the bug label May 17, 2024
@hajimehoshi hajimehoshi added this to the v2.8.0 milestone May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants