summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDavid Siher <32305650+dsiher@users.noreply.github.com>2022-01-27 11:53:58 -0500
committerGitHub <noreply@github.com>2022-01-27 08:53:58 -0800
commit22f0c04d2b5f8245ccaee6caee8e5adebea4aea0 (patch)
tree4ab4b2089823f0b6b915bfed479d39468d7b83ad /examples
parent10470f8796de5b4fe48a83d50cda75a4188c06e3 (diff)
Update heterogeneous-hello-world to use gfx changes + delete shader.cpp (#2085)
* Update heterogeneous-hello-world to use gfx changes + delete shader.cpp * Remove "experimental feature" tag from premake * Add placeholder executeComputation_0() to shader.cpp * Add shader.cpp to heterogeneous-hello-world files in premake * Added project "heterogeneous-first-gen" to address first time build issues * Re-add "experimental feature" tag, clean up generated file structure Co-authored-by: jsmall-nvidia <jsmall@nvidia.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/heterogeneous-hello-world/main.cpp5
-rw-r--r--examples/heterogeneous-hello-world/shader.cpp1
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/heterogeneous-hello-world/main.cpp b/examples/heterogeneous-hello-world/main.cpp
index 05d1e4787..0d8d2ca73 100644
--- a/examples/heterogeneous-hello-world/main.cpp
+++ b/examples/heterogeneous-hello-world/main.cpp
@@ -132,7 +132,6 @@ gfx::IShaderProgram* loadShaderProgram(gfx::IDevice *device, String entryPoint,
// We can create a `gfx::IShaderProgram` object from `composedProgram`
// so it may be used by the graphics layer.
gfx::IShaderProgram::Desc programDesc = {};
- programDesc.pipelineType = gfx::PipelineType::Compute;
programDesc.slangProgram = composedProgram.get();
gProgram = device->createProgram(programDesc);
@@ -158,7 +157,7 @@ gfx::IBufferResource* createStructuredBuffer(
ResourceState::CopyDestination,
ResourceState::CopySource);
bufferDesc.defaultState = ResourceState::UnorderedAccess;
- bufferDesc.cpuAccessFlags = AccessFlag::Write | AccessFlag::Read;
+ bufferDesc.memoryType = MemoryType::DeviceLocal;
SlangResult result = device->createBufferResource(bufferDesc,
(void *)initialData,
@@ -237,7 +236,7 @@ void dispatchComputation(
encoder->endEncoding();
commandBuffer->close();
gQueue->executeCommandBuffer(commandBuffer);
- gQueue->wait();
+ gQueue->waitOnHost();
}
bool printOutputValues(
diff --git a/examples/heterogeneous-hello-world/shader.cpp b/examples/heterogeneous-hello-world/shader.cpp
deleted file mode 100644
index b1fff29f6..000000000
--- a/examples/heterogeneous-hello-world/shader.cpp
+++ /dev/null
@@ -1 +0,0 @@
-// This is a placeholder. The contents will be generated during build. \ No newline at end of file