KhronosGroup / GLSL

GLSL Shading Language Specification and Extensions
Other
337 stars 98 forks source link

Disallow whole array operations for runtime-sized arrays? #167

Open greg-lunarg opened 3 years ago

greg-lunarg commented 3 years ago

There currently is no language in the GLSL spec disallowing whole array operations for runtime-sized arrays. For an example, see https://github.com/KhronosGroup/glslang/issues/2733.

SPIR-V virtually disallows these by disallowing an OpLoad of OpTypeRuntimearray. I presume that disallowing these in GLSL was an oversight.

Shall we proceed with creating a change to GLSL to disallow these?

greg-lunarg commented 3 years ago

@gnl21 Which working group do we need approval from?

laurie-hedge commented 3 years ago

Imagination's GLSL ES compiler rejects whole array operations that involve a runtime-sized array with a compilation error. I would be in favour of codifying this behaviour in the spec.

gnl21 commented 3 years ago

I think we primarily need approval from the GL working group, since GL implementations might have been accepting this (although we know that at least 2 weren't). It's scheduled to be discussed, so we should have an answer soon.

gnl21 commented 3 years ago

The working group agrees that this should not be allowed. I'll make a change to the GLSL spec and it will be published in the next revision.

dj2 commented 1 month ago

This seems like it's clarified in the spec now, can this be closed?