summaryrefslogtreecommitdiffstats
path: root/examples/ray-tracing/main.cpp
diff options
context:
space:
mode:
authorYong He <yonghe@outlook.com>2021-12-09 10:46:41 -0800
committerGitHub <noreply@github.com>2021-12-09 10:46:41 -0800
commit1c99a986ae12a3f1ce4cee86191052183d37208a (patch)
treee9903d1e569badef813e3f5f33696683bd34f3b0 /examples/ray-tracing/main.cpp
parent4ca37fea2829ad9c623b94d77bb0311f76ad0971 (diff)
Remove `PipelineType` from gfx header. (#2051)
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'examples/ray-tracing/main.cpp')
-rw-r--r--examples/ray-tracing/main.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/examples/ray-tracing/main.cpp b/examples/ray-tracing/main.cpp
index 2d947e567..1285be866 100644
--- a/examples/ray-tracing/main.cpp
+++ b/examples/ray-tracing/main.cpp
@@ -155,9 +155,7 @@ void diagnoseIfNeeded(slang::IBlob* diagnosticsBlob)
// Load and compile shader code from souce.
gfx::Result loadShaderProgram(
- gfx::IDevice* device,
- gfx::PipelineType pipelineType,
- gfx::IShaderProgram** outProgram)
+ gfx::IDevice* device, bool isComputePipeline, gfx::IShaderProgram** outProgram)
{
ComPtr<slang::ISession> slangSession;
slangSession = device->getSlangSession();
@@ -170,7 +168,7 @@ gfx::Result loadShaderProgram(
Slang::List<slang::IComponentType*> componentTypes;
componentTypes.add(module);
- if (pipelineType == PipelineType::Compute)
+ if (isComputePipeline)
{
ComPtr<slang::IEntryPoint> computeEntryPoint;
SLANG_RETURN_ON_FAIL(module->findEntryPointByName("computeMain", computeEntryPoint.writeRef()));
@@ -195,7 +193,6 @@ gfx::Result loadShaderProgram(
SLANG_RETURN_ON_FAIL(result);
gfx::IShaderProgram::Desc programDesc = {};
- programDesc.pipelineType = pipelineType;
programDesc.slangProgram = linkedProgram;
SLANG_RETURN_ON_FAIL(device->createProgram(programDesc, outProgram));
@@ -504,7 +501,7 @@ Slang::Result initialize()
return SLANG_FAIL;
ComPtr<IShaderProgram> shaderProgram;
- SLANG_RETURN_ON_FAIL(loadShaderProgram(gDevice, PipelineType::Graphics, shaderProgram.writeRef()));
+ SLANG_RETURN_ON_FAIL(loadShaderProgram(gDevice, false, shaderProgram.writeRef()));
GraphicsPipelineStateDesc desc;
desc.inputLayout = inputLayout;
desc.program = shaderProgram;
@@ -514,8 +511,7 @@ Slang::Result initialize()
return SLANG_FAIL;
ComPtr<IShaderProgram> computeProgram;
- SLANG_RETURN_ON_FAIL(
- loadShaderProgram(gDevice, PipelineType::Compute, computeProgram.writeRef()));
+ SLANG_RETURN_ON_FAIL(loadShaderProgram(gDevice, true, computeProgram.writeRef()));
ComputePipelineStateDesc computeDesc;
computeDesc.program = computeProgram;
gRenderPipelineState = gDevice->createComputePipelineState(computeDesc);