summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-11-22 11:28:29 -0800
committerGitHub <noreply@github.com>2017-11-22 11:28:29 -0800
commit56e49feea3956d66e41b819c26628c65b3c28197 (patch)
tree039be32cb8f13a5cc72175465d3a0e9a37db8ce4 /source
parent37315c96ea48045fae60f0e1cb1a3293f3ddd962 (diff)
Fix emitting of loop attributes for HLSL pass-through (#296)
Fixes #295. The code previously had a white list of attributes that it passed through, implemented in `emit.cpp` in an ad hoc fashion. The fix here is to just pass through whatever attributes the user wrote, and then let the downstream compiler diagnose if any of them are errorneous.
Diffstat (limited to 'source')
-rw-r--r--source/slang/emit.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/source/slang/emit.cpp b/source/slang/emit.cpp
index 4cad7b28d..22dcf4333 100644
--- a/source/slang/emit.cpp
+++ b/source/slang/emit.cpp
@@ -2708,18 +2708,12 @@ struct EmitVisitor
for(auto attr : decl->GetModifiersOfType<HLSLUncheckedAttribute>())
{
- if(getText(attr->getName()) == "loop")
- {
- Emit("[loop]");
- }
- else if(getText(attr->getName()) == "unroll")
- {
- Emit("[unroll]");
- }
- else if(getText(attr->getName()) == "allow_uav_condition")
- {
- Emit("[allow_uav_condition]");
- }
+ // Emit whatever attributes the user might have attached,
+ // whether or not we think they make semantic sense.
+ //
+ Emit("[");
+ emit(attr->getName());
+ Emit("]");
}
}