From d7280c3eb0341906a24084595b1a44aed24b3eb7 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 13 Feb 2019 14:49:02 -0500 Subject: Output readonly for suitable glsl buffers (#845) * Output readonly on buffers for glsl if resource is readonly. Didn't add to emitGLSLParameterGroup because the cases there seem to to either be implicitly read only, or allow write. * * Improve comments around use of 'readonly' on glsl output * Use readonly with shaderRecord * Add comment pointing out shader record can be rw on vk, so might require changes in the future. --- tests/cross-compile/array-of-buffers.slang.glsl | 4 ++-- tests/vkray/closesthit.slang.glsl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/cross-compile/array-of-buffers.slang.glsl b/tests/cross-compile/array-of-buffers.slang.glsl index c3f271fe6..3dfe31d8d 100644 --- a/tests/cross-compile/array-of-buffers.slang.glsl +++ b/tests/cross-compile/array-of-buffers.slang.glsl @@ -25,7 +25,7 @@ layout(std140) uniform _S2 layout(std430, binding = 2) -buffer _S3 { +readonly buffer _S3 { S_0 _data[]; } sb1_0[4]; @@ -35,7 +35,7 @@ buffer _S4 { } sb2_0[5]; layout(std430, binding = 4) -buffer _S5 +readonly buffer _S5 { uint _data[]; } bb_0[6]; diff --git a/tests/vkray/closesthit.slang.glsl b/tests/vkray/closesthit.slang.glsl index 46c5ea636..d85e982fa 100644 --- a/tests/vkray/closesthit.slang.glsl +++ b/tests/vkray/closesthit.slang.glsl @@ -21,12 +21,12 @@ struct SLANG_ParameterGroup_ShaderRecord_0 }; layout(shaderRecordNV) -buffer tmp_shaderrecord +readonly buffer tmp_shaderrecord { SLANG_ParameterGroup_ShaderRecord_0 _data; } ShaderRecord_0; -layout(std430, binding = 0) buffer tmp_colors +layout(std430, binding = 0) readonly buffer tmp_colors { vec4 _data[]; } colors_0; -- cgit v1.2.3