GLSL icon indicating copy to clipboard operation
GLSL copied to clipboard

Disallow whole array operations for runtime-sized arrays?

Open greg-lunarg opened this issue 3 years ago • 5 comments

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 avatar Aug 30 '21 20:08 greg-lunarg

@gnl21 Which working group do we need approval from?

greg-lunarg avatar Aug 30 '21 20:08 greg-lunarg

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.

laurie-hedge avatar Sep 01 '21 11:09 laurie-hedge

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 avatar Sep 01 '21 11:09 gnl21

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.

gnl21 avatar Sep 01 '21 15:09 gnl21