Skip to content

Commit 42aadb9

Browse files
committed
More changes for module std build failures
1 parent 89d6cc7 commit 42aadb9

11 files changed

Lines changed: 65 additions & 65 deletions

File tree

RAII_Samples/05_InitSwapchain/05_InitSwapchain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ int main()
5353
{
5454
// the graphicsQueueFamilyIndex doesn't support present -> look for an other family index that supports both
5555
// graphics and present
56-
for ( size_t i = 0; i < queueFamilyProperties.size(); i++ )
56+
for ( std::size_t i = 0; i < queueFamilyProperties.size(); i++ )
5757
{
5858
if ( ( queueFamilyProperties[i].queueFlags & vk::QueueFlagBits::eGraphics ) &&
5959
physicalDevice.getSurfaceSupportKHR( vk::su::checked_cast<std::uint32_t>( i ), surface ) )
@@ -67,7 +67,7 @@ int main()
6767
{
6868
// there's nothing like a single family index that supports both graphics and present -> look for an other
6969
// family index that supports present
70-
for ( size_t i = 0; i < queueFamilyProperties.size(); i++ )
70+
for ( std::size_t i = 0; i < queueFamilyProperties.size(); i++ )
7171
{
7272
if ( physicalDevice.getSurfaceSupportKHR( vk::su::checked_cast<std::uint32_t>( i ), surface ) )
7373
{

RAII_Samples/PipelineCache/PipelineCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ int main()
124124
{
125125
// Determine cache size
126126
readCacheStream.seekg( 0, readCacheStream.end );
127-
size_t startCacheSize = static_cast<size_t>( readCacheStream.tellg() );
127+
std::size_t startCacheSize = static_cast<std::size_t>( readCacheStream.tellg() );
128128
readCacheStream.seekg( 0, readCacheStream.beg );
129129

130130
// Allocate memory to hold the initial cache data

RAII_Samples/RayTracing/RayTracing.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ AccelerationStructureData createAccelerationStructureData( vk::raii::PhysicalDev
126126
vk::raii::su::BufferData( physicalDevice, device, instances.size() * sizeof( GeometryInstanceData ), vk::BufferUsageFlagBits::eRayTracingNV );
127127

128128
std::vector<GeometryInstanceData> geometryInstanceData;
129-
for ( size_t i = 0; i < instances.size(); i++ )
129+
for ( std::size_t i = 0; i < instances.size(); i++ )
130130
{
131131
uint64_t accelerationStructureHandle = instances[i].first.getHandle<uint64_t>();
132132

@@ -205,7 +205,7 @@ struct Material
205205
int textureID = -1;
206206
};
207207

208-
const size_t MaterialStride = ( ( sizeof( Material ) + 15 ) / 16 ) * 16;
208+
const std::size_t MaterialStride = ( ( sizeof( Material ) + 15 ) / 16 ) * 16;
209209

210210
struct Vertex
211211
{
@@ -217,7 +217,7 @@ struct Vertex
217217
int matID;
218218
};
219219

220-
const size_t VertexStride = ( ( sizeof( Vertex ) + 15 ) / 16 ) * 16;
220+
const std::size_t VertexStride = ( ( sizeof( Vertex ) + 15 ) / 16 ) * 16;
221221

222222
static const std::vector<Vertex> cubeData = {
223223
// pos nrm texcoord matID
@@ -638,9 +638,9 @@ uint32_t roundUp( uint32_t value, uint32_t alignment )
638638
int main()
639639
{
640640
// number of cubes in x-, y-, and z-direction
641-
const size_t xMax = 10;
642-
const size_t yMax = 10;
643-
const size_t zMax = 10;
641+
const std::size_t xMax = 10;
642+
const std::size_t yMax = 10;
643+
const std::size_t zMax = 10;
644644

645645
AppInfo appInfo;
646646

@@ -782,10 +782,10 @@ int main()
782782
bool samplerAnisotropy = !!supportedFeatures.get<vk::PhysicalDeviceFeatures2>().features.samplerAnisotropy;
783783

784784
// create some simple checkerboard textures, randomly sized and colored
785-
const size_t textureCount = 10;
785+
const std::size_t textureCount = 10;
786786
std::vector<vk::raii::su::TextureData> textures;
787787
textures.reserve( textureCount );
788-
for ( size_t i = 0; i < textureCount; i++ )
788+
for ( std::size_t i = 0; i < textureCount; i++ )
789789
{
790790
textures.emplace_back( physicalDevice,
791791
device,
@@ -809,10 +809,10 @@ int main()
809809
} );
810810

811811
// create some materials with a random diffuse color, referencing one of the above textures
812-
const size_t materialCount = 10;
812+
const std::size_t materialCount = 10;
813813
assert( materialCount == textureCount );
814814
std::vector<Material> materials( materialCount );
815-
for ( size_t i = 0; i < materialCount; i++ )
815+
for ( std::size_t i = 0; i < materialCount; i++ )
816816
{
817817
materials[i].diffuse = randomVec3( 0.0f, 1.0f );
818818
materials[i].textureID = vk::su::checked_cast<uint32_t>( i );
@@ -823,11 +823,11 @@ int main()
823823
// create a a 3D-array of cubes, randomly jittered, using a random material
824824
std::vector<Vertex> vertices;
825825
vertices.reserve( xMax * yMax * zMax * cubeData.size() );
826-
for ( size_t x = 0; x < xMax; x++ )
826+
for ( std::size_t x = 0; x < xMax; x++ )
827827
{
828-
for ( size_t y = 0; y < yMax; y++ )
828+
for ( std::size_t y = 0; y < yMax; y++ )
829829
{
830-
for ( size_t z = 0; z < zMax; z++ )
830+
for ( std::size_t z = 0; z < zMax; z++ )
831831
{
832832
int m = random<int>( 0, materialCount - 1 );
833833
glm::vec3 jitter = randomVec3( 0.0f, 0.6f );
@@ -974,7 +974,7 @@ int main()
974974
vk::DescriptorSetLayoutCreateInfo descriptorSetLayoutCreateInfo( {}, bindings );
975975
vk::raii::DescriptorSetLayout rayTracingDescriptorSetLayout( device, descriptorSetLayoutCreateInfo );
976976
std::vector<vk::DescriptorSetLayout> layouts;
977-
for ( size_t i = 0; i < swapChainData.images.size(); i++ )
977+
for ( std::size_t i = 0; i < swapChainData.images.size(); i++ )
978978
{
979979
layouts.push_back( *rayTracingDescriptorSetLayout );
980980
}
@@ -984,7 +984,7 @@ int main()
984984
// Bind ray tracing specific descriptor sets into pNext of a vk::WriteDescriptorSet
985985
vk::WriteDescriptorSetAccelerationStructureNV writeDescriptorSetAcceleration( 1, &*topLevelAS.accelerationStructure );
986986
std::vector<vk::WriteDescriptorSet> accelerationDescriptionSets;
987-
for ( size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
987+
for ( std::size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
988988
{
989989
accelerationDescriptionSets.emplace_back(
990990
*rayTracingDescriptorSets[i], 0, 0, 1, bindings[0].descriptorType, nullptr, nullptr, nullptr, &writeDescriptorSetAcceleration );
@@ -993,7 +993,7 @@ int main()
993993

994994
// Bind all the other buffers and images, starting with dstBinding == 2 (dstBinding == 1 is used by the backBuffer
995995
// view)
996-
for ( size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
996+
for ( std::size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
997997
{
998998
vk::raii::su::updateDescriptorSets( device,
999999
rayTracingDescriptorSets[i],
@@ -1103,7 +1103,7 @@ int main()
11031103
uniformBufferObject.modelIT = glm::inverseTranspose( uniformBufferObject.model );
11041104

11051105
double accumulatedTime{ 0.0 };
1106-
size_t frameCount{ 0 };
1106+
std::size_t frameCount{ 0 };
11071107
while ( !glfwWindowShouldClose( window ) )
11081108
{
11091109
double startTime = glfwGetTime();

RAII_Samples/SurfaceCapabilities/SurfaceCapabilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int main()
7171
/* VULKAN_KEY_START */
7272

7373
std::cout << std::boolalpha;
74-
for ( size_t i = 0; i < physicalDevices.size(); i++ )
74+
for ( std::size_t i = 0; i < physicalDevices.size(); i++ )
7575
{
7676
// some properties are only valid, if a corresponding extension is available!
7777
std::vector<vk::ExtensionProperties> extensionProperties = physicalDevices[i].enumerateDeviceExtensionProperties();

RAII_Samples/utils/utils.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace vk
3737
}
3838

3939
template <typename T>
40-
void copyToDevice( vk::raii::DeviceMemory const & deviceMemory, T const * pData, size_t count, vk::DeviceSize stride = sizeof( T ) )
40+
void copyToDevice( vk::raii::DeviceMemory const & deviceMemory, T const * pData, std::size_t count, vk::DeviceSize stride = sizeof( T ) )
4141
{
4242
assert( sizeof( T ) <= stride );
4343
uint8_t * deviceData = static_cast<uint8_t *>( deviceMemory.mapMemory( 0, count * stride ) );
@@ -47,7 +47,7 @@ namespace vk
4747
}
4848
else
4949
{
50-
for ( size_t i = 0; i < count; i++ )
50+
for ( std::size_t i = 0; i < count; i++ )
5151
{
5252
std::memcpy( deviceData, &pData[i], sizeof( T ) );
5353
deviceData += stride;
@@ -193,11 +193,11 @@ namespace vk
193193
}
194194

195195
template <typename DataType>
196-
void upload( std::vector<DataType> const & data, size_t stride = 0 ) const
196+
void upload( std::vector<DataType> const & data, std::size_t stride = 0 ) const
197197
{
198198
assert( m_propertyFlags & vk::MemoryPropertyFlagBits::eHostVisible );
199199

200-
size_t elementSize = stride ? stride : sizeof( DataType );
200+
std::size_t elementSize = stride ? stride : sizeof( DataType );
201201
assert( sizeof( DataType ) <= elementSize );
202202

203203
copyToDevice( deviceMemory, data.data(), data.size(), elementSize );
@@ -209,15 +209,15 @@ namespace vk
209209
vk::raii::CommandPool const & commandPool,
210210
vk::raii::Queue const & queue,
211211
std::vector<DataType> const & data,
212-
size_t stride ) const
212+
std::size_t stride ) const
213213
{
214214
assert( m_usage & vk::BufferUsageFlagBits::eTransferDst );
215215
assert( m_propertyFlags & vk::MemoryPropertyFlagBits::eDeviceLocal );
216216

217-
size_t elementSize = stride ? stride : sizeof( DataType );
217+
std::size_t elementSize = stride ? stride : sizeof( DataType );
218218
assert( sizeof( DataType ) <= elementSize );
219219

220-
size_t dataSize = data.size() * elementSize;
220+
std::size_t dataSize = data.size() * elementSize;
221221
assert( dataSize <= m_size );
222222

223223
vk::raii::su::BufferData stagingBuffer( physicalDevice, device, dataSize, vk::BufferUsageFlagBits::eTransferSrc );
@@ -510,7 +510,7 @@ namespace vk
510510

511511
// the graphicsQueueFamilyIndex doesn't support present -> look for an other family index that supports both
512512
// graphics and present
513-
for ( size_t i = 0; i < queueFamilyProperties.size(); i++ )
513+
for ( std::size_t i = 0; i < queueFamilyProperties.size(); i++ )
514514
{
515515
if ( ( queueFamilyProperties[i].queueFlags & vk::QueueFlagBits::eGraphics ) &&
516516
physicalDevice.getSurfaceSupportKHR( static_cast<uint32_t>( i ), surface ) )
@@ -521,7 +521,7 @@ namespace vk
521521

522522
// there's nothing like a single family index that supports both graphics and present -> look for an other
523523
// family index that supports present
524-
for ( size_t i = 0; i < queueFamilyProperties.size(); i++ )
524+
for ( std::size_t i = 0; i < queueFamilyProperties.size(); i++ )
525525
{
526526
if ( physicalDevice.getSurfaceSupportKHR( static_cast<uint32_t>( i ), surface ) )
527527
{
@@ -561,7 +561,7 @@ namespace vk
561561
vk::DescriptorSetLayoutCreateFlags flags = {} )
562562
{
563563
std::vector<vk::DescriptorSetLayoutBinding> bindings( bindingData.size() );
564-
for ( size_t i = 0; i < bindingData.size(); i++ )
564+
for ( std::size_t i = 0; i < bindingData.size(); i++ )
565565
{
566566
bindings[i] = vk::DescriptorSetLayoutBinding(
567567
vk::su::checked_cast<uint32_t>( i ), std::get<0>( bindingData[i] ), std::get<1>( bindingData[i] ), std::get<2>( bindingData[i] ) );

samples/05_InitSwapchain/05_InitSwapchain.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@ int main()
4646

4747
// determine a queueFamilyIndex that suports present
4848
// first check if the graphicsQueueFamiliyIndex is good enough
49-
size_t presentQueueFamilyIndex = physicalDevice.getSurfaceSupportKHR( static_cast<std::uint32_t>( graphicsQueueFamilyIndex ), surface )
49+
std::size_t presentQueueFamilyIndex = physicalDevice.getSurfaceSupportKHR( static_cast<std::uint32_t>( graphicsQueueFamilyIndex ), surface )
5050
? graphicsQueueFamilyIndex
5151
: queueFamilyProperties.size();
5252
if ( presentQueueFamilyIndex == queueFamilyProperties.size() )
5353
{
5454
// the graphicsQueueFamilyIndex doesn't support present -> look for an other family index that supports both
5555
// graphics and present
56-
for ( size_t i = 0; i < queueFamilyProperties.size(); i++ )
56+
for ( std::size_t i = 0; i < queueFamilyProperties.size(); i++ )
5757
{
5858
if ( ( queueFamilyProperties[i].queueFlags & vk::QueueFlagBits::eGraphics ) &&
5959
physicalDevice.getSurfaceSupportKHR( static_cast<std::uint32_t>( i ), surface ) )
@@ -67,7 +67,7 @@ int main()
6767
{
6868
// there's nothing like a single family index that supports both graphics and present -> look for an other
6969
// family index that supports present
70-
for ( size_t i = 0; i < queueFamilyProperties.size(); i++ )
70+
for ( std::size_t i = 0; i < queueFamilyProperties.size(); i++ )
7171
{
7272
if ( physicalDevice.getSurfaceSupportKHR( static_cast<std::uint32_t>( i ), surface ) )
7373
{

samples/PipelineCache/PipelineCache.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ int main()
123123
{
124124
// Determine cache size
125125
readCacheStream.seekg( 0, readCacheStream.end );
126-
size_t startCacheSize = static_cast<size_t>( readCacheStream.tellg() );
126+
std::size_t startCacheSize = static_cast<std::size_t>( readCacheStream.tellg() );
127127
readCacheStream.seekg( 0, readCacheStream.beg );
128128

129129
// Allocate memory to hold the initial cache data

samples/RayTracing/RayTracing.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ AccelerationStructureData createAccelerationStructureData( vk::PhysicalDevice co
142142
new vk::su::BufferData( physicalDevice, device, instances.size() * sizeof( GeometryInstanceData ), vk::BufferUsageFlagBits::eRayTracingNV ) );
143143

144144
std::vector<GeometryInstanceData> geometryInstanceData;
145-
for ( size_t i = 0; i < instances.size(); i++ )
145+
for ( std::size_t i = 0; i < instances.size(); i++ )
146146
{
147147
uint64_t accelerationStructureHandle = device.getAccelerationStructureHandleNV<uint64_t>( instances[i].first );
148148

@@ -219,7 +219,7 @@ struct Material
219219
int textureID = -1;
220220
};
221221

222-
const size_t MaterialStride = ( ( sizeof( Material ) + 15 ) / 16 ) * 16;
222+
const std::size_t MaterialStride = ( ( sizeof( Material ) + 15 ) / 16 ) * 16;
223223

224224
struct Vertex
225225
{
@@ -231,7 +231,7 @@ struct Vertex
231231
int matID;
232232
};
233233

234-
const size_t VertexStride = ( ( sizeof( Vertex ) + 15 ) / 16 ) * 16;
234+
const std::size_t VertexStride = ( ( sizeof( Vertex ) + 15 ) / 16 ) * 16;
235235

236236
static const std::vector<Vertex> cubeData = {
237237
// pos nrm texcoord matID
@@ -652,9 +652,9 @@ uint32_t roundUp( uint32_t value, uint32_t alignment )
652652
int main()
653653
{
654654
// number of cubes in x-, y-, and z-direction
655-
const size_t xMax = 10;
656-
const size_t yMax = 10;
657-
const size_t zMax = 10;
655+
const std::size_t xMax = 10;
656+
const std::size_t yMax = 10;
657+
const std::size_t zMax = 10;
658658

659659
AppInfo appInfo;
660660

@@ -790,10 +790,10 @@ int main()
790790
bool samplerAnisotropy = !!supportedFeatures.get<vk::PhysicalDeviceFeatures2>().features.samplerAnisotropy;
791791

792792
// create some simple checkerboard textures, randomly sized and colored
793-
const size_t textureCount = 10;
793+
const std::size_t textureCount = 10;
794794
std::vector<vk::su::TextureData> textures;
795795
textures.reserve( textureCount );
796-
for ( size_t i = 0; i < textureCount; i++ )
796+
for ( std::size_t i = 0; i < textureCount; i++ )
797797
{
798798
textures.emplace_back( physicalDevice,
799799
device,
@@ -818,10 +818,10 @@ int main()
818818
} );
819819

820820
// create some materials with a random diffuse color, referencing one of the above textures
821-
const size_t materialCount = 10;
821+
const std::size_t materialCount = 10;
822822
assert( materialCount == textureCount );
823823
std::vector<Material> materials( materialCount );
824-
for ( size_t i = 0; i < materialCount; i++ )
824+
for ( std::size_t i = 0; i < materialCount; i++ )
825825
{
826826
materials[i].diffuse = randomVec3( 0.0f, 1.0f );
827827
materials[i].textureID = vk::su::checked_cast<uint32_t>( i );
@@ -832,11 +832,11 @@ int main()
832832
// create a a 3D-array of cubes, randomly jittered, using a random material
833833
std::vector<Vertex> vertices;
834834
vertices.reserve( xMax * yMax * zMax * cubeData.size() );
835-
for ( size_t x = 0; x < xMax; x++ )
835+
for ( std::size_t x = 0; x < xMax; x++ )
836836
{
837-
for ( size_t y = 0; y < yMax; y++ )
837+
for ( std::size_t y = 0; y < yMax; y++ )
838838
{
839-
for ( size_t z = 0; z < zMax; z++ )
839+
for ( std::size_t z = 0; z < zMax; z++ )
840840
{
841841
int m = random<int>( 0, materialCount - 1 );
842842
glm::vec3 jitter = randomVec3( 0.0f, 0.6f );
@@ -976,7 +976,7 @@ int main()
976976
vk::DescriptorPool rayTracingDescriptorPool = device.createDescriptorPool( descriptorPoolCreateInfo );
977977
vk::DescriptorSetLayout rayTracingDescriptorSetLayout = device.createDescriptorSetLayout( vk::DescriptorSetLayoutCreateInfo( {}, bindings ) );
978978
std::vector<vk::DescriptorSetLayout> layouts;
979-
for ( size_t i = 0; i < swapChainData.images.size(); i++ )
979+
for ( std::size_t i = 0; i < swapChainData.images.size(); i++ )
980980
{
981981
layouts.push_back( rayTracingDescriptorSetLayout );
982982
}
@@ -986,7 +986,7 @@ int main()
986986
// Bind ray tracing specific descriptor sets into pNext of a vk::WriteDescriptorSet
987987
vk::WriteDescriptorSetAccelerationStructureNV writeDescriptorSetAcceleration( 1, &topLevelAS.accelerationStructure );
988988
std::vector<vk::WriteDescriptorSet> accelerationDescriptionSets;
989-
for ( size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
989+
for ( std::size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
990990
{
991991
accelerationDescriptionSets.emplace_back(
992992
rayTracingDescriptorSets[i], 0, 0, 1, bindings[0].descriptorType, nullptr, nullptr, nullptr, &writeDescriptorSetAcceleration );
@@ -995,7 +995,7 @@ int main()
995995

996996
// Bind all the other buffers and images, starting with dstBinding == 2 (dstBinding == 1 is used by the backBuffer
997997
// view)
998-
for ( size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
998+
for ( std::size_t i = 0; i < rayTracingDescriptorSets.size(); i++ )
999999
{
10001000
vk::su::updateDescriptorSets( device,
10011001
rayTracingDescriptorSets[i],
@@ -1099,7 +1099,7 @@ int main()
10991099
uniformBufferObject.modelIT = glm::inverseTranspose( uniformBufferObject.model );
11001100

11011101
double accumulatedTime{ 0.0 };
1102-
size_t frameCount{ 0 };
1102+
std::size_t frameCount{ 0 };
11031103
while ( !glfwWindowShouldClose( window ) )
11041104
{
11051105
double startTime = glfwGetTime();

samples/SurfaceCapabilities/SurfaceCapabilities.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int main()
7575
/* VULKAN_KEY_START */
7676

7777
std::cout << std::boolalpha;
78-
for ( size_t i = 0; i < physicalDevices.size(); i++ )
78+
for ( std::size_t i = 0; i < physicalDevices.size(); i++ )
7979
{
8080
// some properties are only valid, if a corresponding extension is available!
8181
std::vector<vk::ExtensionProperties> extensionProperties = physicalDevices[i].enumerateDeviceExtensionProperties();

0 commit comments

Comments
 (0)