diff options
| author | Yong He <yonghe@outlook.com> | 2020-12-10 09:43:09 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-12-10 09:43:09 -0800 |
| commit | e4a8251749cf1fbf005b045e26e25f3ef7cccb8b (patch) | |
| tree | 209bb9617acb91c9cc1a9cc14f9aab5e92ca9871 /tools/gfx/open-gl/render-gl.cpp | |
| parent | b8e1f62fb9cc66481b35231149448e47f096d257 (diff) | |
Move ShaderObject to be under renderer interface. (#1633)
* Move ShaderObject to be under renderer interface.
* Make `create*PipelineState` take `const PipelineStateDesc&`.
* Move ShaderCursor implementation to a cpp file
Diffstat (limited to 'tools/gfx/open-gl/render-gl.cpp')
| -rw-r--r-- | tools/gfx/open-gl/render-gl.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/gfx/open-gl/render-gl.cpp b/tools/gfx/open-gl/render-gl.cpp index bf873212c..8be8165aa 100644 --- a/tools/gfx/open-gl/render-gl.cpp +++ b/tools/gfx/open-gl/render-gl.cpp @@ -5,6 +5,7 @@ //WORKING:#include "options.h" #include "../render.h" +#include "../render-graphics-common.h" #include <stdio.h> #include <stdlib.h> @@ -76,7 +77,7 @@ using namespace Slang; namespace gfx { -class GLRenderer : public Renderer +class GLRenderer : public GraphicsAPIRenderer { public: @@ -1376,8 +1377,11 @@ Result GLRenderer::createProgram(const ShaderProgram::Desc& desc, ShaderProgram* return SLANG_OK; } -Result GLRenderer::createGraphicsPipelineState(const GraphicsPipelineStateDesc& desc, PipelineState** outState) +Result GLRenderer::createGraphicsPipelineState(const GraphicsPipelineStateDesc& inDesc, PipelineState** outState) { + GraphicsPipelineStateDesc desc = inDesc; + preparePipelineDesc(desc); + auto programImpl = (ShaderProgramImpl*) desc.program; auto pipelineLayoutImpl = (PipelineLayoutImpl*) desc.pipelineLayout; auto inputLayoutImpl = (InputLayoutImpl*) desc.inputLayout; @@ -1390,8 +1394,11 @@ Result GLRenderer::createGraphicsPipelineState(const GraphicsPipelineStateDesc& return SLANG_OK; } -Result GLRenderer::createComputePipelineState(const ComputePipelineStateDesc& desc, PipelineState** outState) +Result GLRenderer::createComputePipelineState(const ComputePipelineStateDesc& inDesc, PipelineState** outState) { + ComputePipelineStateDesc desc = inDesc; + preparePipelineDesc(desc); + auto programImpl = (ShaderProgramImpl*) desc.program; auto pipelineLayoutImpl = (PipelineLayoutImpl*) desc.pipelineLayout; |
