summaryrefslogtreecommitdiffstats
path: root/docs/user-guide
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2023-10-13 13:49:02 -0700
committerGitHub <noreply@github.com>2023-10-13 13:49:02 -0700
commitd4b8edf79ad6d139bc0de2f1fa9a34f00317f763 (patch)
tree4bcf970fcd4800e2ab4a0618be98202e663f4972 /docs/user-guide
parentedf90f5f2efce86830a6ddfbe4c6250d7aca93d5 (diff)
Update a1-04-interop.md
Diffstat (limited to 'docs/user-guide')
-rw-r--r--docs/user-guide/a1-04-interop.md9
1 files changed, 7 insertions, 2 deletions
diff --git a/docs/user-guide/a1-04-interop.md b/docs/user-guide/a1-04-interop.md
index fea73d074..1d86009ab 100644
--- a/docs/user-guide/a1-04-interop.md
+++ b/docs/user-guide/a1-04-interop.md
@@ -59,7 +59,7 @@ struct CppString
}
}
```
-When compiling the above code to C++, the `CppString` struct will not be emitted as a C++ struct. Instead, all uses of `CppString` will be emitted as use a `std::string`.
+When compiling the above code to C++, the `CppString` struct will not be emitted as a C++ struct. Instead, all uses of `CppString` will be emitted as `std::string`.
## Injecting Preludes
@@ -124,11 +124,16 @@ uint2 getRealtimeClock()
OpExtension "SPV_KHR_shader_clock";
result : $$uint2 = OpReadClockKHR Device
};
+ default:
+ return uint2(0, 0);
}
}
```
This definition causes `getRealtimeClock()` to translate to a call to NVAPI when targeting HLSL, to `clockRealtime2x32EXT()` when targeting
-GLSL, and to the `OpReadClockKHR` instruction when compiling directly to SPIRV through the inline SPIRV assembly block.
+GLSL, and to the `OpReadClockKHR` instruction when compiling directly to SPIRV through the inline SPIRV assembly block. The `default` case is
+used for target not specified in the `__target_switch` statement.
+
+Currently, the following target names are supported in a `case` statement: `cpp`, `cuda`, `glsl`, `hlsl`, and `spirv`.
## Inline SPIRV Assembly