summaryrefslogtreecommitdiffstats
path: root/examples/hello/hello.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-20 08:11:27 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-20 11:54:35 -0700
commit327f2b7ec50a7480b458d6d3ba8e2ca7fcdb8498 (patch)
treee62d8f184bf04df0906fcc6c8a04803febe35376 /examples/hello/hello.cpp
parent40617db15d87ece6e7cc88da23f747f8f827c69a (diff)
Overhaul handling of entry points and translation units.
The main user-visible change here is that instead of `spAddTranslationUnitEntryPoint` we have `spAddEntryPoint`, to reflect that the list of entry points is "global" to a compile request. As a result, `spGetEntryPointSource` now only needs the entry point index, and not the translation unit index. There are a bunch more behind-the-scenes changes, though, reflecting a streamlining of the concepts related to compilation into a smaller number of classes. Now there is: - `Session` (unchanged) to manage the lifetimes of shared stuff like the stdlib - `CompileRequest` (merges in `CompileOptions`) to handle all the lifetime related to a single invocation of the compiler - `TranslationUnitRequest` (merges `TranslationUnitOptions`, `CompileUnit`) to represent a single translation unit ("module") that the user is trying to compile. This is a single file for HLSL/GLSL, but can be multiple files for Slang. - `EntryPointRequest` (merges `EntryPointOption` and a bit of `EntryPointResult`) to track a single entry point that the user is asking to compile (that entry point always comes from a single translation unit) A lot of functions used to take some combination of these and end up with really long signatures. I've given most of the objects "parent" pointers so that they can get back to all the context they need, so most functions don't need as many parameters. It may eventually be important to tease these apart again, in particular: - The code-generation side of things (the `*Result` types) might need to be pulled out in case we want to codegen multiple times from the same AST - Similarly, the layout stuff may also need to be pulled out, in case we want to lay things out multiple times with different rules.
Diffstat (limited to 'examples/hello/hello.cpp')
-rw-r--r--examples/hello/hello.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/hello/hello.cpp b/examples/hello/hello.cpp
index c9121b790..8e48b3c13 100644
--- a/examples/hello/hello.cpp
+++ b/examples/hello/hello.cpp
@@ -100,8 +100,8 @@ HRESULT initialize( ID3D11Device* dxDevice )
char const* vertexProfileName = "vs_4_0";
char const* fragmentProfileName = "ps_4_0";
- spAddTranslationUnitEntryPoint(slangRequest, translationUnitIndex, vertexEntryPointName, spFindProfile(slangSession, vertexProfileName));
- spAddTranslationUnitEntryPoint(slangRequest, translationUnitIndex, fragmentEntryPointName, spFindProfile(slangSession, fragmentProfileName));
+ spAddEntryPoint(slangRequest, translationUnitIndex, vertexEntryPointName, spFindProfile(slangSession, vertexProfileName));
+ spAddEntryPoint(slangRequest, translationUnitIndex, fragmentEntryPointName, spFindProfile(slangSession, fragmentProfileName));
int compileErr = spCompile(slangRequest);
if(auto diagnostics = spGetDiagnosticOutput(slangRequest))