diff options
author | Benjamin Otte <otte@redhat.com> | 2017-10-18 05:37:53 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2017-10-30 02:58:03 +0100 |
commit | caaf1845c3d712b485f4c734d083393cab6487b8 (patch) | |
tree | 17200519fc7eacd5a875c65063af914c58dc7d72 | |
parent | 031a1812b8f96d716f35ff27c71caf9a0202d711 (diff) | |
download | gtk+-caaf1845c3d712b485f4c734d083393cab6487b8.tar.gz |
gsksl: Allow an optional access qualifier of -1
Use this to mark optional access qualifiers as "do not write". For now
this is a good enough way to not write out access qualifiers, which is
disallowed in GLSL shaders.
-rw-r--r-- | gsk/gskspvwritergeneratedprivate.h | 3 | ||||
-rw-r--r-- | gsk/spirv.js | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/gsk/gskspvwritergeneratedprivate.h b/gsk/gskspvwritergeneratedprivate.h index 469ba56265..bad2caee21 100644 --- a/gsk/gskspvwritergeneratedprivate.h +++ b/gsk/gskspvwritergeneratedprivate.h @@ -411,7 +411,8 @@ gsk_spv_writer_type_image (GskSpvWriter *writer, g_array_append_val (bytes, ms); g_array_append_val (bytes, sampled); g_array_append_val (bytes, (guint32) { image_format }); - g_array_append_val (bytes, (guint32) { opt_access_qualifier }); + if (opt_access_qualifier != -1) + g_array_append_val (bytes, (guint32) { opt_access_qualifier }); g_array_index (bytes, guint32, start_index) = (bytes->len - start_index) << 16 | GSK_SPV_OP_TYPE_IMAGE; return result_id; diff --git a/gsk/spirv.js b/gsk/spirv.js index acef648eef..a6eb89bcfa 100644 --- a/gsk/spirv.js +++ b/gsk/spirv.js @@ -475,6 +475,8 @@ for (let kind in spirv.operand_kinds) append_one: "g_array_append_val ({0}, (guint32) { {1} })" }; if (kind.category == "BitEnum") Operands[kind.kind].optional_unset = "0"; + if (kind.kind == "AccessQualifier") + Operands[kind.kind].optional_unset = "-1"; } } |