|
1 | 1 | /* |
2 | | - * Copyright 2019-2024 Diligent Graphics LLC |
| 2 | + * Copyright 2019-2025 Diligent Graphics LLC |
3 | 3 | * Copyright 2015-2019 Egor Yusov |
4 | 4 | * |
5 | 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
@@ -107,9 +107,9 @@ ShaderD3D11Impl::ShaderD3D11Impl(IReferenceCounters* pRefCounters, |
107 | 107 | IsDeviceInternal, |
108 | 108 | GetD3D11ShaderModel(D3D11ShaderCI.FeatureLevel, ShaderCI.HLSLVersion), |
109 | 109 | [LoadConstantBufferReflection = ShaderCI.LoadConstantBufferReflection](const ShaderDesc& Desc, IDataBlob* pShaderByteCode) { |
110 | | - auto& Allocator = GetRawAllocator(); |
111 | | - auto* pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", ShaderResourcesD3D11, 1); |
112 | | - auto* pResources = new (pRawMem) ShaderResourcesD3D11 // |
| 110 | + IMemoryAllocator& Allocator = GetRawAllocator(); |
| 111 | + ShaderResourcesD3D11* pRawMem = ALLOCATE(Allocator, "Allocator for ShaderResources", ShaderResourcesD3D11, 1); |
| 112 | + ShaderResourcesD3D11* pResources = new (pRawMem) ShaderResourcesD3D11 // |
113 | 113 | { |
114 | 114 | pShaderByteCode, |
115 | 115 | Desc, |
@@ -156,9 +156,7 @@ ID3D11DeviceChild* ShaderD3D11Impl::GetD3D11Shader(IDataBlob* pBytecode) noexcep |
156 | 156 | return it->second; |
157 | 157 | } |
158 | 158 |
|
159 | | - VERIFY(pBytecode->GetSize() == m_pShaderByteCode->GetSize(), "The byte code size does not match the size of the original byte code"); |
160 | | - |
161 | | - auto* pd3d11Device = GetDevice()->GetD3D11Device(); |
| 159 | + ID3D11Device* pd3d11Device = GetDevice()->GetD3D11Device(); |
162 | 160 |
|
163 | 161 | CComPtr<ID3D11DeviceChild> pd3d11Shader; |
164 | 162 | switch (m_Desc.ShaderType) |
@@ -193,7 +191,7 @@ ID3D11DeviceChild* ShaderD3D11Impl::GetD3D11Shader(IDataBlob* pBytecode) noexcep |
193 | 191 |
|
194 | 192 | if (*m_Desc.Name != 0) |
195 | 193 | { |
196 | | - auto hr = pd3d11Shader->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name); |
| 194 | + HRESULT hr = pd3d11Shader->SetPrivateData(WKPDID_D3DDebugObjectName, static_cast<UINT>(strlen(m_Desc.Name)), m_Desc.Name); |
197 | 195 | DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set shader name"); |
198 | 196 | } |
199 | 197 |
|
|
0 commit comments