summaryrefslogtreecommitdiffstats
path: root/tools/gfx/renderer-shared.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/gfx/renderer-shared.cpp')
-rw-r--r--tools/gfx/renderer-shared.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/tools/gfx/renderer-shared.cpp b/tools/gfx/renderer-shared.cpp
index a628cc997..2e6105793 100644
--- a/tools/gfx/renderer-shared.cpp
+++ b/tools/gfx/renderer-shared.cpp
@@ -1,5 +1,4 @@
#include "renderer-shared.h"
-#include "render-graphics-common.h"
#include "core/slang-io.h"
#include "core/slang-token-reader.h"
@@ -9,10 +8,7 @@ namespace gfx
{
const Slang::Guid GfxGUID::IID_ISlangUnknown = SLANG_UUID_ISlangUnknown;
-const Slang::Guid GfxGUID::IID_IDescriptorSetLayout = SLANG_UUID_IDescriptorSetLayout;
-const Slang::Guid GfxGUID::IID_IDescriptorSet = SLANG_UUID_IDescriptorSet;
const Slang::Guid GfxGUID::IID_IShaderProgram = SLANG_UUID_IShaderProgram;
-const Slang::Guid GfxGUID::IID_IPipelineLayout = SLANG_UUID_IPipelineLayout;
const Slang::Guid GfxGUID::IID_IInputLayout = SLANG_UUID_IInputLayout;
const Slang::Guid GfxGUID::IID_IPipelineState = SLANG_UUID_IPipelineState;
const Slang::Guid GfxGUID::IID_IResourceView = SLANG_UUID_IResourceView;
@@ -113,49 +109,6 @@ gfx::StageType mapStage(SlangStage stage)
}
}
-Result createProgramFromSlang(IDevice* device, IShaderProgram::Desc const& originalDesc, IShaderProgram** outProgram)
-{
- SlangInt targetIndex = 0;
- auto slangProgram = originalDesc.slangProgram;
-
- auto programLayout = slangProgram->getLayout(targetIndex);
- if(!programLayout)
- return SLANG_FAIL;
-
- Int entryPointCount = (Int) programLayout->getEntryPointCount();
- if(entryPointCount == 0)
- return SLANG_FAIL;
-
- List<IShaderProgram::KernelDesc> kernelDescs;
- List<ComPtr<slang::IBlob>> kernelBlobs;
- for( Int i = 0; i < entryPointCount; ++i )
- {
- ComPtr<slang::IBlob> entryPointCodeBlob;
- SLANG_RETURN_ON_FAIL(slangProgram->getEntryPointCode(i, targetIndex, entryPointCodeBlob.writeRef()));
-
- auto entryPointLayout = programLayout->getEntryPointByIndex(i);
-
- kernelBlobs.add(entryPointCodeBlob);
-
- IShaderProgram::KernelDesc kernelDesc;
- kernelDesc.codeBegin = entryPointCodeBlob->getBufferPointer();
- kernelDesc.codeEnd = (const char*) kernelDesc.codeBegin + entryPointCodeBlob->getBufferSize();
- kernelDesc.entryPointName = entryPointLayout->getName();
- kernelDesc.stage = mapStage(entryPointLayout->getStage());
-
- kernelDescs.add(kernelDesc);
- }
- SLANG_ASSERT(kernelDescs.getCount() == entryPointCount);
-
- IShaderProgram::Desc programDesc;
- programDesc.pipelineType = originalDesc.pipelineType;
- programDesc.slangProgram = slangProgram;
- programDesc.kernelCount = kernelDescs.getCount();
- programDesc.kernels = kernelDescs.getBuffer();
-
- return device->createProgram(programDesc, outProgram);
-}
-
IShaderObject* gfx::ShaderObjectBase::getInterface(const Guid& guid)
{
if (guid == GfxGUID::IID_ISlangUnknown || guid == GfxGUID::IID_IShaderObject)
@@ -243,19 +196,6 @@ void PipelineStateBase::initializeBase(const PipelineStateDesc& inDesc)
auto program = desc.getProgram();
m_program = program;
isSpecializable = (program->slangProgram && program->slangProgram->getSpecializationParamCount() != 0);
-
- switch (desc.type)
- {
- case PipelineType::Graphics:
- m_pipelineLayout = inDesc.graphics.pipelineLayout;
- break;
- case PipelineType::Compute:
- m_pipelineLayout = inDesc.compute.pipelineLayout;
- break;
- default:
- assert(!"unknown pipeline type");
- break;
- }
}
IDevice* gfx::RendererBase::getInterface(const Guid& guid)