Skip to content

Commit 033e954

Browse files
ShaderD3D11: removed byte code size check
The size may change after patching
1 parent b3ca717 commit 033e954

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Graphics/GraphicsEngineD3D11/src/ShaderD3D11Impl.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2019-2024 Diligent Graphics LLC
2+
* Copyright 2019-2025 Diligent Graphics LLC
33
* Copyright 2015-2019 Egor Yusov
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -107,9 +107,9 @@ ShaderD3D11Impl::ShaderD3D11Impl(IReferenceCounters* pRefCounters,
107107
IsDeviceInternal,
108108
GetD3D11ShaderModel(D3D11ShaderCI.FeatureLevel, ShaderCI.HLSLVersion),
109109
[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 //
113113
{
114114
pShaderByteCode,
115115
Desc,
@@ -156,9 +156,7 @@ ID3D11DeviceChild* ShaderD3D11Impl::GetD3D11Shader(IDataBlob* pBytecode) noexcep
156156
return it->second;
157157
}
158158

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();
162160

163161
CComPtr<ID3D11DeviceChild> pd3d11Shader;
164162
switch (m_Desc.ShaderType)
@@ -193,7 +191,7 @@ ID3D11DeviceChild* ShaderD3D11Impl::GetD3D11Shader(IDataBlob* pBytecode) noexcep
193191

194192
if (*m_Desc.Name != 0)
195193
{
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);
197195
DEV_CHECK_ERR(SUCCEEDED(hr), "Failed to set shader name");
198196
}
199197

0 commit comments

Comments
 (0)