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

textureSize not supported in Linux build #1310

Open
Domarius opened this issue Mar 19, 2021 · 4 comments
Open

textureSize not supported in Linux build #1310

Domarius opened this issue Mar 19, 2021 · 4 comments

Comments

@Domarius
Copy link

Domarius commented Mar 19, 2021

Describe the bug
A fragment shader will fail to run in Linux (full build) if the shader uses "textureSize" anywhere in its code. The same shader will work fine in WebGL or Windows.

This is a follow up to #1308 after I worked out what was going on.

Notes from Rob:
textureSize does indeed not work on older glsl versions, see https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/textureSize.xhtml
And for Linux we default to a very early version... because Linux and its horrible graphics drivers situation.
I'll put in a warning for this, this should not silently fail.
We could actually put in a workaround for systems which do not support it directly, will think about it.

To Reproduce
Running the attached project shows 2 squares - the lefthand square uses a shader that uses "textureSize", it has 4 colours in it that change when you press the number keys. The righthand square is an image that uses the default shader, and doesn't use "textureSize".

Steps to reproduce the behavior:

  1. Download example project TextureSample.zip
  2. Run the project with F5
  3. Press keys 1,2,3,4 to change the colours on the lefthand square.
  4. Build the project for Linux (full build)
  5. Run the Linux build, and see that the coloured squares are missing.

Expected behavior
The colours should still show as they do in the F5 WebGL preview, and Windows (full build),

Screenshots
Correct output when viewed as WebGL or Windows (full build)
image
Incorrect output when viewed as Linux (full build)
image

Execution Environment:

  • Host system (where you compile your code): Windows or Linux
  • Target system (where you run your code): Windows or Linux
  • IDE used (if any): VSCode
  • Kha revision: Latest as of 15/03/2021
  • Kha build output (Using Kha...): (¯\_(ツ)_/¯) <--That is literally the version that shows up
  • Application output (if it runs):
@RobDangerous
Copy link
Member

Oh no, you are still on Kha revision ¯\(ツ)

@Domarius
Copy link
Author

Yeah that's when the vscode plugin one runs. I will try cloning Kha into the sample project.

@Sanva
Copy link
Contributor

Sanva commented Mar 19, 2021

Looks similar to #1302 — I have the same problem as you compiling your example for Linux. It works if you add --shaderversion 330 to the build command.

@XANOZOID
Copy link

XANOZOID commented Sep 8, 2021

Oh no, you are still on Kha revision ¯_(ツ)_/¯

Fixed that here: Kode/khamake#250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants