From b059de80b7619e4406dbddf26fd7f2fb7ce6a965 Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Thu, 14 Feb 2019 08:27:46 -0500 Subject: * Add cross compile test (#849) * Add intrinsic for StructuredBuffer.Load --- source/slang/hlsl.meta.slang | 1 + source/slang/hlsl.meta.slang.h | 1 + source/slang/parser.cpp | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/slang/hlsl.meta.slang b/source/slang/hlsl.meta.slang index 4831e6ce2..fc02395d4 100644 --- a/source/slang/hlsl.meta.slang +++ b/source/slang/hlsl.meta.slang @@ -52,6 +52,7 @@ struct StructuredBuffer out uint numStructs, out uint stride); + __target_intrinsic(glsl, "$0._data[$1]") T Load(int location); T Load(int location, out uint status); diff --git a/source/slang/hlsl.meta.slang.h b/source/slang/hlsl.meta.slang.h index ef1a6d273..1dcf55f2a 100644 --- a/source/slang/hlsl.meta.slang.h +++ b/source/slang/hlsl.meta.slang.h @@ -61,6 +61,7 @@ SLANG_RAW(" void GetDimensions(\n") SLANG_RAW(" out uint numStructs,\n") SLANG_RAW(" out uint stride);\n") SLANG_RAW("\n") +SLANG_RAW(" __target_intrinsic(glsl, \"$0._data[$1]\") \n") SLANG_RAW(" T Load(int location);\n") SLANG_RAW(" T Load(int location, out uint status);\n") SLANG_RAW("\n") diff --git a/source/slang/parser.cpp b/source/slang/parser.cpp index 38a28745a..e2085eb7d 100644 --- a/source/slang/parser.cpp +++ b/source/slang/parser.cpp @@ -4520,7 +4520,7 @@ namespace Slang // __intrinsic_op() // // Finally, we can leave off the specification, so that the - // op name will be derived fromthe function name: + // op name will be derived from the function name: // // __intrinsic_op // -- cgit v1.2.3