summaryrefslogtreecommitdiff
path: root/examples/hello/README.md
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2018-06-28 11:14:48 -0700
committerGitHub <noreply@github.com>2018-06-28 11:14:48 -0700
commitdfe13b54286b27dd15f591455bbb86b7798285c2 (patch)
tree4a11f01feaae059b6c11bdfbe12a614228af6dd5 /examples/hello/README.md
parent22033f06573f900dc030c487b2c30feddf3d8f16 (diff)
Share graphics API layer between tests/examples (#603)
The `render-test` project has an in-progress graphics API abstraction layer, and it makes sense to share this code with our examples rather than write a bunch of redundant code between examples and tests. Most of this change is just moving files from `tools/render-test/*` to a new library project at `tools/slang-graphics/`. The most complicated code change there is renaming from `render_test` to `slang_graphics`. The existing `hello` example was ported to use the graphics API layer instead of raw D3D11 API calls. It is still hard-coded to use the D3D11 back-end and the `SLANG_DXBC` target, so more work is needed if we want to actually support multiple APIs in the examples. I also went ahead and implemented an extremely rudimentary set of APIs to abstract over the Windows platform calls that were being made in the example, so that we could potentially run that same example on other platforms. I did *not* port `render-test` to use those APIs, and I also did not implement them for anything but Windows (my assumption is that for most other platforms we would just use SDL2, and require people to ensure it is installed to their machine before building Slang examples).
Diffstat (limited to 'examples/hello/README.md')
-rw-r--r--examples/hello/README.md9
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/hello/README.md b/examples/hello/README.md
index a571bb274..31a983428 100644
--- a/examples/hello/README.md
+++ b/examples/hello/README.md
@@ -1,9 +1,12 @@
Slang "Hello World" Example
===========================
-The goal of this example is to demonstrate an almost minimal application that uses Slang for shading, and D3D11 for rendering.
+The goal of this example is to demonstrate an almost minimal application that uses Slang for shading.
+
+The `hello.slang` file contains simple vertex and fragment shader entry points. The shader code should compile as either Slang or HLSL code (that is, this example does not show off any new Slang language features).
-The `hello.slang` file contains simple vertex and fragment shader entry points.
The `hello.cpp` file contains the C++ application code, showing how to use the Slang C API to load and compile the shader code to DirectX shader bytecode (DXBC).
+The application perform rendering using the D3D11 API, through a platform and graphics API abstraction layer that is implemented in `tools/slang-graphics`.
+Note that this abstraction layer is *not* required in order to work with Slang, and it is just there to help us write example applications more conveniently.
-Note that this example is not intended to demonstrate good practices for integrating Slang into a production engine; the goal is merely to use the minimum amount of code possible to demonstrate a complete applicaiton that uses Slang.
+This example is not necessarily representative of best practices for integrating Slang into a production engine; the goal is merely to use the minimum amount of code possible to demonstrate a complete applicaiton that uses Slang.