Skip to content

Commit

Permalink
Fix narrow/wide type comparison in loop condition
Browse files Browse the repository at this point in the history
  • Loading branch information
vdwtanner committed May 1, 2024
1 parent 5861d8c commit 248c889
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/InputLayout.inl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace D3D11On12
UINT NumParameters = pVS->m_IOSemantics.m_InputSignature.GetParameters(&pParameters);

// Find each input element's semantic by matching registers
for (UINT i = 0; i < m_APIElements.size(); ++i)
for (size_t i = 0; i < m_APIElements.size(); ++i)
{
UINT Register = m_Registers[i];
auto iter = std::find_if(pParameters, pParameters + NumParameters,
Expand Down
4 changes: 2 additions & 2 deletions src/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -804,12 +804,12 @@ namespace D3D11On12
GetBatchedContext().RenameAndMapBuffer(m_spInterfaceBuffers[eShaderType].get(), &Data);

UINT* pDataUINTs = reinterpret_cast<UINT*>(Data.pData);
for (UINT i = 0; i < m_InterfaceInstances[eShaderType].size(); ++i)
for (size_t i = 0; i < m_InterfaceInstances[eShaderType].size(); ++i)
{
*pDataUINTs = m_InterfaceInstances[eShaderType][i];
pDataUINTs += 4; // Legacy CB alignment issues
}
for (UINT i = 0; i < m_InterfacePointerData[eShaderType].size(); ++i)
for (size_t i = 0; i < m_InterfacePointerData[eShaderType].size(); ++i)
{
pDataUINTs[0] = m_InterfacePointerData[eShaderType][i].uCBID;
pDataUINTs[1] = m_InterfacePointerData[eShaderType][i].uCBOffset;
Expand Down
2 changes: 1 addition & 1 deletion src/shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace D3D11On12
// API and DDI decls might be different sizes, because the DDI only allows gaps 4 components at a time
// Walk the DDI decls, and increment the API decl when: 1. We have a non-gap, or
// 2. When we've consumed all the DDI decls related to an API gap
UINT CurrentAPIDecl = 0, CurrentDDIDecl = 0;
size_t CurrentAPIDecl = 0, CurrentDDIDecl = 0;
UINT CurrentGapOffset = 0;
for (; CurrentAPIDecl < m_APISODecls.size() && CurrentDDIDecl < m_DDISODecls.size(); ++CurrentDDIDecl)
{
Expand Down

0 comments on commit 248c889

Please sign in to comment.