summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-07-18 15:13:44 -0700
committerTim Foley <tfoley@nvidia.com>2017-07-18 15:13:44 -0700
commitb2b46a9ced9dad18b41df0361cb91b0afb1ea710 (patch)
tree9974dd9409754233d1d665b41fe363d4283aee80 /source
parent2476c035ec15d3ee22239ebd1fe10e6e8c1e01e3 (diff)
Add basic GLSL lowering buffer `Buffer` loads
- This isn't going to work for writable buffers, and certainly not for writes - As it exists right now, this shows a flaw in how I'm handling texture-type results on fetches
Diffstat (limited to 'source')
-rw-r--r--source/slang/slang-stdlib.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/slang/slang-stdlib.cpp b/source/slang/slang-stdlib.cpp
index b26fc8a8e..8aa0d0e4c 100644
--- a/source/slang/slang-stdlib.cpp
+++ b/source/slang/slang-stdlib.cpp
@@ -2024,9 +2024,12 @@ namespace Slang
sb << "__intrinsic void GetDimensions(out uint dim);\n";
+ sb << "__intrinsic(glsl, \"texelFetch($P, $0)\")\n";
sb << "__intrinsic T Load(int location);\n";
+
sb << "__intrinsic T Load(int location, out uint status);\n";
+ sb << "__intrinsic(glsl, \"texelFetch($P, int($0))\")\n";
sb << "__intrinsic __subscript(uint index) -> T";
if (kBaseBufferAccessLevels[aa].access != SLANG_RESOURCE_ACCESS_READ)