From 569fb5a399cdb1cb39fb10d8db1fd78ab56f6c9e Mon Sep 17 00:00:00 2001 From: assiduous Date: Thu, 5 Nov 2020 17:31:31 -0800 Subject: A number of minor updates/fixes --- Graphics/ShaderTools/include/SPIRVShaderResources.hpp | 2 +- Graphics/ShaderTools/src/SPIRVShaderResources.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'Graphics/ShaderTools') diff --git a/Graphics/ShaderTools/include/SPIRVShaderResources.hpp b/Graphics/ShaderTools/include/SPIRVShaderResources.hpp index 7bb35f72..97ad1303 100644 --- a/Graphics/ShaderTools/include/SPIRVShaderResources.hpp +++ b/Graphics/ShaderTools/include/SPIRVShaderResources.hpp @@ -58,7 +58,7 @@ namespace Diligent // sizeof(SPIRVShaderResourceAttribs) == 32, msvc x64 struct SPIRVShaderResourceAttribs { - enum class ResourceType : Uint8 + enum ResourceType : Uint8 { UniformBuffer = 0, ROStorageBuffer, diff --git a/Graphics/ShaderTools/src/SPIRVShaderResources.cpp b/Graphics/ShaderTools/src/SPIRVShaderResources.cpp index ceeecbe8..873180b3 100644 --- a/Graphics/ShaderTools/src/SPIRVShaderResources.cpp +++ b/Graphics/ShaderTools/src/SPIRVShaderResources.cpp @@ -381,16 +381,16 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, Uint32 CurrUB = 0; for (const auto& UB : resources.uniform_buffers) { - const auto& name = GetUBName(Compiler, UB, ParsedIRSource); - const auto& Type = Compiler.get_type(UB.type_id); - const size_t Size = Compiler.get_declared_struct_size(Type); + const auto& name = GetUBName(Compiler, UB, ParsedIRSource); + const auto& Type = Compiler.get_type(UB.type_id); + const auto Size = Compiler.get_declared_struct_size(Type); new (&GetUB(CurrUB++)) SPIRVShaderResourceAttribs(Compiler, UB, ResourceNamesPool.CopyString(name), SPIRVShaderResourceAttribs::ResourceType::UniformBuffer, SPIRVShaderResourceAttribs::InvalidSepSmplrOrImgInd, - Uint32(Size)); + static_cast(Size)); } VERIFY_EXPR(CurrUB == GetNumUBs()); } @@ -404,17 +404,17 @@ SPIRVShaderResources::SPIRVShaderResources(IMemoryAllocator& Allocator, auto ResType = IsReadOnly ? SPIRVShaderResourceAttribs::ResourceType::ROStorageBuffer : SPIRVShaderResourceAttribs::ResourceType::RWStorageBuffer; - const auto& Type = Compiler.get_type(SB.type_id); - const size_t Size = Compiler.get_declared_struct_size(Type); - const size_t Stride = Compiler.get_declared_struct_size_runtime_array(Type, 1); + const auto& Type = Compiler.get_type(SB.type_id); + const auto Size = Compiler.get_declared_struct_size(Type); + const auto Stride = Compiler.get_declared_struct_size_runtime_array(Type, 1); new (&GetSB(CurrSB++)) SPIRVShaderResourceAttribs(Compiler, SB, ResourceNamesPool.CopyString(SB.name), ResType, SPIRVShaderResourceAttribs::InvalidSepSmplrOrImgInd, - Uint32(Size), - Uint32(Stride)); + static_cast(Size), + static_cast(Stride)); } VERIFY_EXPR(CurrSB == GetNumSBs()); } -- cgit v1.2.3