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

Implemented global const array to shaders #32751

Merged
merged 1 commit into from
Jun 19, 2020

Conversation

Chaosus
Copy link
Member

@Chaosus Chaosus commented Oct 11, 2019

This PR allowed const array to be declared outside of function.

image

As usual, when this will be merged I've add that to Vulkan too.

@clayjohn
Copy link
Member

clayjohn commented Oct 11, 2019

Have you tested this on GLES2 devices that only support up to GL 2.1 or GL ES 2.0? I don't think constant arrays are possible in GLES2 devices.

Edit: I just looked at the GL ES 2.0 GLSL spec and it says that it is implementation dependant. It does not require that constant array initialization be allowed. But implementers can allow it if they want.

I ran into troubles with it in my GLES2 Glow PR as it caused certain low end devices to fail to compile the shaders.

@Chaosus
Copy link
Member Author

Chaosus commented Oct 12, 2019

Yeah :( It may not be supported on all devices... I want to hear a @reduz decision about this.

@reduz
Copy link
Member

reduz commented Oct 28, 2019

We may only allow it for static indexing on GLES2, but thats more work on the compiler on our side to validate..

@akien-mga akien-mga modified the milestones: 3.2, 4.0 Oct 28, 2019
@Chaosus
Copy link
Member Author

Chaosus commented Nov 2, 2019

I've removed it from GLES2 backend and added a check to prevent its usage on that platform...

@Chaosus Chaosus force-pushed the shader_const_array branch 2 times, most recently from 485231f to 889268e Compare December 31, 2019 21:42
@Chaosus Chaosus changed the title Implemented global const array to shaders [WIP] Implemented global const array to shaders Dec 31, 2019
@Chaosus
Copy link
Member Author

Chaosus commented Dec 31, 2019

Note: I rebase it again when Vulkan will be merged to the master

@Chaosus Chaosus changed the title [WIP] Implemented global const array to shaders Implemented global const array to shaders Feb 6, 2020
@aaronfranke
Copy link
Member

Vulkan has been merged into master, this can be rebased now.

@Chaosus
Copy link
Member Author

Chaosus commented Apr 1, 2020

Rebased again...

@Chaosus Chaosus force-pushed the shader_const_array branch 2 times, most recently from 682620e to cf59861 Compare April 3, 2020 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants