glsl: buffer variables can be readonly and writeonly
authorJuan A. Suarez Romero <jasuarez@igalia.com>
Thu, 14 Sep 2017 16:21:24 +0000 (16:21 +0000)
committerJuan A. Suarez Romero <jasuarez@igalia.com>
Tue, 19 Sep 2017 16:45:56 +0000 (18:45 +0200)
commitc408c92d2868e44ac909dff94fb374d0d5f6be9a
tree2d3358d3972478b983044c68f7901620c6db586a
parent1746671a76f7310d397347ab7c5db0b01706b5c2
glsl: buffer variables can be readonly and writeonly

In GLSL ES 3.10 session 4.9 [Memory Access Qualifiers], it has the
following description:

"A variable could be qualified as both readonly and writeonly,
disallowing both read and write, but still be passed to
imageSize() to have the size queried.".

This is for image variable, but not for buffer variables.

According to https://github.com/KhronosGroup/OpenGL-API/issues/7 Khronos
intent is to allow both readonly and writeonly in buffer variables, and
as such it will update the GLSL specification.

This commit address this issue, and fixes:

KHR-GL{43,44,45}.shader_storage_buffer_object.basic-readonly-writeonly
KHR-GLES31.core.shader_storage_buffer_object.basic-readonly-writeonly

v2: set correctly fields[i] memory flags (Samuel Pitoiset).

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/compiler/glsl/ast_to_hir.cpp