mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
Fixed clang warnings.
This commit is contained in:
parent
4763828e63
commit
f936d4c05e
5 changed files with 48 additions and 42 deletions
8
3rdparty/dxsdk/include/d3d10.h
vendored
8
3rdparty/dxsdk/include/d3d10.h
vendored
|
@ -1667,7 +1667,7 @@ struct CD3D10_BUFFER_DESC : public D3D10_BUFFER_DESC
|
|||
MiscFlags = miscFlags;
|
||||
}
|
||||
~CD3D10_BUFFER_DESC() {}
|
||||
operator const D3D10_BUFFER_DESC&() const { return *this; }
|
||||
// operator const D3D10_BUFFER_DESC&() const { return *this; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -1894,7 +1894,7 @@ struct CD3D10_TEXTURE1D_DESC : public D3D10_TEXTURE1D_DESC
|
|||
MiscFlags = miscFlags;
|
||||
}
|
||||
~CD3D10_TEXTURE1D_DESC() {}
|
||||
operator const D3D10_TEXTURE1D_DESC&() const { return *this; }
|
||||
// operator const D3D10_TEXTURE1D_DESC&() const { return *this; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -2137,7 +2137,7 @@ struct CD3D10_TEXTURE2D_DESC : public D3D10_TEXTURE2D_DESC
|
|||
MiscFlags = miscFlags;
|
||||
}
|
||||
~CD3D10_TEXTURE2D_DESC() {}
|
||||
operator const D3D10_TEXTURE2D_DESC&() const { return *this; }
|
||||
// operator const D3D10_TEXTURE2D_DESC&() const { return *this; }
|
||||
};
|
||||
#endif
|
||||
typedef struct D3D10_MAPPED_TEXTURE2D
|
||||
|
@ -2381,7 +2381,7 @@ struct CD3D10_TEXTURE3D_DESC : public D3D10_TEXTURE3D_DESC
|
|||
MiscFlags = miscFlags;
|
||||
}
|
||||
~CD3D10_TEXTURE3D_DESC() {}
|
||||
operator const D3D10_TEXTURE3D_DESC&() const { return *this; }
|
||||
// operator const D3D10_TEXTURE3D_DESC&() const { return *this; }
|
||||
};
|
||||
#endif
|
||||
typedef struct D3D10_MAPPED_TEXTURE3D
|
||||
|
|
40
3rdparty/dxsdk/include/d3dx12.h
vendored
40
3rdparty/dxsdk/include/d3dx12.h
vendored
|
@ -48,7 +48,7 @@ struct CD3DX12_RECT : public D3D12_RECT
|
|||
bottom = Bottom;
|
||||
}
|
||||
~CD3DX12_RECT() {}
|
||||
operator const D3D12_RECT&() const { return *this; }
|
||||
// operator const D3D12_RECT&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -99,7 +99,7 @@ struct CD3DX12_BOX : public D3D12_BOX
|
|||
back = Back;
|
||||
}
|
||||
~CD3DX12_BOX() {}
|
||||
operator const D3D12_BOX&() const { return *this; }
|
||||
// operator const D3D12_BOX&() const { return *this; }
|
||||
};
|
||||
inline bool operator==( const D3D12_BOX& l, const D3D12_BOX& r )
|
||||
{
|
||||
|
@ -162,7 +162,7 @@ struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC
|
|||
BackFace.StencilFunc = backStencilFunc;
|
||||
}
|
||||
~CD3DX12_DEPTH_STENCIL_DESC() {}
|
||||
operator const D3D12_DEPTH_STENCIL_DESC&() const { return *this; }
|
||||
// operator const D3D12_DEPTH_STENCIL_DESC&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -189,7 +189,7 @@ struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC
|
|||
RenderTarget[ i ] = defaultRenderTargetBlendDesc;
|
||||
}
|
||||
~CD3DX12_BLEND_DESC() {}
|
||||
operator const D3D12_BLEND_DESC&() const { return *this; }
|
||||
// operator const D3D12_BLEND_DESC&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -240,7 +240,7 @@ struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC
|
|||
ConservativeRaster = conservativeRaster;
|
||||
}
|
||||
~CD3DX12_RASTERIZER_DESC() {}
|
||||
operator const D3D12_RASTERIZER_DESC&() const { return *this; }
|
||||
// operator const D3D12_RASTERIZER_DESC&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -258,7 +258,7 @@ struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO
|
|||
SizeInBytes = size;
|
||||
Alignment = alignment;
|
||||
}
|
||||
operator const D3D12_RESOURCE_ALLOCATION_INFO&() const { return *this; }
|
||||
// operator const D3D12_RESOURCE_ALLOCATION_INFO&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -292,7 +292,7 @@ struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES
|
|||
CreationNodeMask = creationNodeMask;
|
||||
VisibleNodeMask = nodeMask;
|
||||
}
|
||||
operator const D3D12_HEAP_PROPERTIES&() const { return *this; }
|
||||
// operator const D3D12_HEAP_PROPERTIES&() const { return *this; }
|
||||
bool IsCPUAccessible() const
|
||||
{
|
||||
return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK || (Type == D3D12_HEAP_TYPE_CUSTOM &&
|
||||
|
@ -382,7 +382,7 @@ struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
|
|||
Alignment = resAllocInfo.Alignment;
|
||||
Flags = flags;
|
||||
}
|
||||
operator const D3D12_HEAP_DESC&() const { return *this; }
|
||||
// operator const D3D12_HEAP_DESC&() const { return *this; }
|
||||
bool IsCPUAccessible() const
|
||||
{ return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); }
|
||||
};
|
||||
|
@ -421,7 +421,7 @@ struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
|
|||
memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) );
|
||||
DepthStencil.Stencil = stencil;
|
||||
}
|
||||
operator const D3D12_CLEAR_VALUE&() const { return *this; }
|
||||
// operator const D3D12_CLEAR_VALUE&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -439,7 +439,7 @@ struct CD3DX12_RANGE : public D3D12_RANGE
|
|||
Begin = begin;
|
||||
End = end;
|
||||
}
|
||||
operator const D3D12_RANGE&() const { return *this; }
|
||||
// operator const D3D12_RANGE&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -461,7 +461,7 @@ struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINAT
|
|||
Z = z;
|
||||
Subresource = subresource;
|
||||
}
|
||||
operator const D3D12_TILED_RESOURCE_COORDINATE&() const { return *this; }
|
||||
// operator const D3D12_TILED_RESOURCE_COORDINATE&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -485,7 +485,7 @@ struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE
|
|||
Height = height;
|
||||
Depth = depth;
|
||||
}
|
||||
operator const D3D12_TILE_REGION_SIZE&() const { return *this; }
|
||||
// operator const D3D12_TILE_REGION_SIZE&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -507,7 +507,7 @@ struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING
|
|||
DepthInTiles = depthInTiles;
|
||||
StartTileIndexInOverallResource = startTileIndexInOverallResource;
|
||||
}
|
||||
operator const D3D12_SUBRESOURCE_TILING&() const { return *this; }
|
||||
// operator const D3D12_SUBRESOURCE_TILING&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -527,7 +527,7 @@ struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE
|
|||
HeightInTexels = heightInTexels;
|
||||
DepthInTexels = depthInTexels;
|
||||
}
|
||||
operator const D3D12_TILE_SHAPE&() const { return *this; }
|
||||
// operator const D3D12_TILE_SHAPE&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -578,7 +578,7 @@ struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
|
|||
barrier.UAV.pResource = pResource;
|
||||
return result;
|
||||
}
|
||||
operator const D3D12_RESOURCE_BARRIER&() const { return *this; }
|
||||
// operator const D3D12_RESOURCE_BARRIER&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -600,7 +600,7 @@ struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO
|
|||
NumTilesForPackedMips = numTilesForPackedMips;
|
||||
StartTileIndexInOverallResource = startTileIndexInOverallResource;
|
||||
}
|
||||
operator const D3D12_PACKED_MIP_INFO&() const { return *this; }
|
||||
// operator const D3D12_PACKED_MIP_INFO&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -634,7 +634,7 @@ struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT
|
|||
Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1);
|
||||
RowPitch = rowPitch;
|
||||
}
|
||||
operator const D3D12_SUBRESOURCE_FOOTPRINT&() const { return *this; }
|
||||
// operator const D3D12_SUBRESOURCE_FOOTPRINT&() const { return *this; }
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------------------------------------
|
||||
|
@ -1304,7 +1304,7 @@ struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC
|
|||
{ return MipLevels * ArraySize() * PlaneCount(pDevice); }
|
||||
inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice)
|
||||
{ return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
|
||||
operator const D3D12_RESOURCE_DESC&() const { return *this; }
|
||||
// operator const D3D12_RESOURCE_DESC&() const { return *this; }
|
||||
};
|
||||
inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
|
||||
{
|
||||
|
@ -1356,7 +1356,7 @@ inline UINT64 GetRequiredIntermediateSize(
|
|||
UINT64 RequiredSize = 0;
|
||||
|
||||
ID3D12Device* pDevice;
|
||||
pDestinationResource->GetDevice(__uuidof(*pDevice), reinterpret_cast<void**>(&pDevice));
|
||||
pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
|
||||
pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize);
|
||||
pDevice->Release();
|
||||
|
||||
|
@ -1450,7 +1450,7 @@ inline UINT64 UpdateSubresources(
|
|||
|
||||
D3D12_RESOURCE_DESC Desc = pDestinationResource->GetDesc();
|
||||
ID3D12Device* pDevice;
|
||||
pDestinationResource->GetDevice(__uuidof(*pDevice), reinterpret_cast<void**>(&pDevice));
|
||||
pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
|
||||
pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize);
|
||||
pDevice->Release();
|
||||
|
||||
|
|
|
@ -69,11 +69,17 @@ function bgfxProject(_name, _kind, _defines)
|
|||
"GLESv2",
|
||||
}
|
||||
|
||||
configuration { "winphone8* or winstore8*"}
|
||||
configuration { "winphone8* or winstore8*" }
|
||||
linkoptions {
|
||||
"/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
|
||||
}
|
||||
|
||||
configuration { "*clang*" }
|
||||
buildoptions {
|
||||
"-Wno-microsoft-enum-value", -- enumerator value is not representable in the underlying type 'int'
|
||||
"-Wno-microsoft-const-init", -- default initialization of an object of const type '' without a user-provided default constructor is a Microsoft extension
|
||||
}
|
||||
|
||||
configuration { "osx" }
|
||||
links {
|
||||
"Cocoa.framework",
|
||||
|
|
|
@ -836,10 +836,10 @@ namespace bgfx { namespace d3d12
|
|||
|
||||
D3D12_ROOT_PARAMETER rootParameter[] =
|
||||
{
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { 1, &descRange[Rdt::Sampler] }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { 1, &descRange[Rdt::SRV] }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_CBV, { 0, 0 }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { 1, &descRange[Rdt::UAV] }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { { 1, &descRange[Rdt::Sampler] } }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { { 1, &descRange[Rdt::SRV] } }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_CBV, { { 0, 0 } }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
{ D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE, { { 1, &descRange[Rdt::UAV] } }, D3D12_SHADER_VISIBILITY_ALL },
|
||||
};
|
||||
rootParameter[Rdt::CBV].Descriptor.RegisterSpace = 0;
|
||||
rootParameter[Rdt::CBV].Descriptor.ShaderRegister = 0;
|
||||
|
@ -1365,7 +1365,7 @@ namespace bgfx { namespace d3d12
|
|||
box.back = 1;
|
||||
|
||||
setResourceBarrier(m_commandList, backBuffer, D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_COPY_SOURCE);
|
||||
D3D12_TEXTURE_COPY_LOCATION dst = { readback, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, layout };
|
||||
D3D12_TEXTURE_COPY_LOCATION dst = { readback, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, { layout } };
|
||||
D3D12_TEXTURE_COPY_LOCATION src = { backBuffer, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {} };
|
||||
m_commandList->CopyTextureRegion(&dst, 0, 0, 0, &src, &box);
|
||||
setResourceBarrier(m_commandList, backBuffer, D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_PRESENT);
|
||||
|
@ -3027,10 +3027,10 @@ data.NumQualityLevels = 0;
|
|||
|
||||
D3D12_INDIRECT_ARGUMENT_DESC drawArgDesc[] =
|
||||
{
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, { Rdt::CBV } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, 0 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, 1 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_DRAW, 0 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, { { Rdt::CBV } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 0 } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 1 } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_DRAW, { { 0 } } },
|
||||
};
|
||||
|
||||
D3D12_COMMAND_SIGNATURE_DESC drawCommandSignature =
|
||||
|
@ -3049,11 +3049,11 @@ data.NumQualityLevels = 0;
|
|||
|
||||
D3D12_INDIRECT_ARGUMENT_DESC drawIndexedArgDesc[] =
|
||||
{
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, { Rdt::CBV } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, 0 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, 1 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW, 0 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED, 0 },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW, { { Rdt::CBV } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 0 } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_VERTEX_BUFFER_VIEW, { { 1 } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW, { { 0 } } },
|
||||
{ D3D12_INDIRECT_ARGUMENT_TYPE_DRAW_INDEXED, { { 0 } } },
|
||||
};
|
||||
|
||||
D3D12_COMMAND_SIGNATURE_DESC drawIndexedCommandSignature =
|
||||
|
@ -4025,9 +4025,9 @@ data.NumQualityLevels = 0;
|
|||
box.front = _z;
|
||||
box.back = _z+_depth;
|
||||
|
||||
D3D12_TEXTURE_COPY_LOCATION dst = { m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, {} };
|
||||
D3D12_TEXTURE_COPY_LOCATION dst = { m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { } };
|
||||
dst.SubresourceIndex = subres;
|
||||
D3D12_TEXTURE_COPY_LOCATION src = { staging, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, layout };
|
||||
D3D12_TEXTURE_COPY_LOCATION src = { staging, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, { layout } };
|
||||
_commandList->CopyTextureRegion(&dst, _rect.m_x, _rect.m_y, 0, &src, &box);
|
||||
|
||||
setState(_commandList, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
|
||||
|
|
|
@ -490,7 +490,7 @@ namespace bgfx
|
|||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcSrvType) == DxbcResourceDim::Count);
|
||||
|
||||
static const char* s_dxbcInterpolationName[] =
|
||||
const char* s_dxbcInterpolationName[] =
|
||||
{
|
||||
"",
|
||||
"constant",
|
||||
|
|
Loading…
Reference in a new issue