diff options
| author | Yong He <yonghe@outlook.com> | 2022-01-14 13:08:46 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-01-14 13:08:46 -0800 |
| commit | b2f4cb118ef15cbf522be0335e4084ac6db57672 (patch) | |
| tree | 37c2d6c3519ef7fc3d60142a4a31cbe16708e0bc /tools/gfx/d3d11/render-d3d11.cpp | |
| parent | d3f904cbfa1568366bc8c8d231a57a03d47ddc98 (diff) | |
Various fixes to GFX, nested parameter block test for d3d12. (#2081)
* Various fixes.
* Add nested parameter block test.
* Remove slang-llvm licence info
* Ingore slang-llvm/ directory.
* Fixup.
Co-authored-by: Yong He <yhe@nvidia.com>
Diffstat (limited to 'tools/gfx/d3d11/render-d3d11.cpp')
| -rw-r--r-- | tools/gfx/d3d11/render-d3d11.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/gfx/d3d11/render-d3d11.cpp b/tools/gfx/d3d11/render-d3d11.cpp index 530b67055..2e3963c30 100644 --- a/tools/gfx/d3d11/render-d3d11.cpp +++ b/tools/gfx/d3d11/render-d3d11.cpp @@ -113,8 +113,10 @@ public: override; virtual void bindRootShaderObject(IShaderObject* shaderObject) override; - virtual SLANG_NO_THROW Result SLANG_MCALL - createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram) override; + virtual SLANG_NO_THROW Result SLANG_MCALL createProgram( + const IShaderProgram::Desc& desc, + IShaderProgram** outProgram, + ISlangBlob** outDiagnosticBlob) override; virtual SLANG_NO_THROW Result SLANG_MCALL createGraphicsPipelineState( const GraphicsPipelineStateDesc& desc, IPipelineState** outState) override; virtual SLANG_NO_THROW Result SLANG_MCALL createComputePipelineState( @@ -3114,7 +3116,7 @@ Result D3D11Device::createInputLayout(IInputLayout::Desc const& desc, IInputLayo auto inputElementCount = desc.inputElementCount; auto inputElementsIn = desc.inputElements; - for (UInt ii = 0; ii < inputElementCount; ++ii) + for (Int ii = 0; ii < inputElementCount; ++ii) { auto vertexStreamIndex = inputElementsIn[ii].bufferSlotIndex; auto& vertexStream = desc.vertexStreams[vertexStreamIndex]; @@ -3122,11 +3124,11 @@ Result D3D11Device::createInputLayout(IInputLayout::Desc const& desc, IInputLayo inputElements[ii].SemanticName = inputElementsIn[ii].semanticName; inputElements[ii].SemanticIndex = (UINT)inputElementsIn[ii].semanticIndex; inputElements[ii].Format = D3DUtil::getMapFormat(inputElementsIn[ii].format); - inputElements[ii].InputSlot = vertexStreamIndex; + inputElements[ii].InputSlot = (UINT)vertexStreamIndex; inputElements[ii].AlignedByteOffset = (UINT)inputElementsIn[ii].offset; inputElements[ii].InputSlotClass = (vertexStream.slotClass == InputSlotClass::PerInstance) ? D3D11_INPUT_PER_INSTANCE_DATA : D3D11_INPUT_PER_VERTEX_DATA; - inputElements[ii].InstanceDataStepRate = vertexStream.instanceDataStepRate; + inputElements[ii].InstanceDataStepRate = (UINT)vertexStream.instanceDataStepRate; if (ii != 0) { @@ -3478,7 +3480,8 @@ void D3D11Device::drawIndexedInstanced( startInstanceLocation); } -Result D3D11Device::createProgram(const IShaderProgram::Desc& desc, IShaderProgram** outProgram) +Result D3D11Device::createProgram( + const IShaderProgram::Desc& desc, IShaderProgram** outProgram, ISlangBlob** outDiagnosticBlob) { SLANG_ASSERT(desc.slangProgram); @@ -3520,6 +3523,8 @@ Result D3D11Device::createProgram(const IShaderProgram::Desc& desc, IShaderProgr compileResult == SLANG_OK ? DebugMessageType::Warning : DebugMessageType::Error, DebugMessageSource::Slang, (char*)diagnostics->getBufferPointer()); + if (outDiagnosticBlob) + returnComPtr(outDiagnosticBlob, diagnostics); } SLANG_RETURN_ON_FAIL(compileResult); |
