Fixed warnings and errors
This commit is contained in:
parent
4771fbfb76
commit
45514ac77e
|
@ -92,7 +92,7 @@ namespace SHADE
|
|||
//uint32_t minBuffer
|
||||
if (alignmentSize > 0)
|
||||
{
|
||||
alignedSize = (alignedSize + alignmentSize - 1) & ~(alignmentSize - 1);
|
||||
alignedSize = (alignedSize + static_cast<uint32_t>(alignmentSize) - 1) & ~(alignmentSize - 1);
|
||||
}
|
||||
return alignedSize;
|
||||
}
|
||||
|
|
|
@ -249,7 +249,7 @@ namespace SHADE
|
|||
if (!EMPTY_MAT_PROPS)
|
||||
{
|
||||
singleMatPropSize = SHADER_INFO->GetBytesRequired();
|
||||
singleMatPropAlignedSize = device->PadSSBOSize(singleMatPropSize);
|
||||
singleMatPropAlignedSize = device->PadSSBOSize(static_cast<uint32_t>(singleMatPropSize));
|
||||
matPropTotalBytes = numTotalElements * singleMatPropAlignedSize;
|
||||
if (matPropsDataSize < matPropTotalBytes)
|
||||
{
|
||||
|
@ -386,7 +386,7 @@ namespace SHADE
|
|||
SHGraphicsConstants::DescriptorSetIndex::PER_INSTANCE,
|
||||
SHGraphicsConstants::DescriptorSetBindings::BATCHED_PER_INST_DATA,
|
||||
bufferList,
|
||||
0, matPropsDataSize
|
||||
0, static_cast<uint32_t>(matPropsDataSize)
|
||||
);
|
||||
matPropsDescSet[frameIndex]->UpdateDescriptorSetBuffer
|
||||
(
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace SHADE
|
|||
SHMatrix inverseViewMatrix;
|
||||
SHMatrix inverseProjMatrix;
|
||||
SHMatrix inverseVpMatrix;
|
||||
bool isDirty;
|
||||
bool isDirty = true;
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* Helper Functions */
|
||||
|
|
|
@ -266,8 +266,8 @@ namespace SHADE
|
|||
// Begin recording the command buffer
|
||||
currentCmdBuffer->BeginRecording();
|
||||
|
||||
uint32_t w = viewports[vpIndex]->GetWidth();
|
||||
uint32_t h = viewports[vpIndex]->GetHeight();
|
||||
uint32_t w = static_cast<uint32_t>(viewports[vpIndex]->GetWidth());
|
||||
uint32_t h = static_cast<uint32_t>(viewports[vpIndex]->GetHeight());
|
||||
currentCmdBuffer->SetViewportScissor (static_cast<float>(w), static_cast<float>(h), w, h);
|
||||
|
||||
currentCmdBuffer->ForceSetPipelineLayout(SHGraphicsGlobalData::GetDummyPipelineLayout());
|
||||
|
@ -325,15 +325,6 @@ namespace SHADE
|
|||
|
||||
void SHGraphicsSystem::Exit(void)
|
||||
{
|
||||
//worldRenderer->
|
||||
graphicsCmdPool.Free();
|
||||
renderContext.Destroy();
|
||||
graphicsQueue.Free();
|
||||
swapchain.Free();
|
||||
surface.Free();
|
||||
device.Free();
|
||||
|
||||
SHVkInstance::Destroy();
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------*/
|
||||
|
@ -554,8 +545,8 @@ namespace SHADE
|
|||
|
||||
worldRenderGraph->HandleResize(windowDims.first, windowDims.second);
|
||||
|
||||
defaultViewport->SetWidth(windowDims.first);
|
||||
defaultViewport->SetHeight(windowDims.second);
|
||||
defaultViewport->SetWidth(static_cast<float>(windowDims.first));
|
||||
defaultViewport->SetHeight(static_cast<float>(windowDims.second));
|
||||
|
||||
worldCamera->SetPerspective(90.0f, static_cast<float>(windowDims.first), static_cast<float>(windowDims.second), 0.0f, 100.0f);
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace SHADE
|
|||
/*-----------------------------------------------------------------------------*/
|
||||
Handle<SHVkPipeline> pipeline;
|
||||
std::unique_ptr<char> propMemory;
|
||||
Byte propMemorySize;
|
||||
Byte propMemorySize = 0;
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* Helper Functions */
|
||||
|
|
|
@ -74,12 +74,12 @@ namespace SHADE
|
|||
renderers.erase(iter);
|
||||
}
|
||||
|
||||
void SHViewport::SetWidth(uint32_t w) noexcept
|
||||
void SHViewport::SetWidth(float w) noexcept
|
||||
{
|
||||
viewport.width = w;
|
||||
}
|
||||
|
||||
void SHViewport::SetHeight(uint32_t h) noexcept
|
||||
void SHViewport::SetHeight(float h) noexcept
|
||||
{
|
||||
viewport.height = h;
|
||||
|
||||
|
|
|
@ -65,8 +65,8 @@ namespace SHADE
|
|||
/*-----------------------------------------------------------------------------*/
|
||||
/* Setters */
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
void SetWidth(uint32_t w) noexcept;
|
||||
void SetHeight (uint32_t h) noexcept;
|
||||
void SetWidth(float w) noexcept;
|
||||
void SetHeight (float h) noexcept;
|
||||
|
||||
/*-----------------------------------------------------------------------------*/
|
||||
/* Getters */
|
||||
|
|
|
@ -196,12 +196,12 @@ namespace SHADE
|
|||
static SHMeshData meshData = Cube();
|
||||
return meshLibrary.AddMesh
|
||||
(
|
||||
meshData.VertexPositions.size(),
|
||||
static_cast<uint32_t>(meshData.VertexPositions.size()),
|
||||
meshData.VertexPositions.data(),
|
||||
meshData.VertexTexCoords.data(),
|
||||
meshData.VertexTangents.data(),
|
||||
meshData.VertexNormals.data(),
|
||||
meshData.Indices.size(),
|
||||
static_cast<uint32_t>(meshData.Indices.size()),
|
||||
meshData.Indices.data()
|
||||
);
|
||||
}
|
||||
|
@ -211,12 +211,12 @@ namespace SHADE
|
|||
static SHMeshData meshData = Cube();
|
||||
return gfxSystem.AddMesh
|
||||
(
|
||||
meshData.VertexPositions.size(),
|
||||
static_cast<uint32_t>(meshData.VertexPositions.size()),
|
||||
meshData.VertexPositions.data(),
|
||||
meshData.VertexTexCoords.data(),
|
||||
meshData.VertexTangents.data(),
|
||||
meshData.VertexNormals.data(),
|
||||
meshData.Indices.size(),
|
||||
static_cast<uint32_t>(meshData.Indices.size()),
|
||||
meshData.Indices.data()
|
||||
);
|
||||
}
|
||||
|
|
|
@ -149,7 +149,7 @@ namespace SHADE
|
|||
{
|
||||
texOrder.emplace_back(job.TextureHandle);
|
||||
combinedImageSamplers.emplace_back(std::make_tuple(job.TextureHandle->ImageView, job.Sampler, vk::ImageLayout::eShaderReadOnlyOptimal));
|
||||
job.TextureHandle->TextureArrayIndex = texOrder.size() - 1;
|
||||
job.TextureHandle->TextureArrayIndex = static_cast<uint32_t>(texOrder.size()) - 1U;
|
||||
}
|
||||
addJobs.clear();
|
||||
|
||||
|
|
|
@ -8,9 +8,9 @@ namespace SHADE
|
|||
ResourceManager::~ResourceManager()
|
||||
{
|
||||
// Delete all resources libraries
|
||||
for (const auto& deleter : deleters)
|
||||
for (auto iter = deleters.rbegin(); iter != deleters.rend(); ++iter)
|
||||
{
|
||||
deleter();
|
||||
(*iter)();
|
||||
}
|
||||
deleters.clear();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue