* Create bin directory

* Fix values for maxVertex

Fixes #1068
This commit is contained in:
Sascha Willems 2023-09-09 11:33:32 +02:00 committed by GitHub
parent bb81bbd535
commit 1447348e09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 11 additions and 119 deletions

View file

@ -1,106 +0,0 @@
# Benchmark all examples
import subprocess
import sys
import os
import platform
EXAMPLES = [
"bloom",
"computecloth",
"computecullandlod",
"computenbody",
"computeparticles",
"computeraytracing",
"computeshader",
"conditionalrender",
"conservativeraster",
"debugmarker",
"deferred",
"deferredmultisampling",
"deferredshadows",
"descriptorindexing",
"descriptorsets",
"displacement",
"distancefieldfonts",
"dynamicrendering",
"dynamicuniformbuffer",
"gears",
"geometryshader",
"gltfloading",
"gltfscenerendering",
"gltfskinning",
"graphicspipelinelibrary",
"hdr",
"imgui",
"indirectdraw",
"inlineuniformblocks",
"inputattachments",
"instancing",
"multisampling",
"multithreading",
"multiview",
"negativeviewportheight",
"occlusionquery",
"offscreen",
"oit",
"parallaxmapping",
"particlefire",
"pbrbasic",
"pbribl",
"pbrtexture",
"pipelines",
"pipelinestatistics",
"pushconstants",
"pushdescriptors",
"radialblur",
"rayquery",
"raytracingbasic",
"raytracingcallable",
"raytracingreflections",
"raytracingshadows",
"shadowmapping",
"shadowmappingcascade",
"shadowmappingomni",
"specializationconstants",
"sphericalenvmapping",
"ssao",
"stencilbuffer",
"subpasses",
"terraintessellation",
"tessellation",
"textoverlay",
"texture",
"texture3d",
"texturearray",
"texturecubemap",
"texturecubemaparray",
"texturemipmapgen",
"texturesparseresidency",
"triangle",
"variablerateshading",
"vertexattributes",
"viewportarray",
"vulkanscene"
]
CURR_INDEX = 0
ARGS = "-fullscreen -b"
print("Benchmarking all examples...")
os.makedirs("./benchmark", exist_ok=True)
for example in EXAMPLES:
print("---- (%d/%d) Running %s in benchmark mode ----" % (CURR_INDEX+1, len(EXAMPLES), example))
if platform.system() == 'Linux' or platform.system() == 'Darwin':
RESULT_CODE = subprocess.call("./%s %s -bf ./benchmark/%s.csv 5" % (example, ARGS, example), shell=True)
else:
RESULT_CODE = subprocess.call("%s %s -bf ./benchmark/%s.csv 5" % (example, ARGS, example))
if RESULT_CODE == 0:
print("Results written to ./benchmark/%s.csv" % example)
else:
print("Error, result code = %d" % RESULT_CODE)
CURR_INDEX += 1
print("Benchmark run finished")

View file

@ -37,6 +37,7 @@ function(buildExample EXAMPLE_NAME)
target_link_libraries(${EXAMPLE_NAME} base )
endif(WIN32)
file(MAKE_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
set_target_properties(${EXAMPLE_NAME} PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
if(${EXAMPLE_NAME} STREQUAL "texture3d")
if(APPLE)

View file

@ -1,7 +1,7 @@
/*
* Vulkan Example - Using ray queries for hardware accelerated ray tracing queries in a fragment shader
*
* Copyright (C) 2020-2022 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2020-2023 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
@ -73,7 +73,6 @@ public:
indexBufferDeviceAddress.deviceAddress = getBufferDeviceAddress(scene.indices.buffer);
uint32_t numTriangles = static_cast<uint32_t>(scene.indices.count) / 3;
uint32_t maxVertex = scene.vertices.count;
// Build
VkAccelerationStructureGeometryKHR accelerationStructureGeometry = vks::initializers::accelerationStructureGeometryKHR();
@ -82,7 +81,7 @@ public:
accelerationStructureGeometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
accelerationStructureGeometry.geometry.triangles.vertexFormat = VK_FORMAT_R32G32B32_SFLOAT;
accelerationStructureGeometry.geometry.triangles.vertexData = vertexBufferDeviceAddress;
accelerationStructureGeometry.geometry.triangles.maxVertex = maxVertex;
accelerationStructureGeometry.geometry.triangles.maxVertex = scene.vertices.count - 1;
accelerationStructureGeometry.geometry.triangles.vertexStride = sizeof(vkglTF::Vertex);
accelerationStructureGeometry.geometry.triangles.indexType = VK_INDEX_TYPE_UINT32;
accelerationStructureGeometry.geometry.triangles.indexData = indexBufferDeviceAddress;

View file

@ -1,7 +1,7 @@
/*
* Vulkan Example - Basic hardware accelerated ray tracing example
*
* Copyright (C) 2019-2020 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2019-2023 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
@ -318,7 +318,7 @@ public:
accelerationStructureGeometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
accelerationStructureGeometry.geometry.triangles.vertexFormat = VK_FORMAT_R32G32B32_SFLOAT;
accelerationStructureGeometry.geometry.triangles.vertexData = vertexBufferDeviceAddress;
accelerationStructureGeometry.geometry.triangles.maxVertex = 3;
accelerationStructureGeometry.geometry.triangles.maxVertex = 2;
accelerationStructureGeometry.geometry.triangles.vertexStride = sizeof(Vertex);
accelerationStructureGeometry.geometry.triangles.indexType = VK_INDEX_TYPE_UINT32;
accelerationStructureGeometry.geometry.triangles.indexData = indexBufferDeviceAddress;

View file

@ -5,7 +5,7 @@
*
* Relevant code parts are marked with [POI]
*
* Copyright (C) 2021 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2021-2023 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
@ -148,7 +148,7 @@ public:
accelerationStructureGeometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
accelerationStructureGeometry.geometry.triangles.vertexFormat = VK_FORMAT_R32G32B32_SFLOAT;
accelerationStructureGeometry.geometry.triangles.vertexData = vertexBufferDeviceAddress;
accelerationStructureGeometry.geometry.triangles.maxVertex = 3;
accelerationStructureGeometry.geometry.triangles.maxVertex = 2;
accelerationStructureGeometry.geometry.triangles.vertexStride = sizeof(Vertex);
accelerationStructureGeometry.geometry.triangles.indexType = VK_INDEX_TYPE_UINT32;
accelerationStructureGeometry.geometry.triangles.indexData = indexBufferDeviceAddress;

View file

@ -3,7 +3,7 @@
*
* Renders a complex scene doing recursion inside the shaders for creating reflections
*
* Copyright (C) 2019-2020 by Sascha Willems - www.saschawillems.de
* Copyright (C) 2019-2023 by Sascha Willems - www.saschawillems.de
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
@ -84,7 +84,6 @@ public:
indexBufferDeviceAddress.deviceAddress = getBufferDeviceAddress(scene.indices.buffer);
uint32_t numTriangles = static_cast<uint32_t>(scene.indices.count) / 3;
uint32_t maxVertex = scene.vertices.count;
// Build
VkAccelerationStructureGeometryKHR accelerationStructureGeometry = vks::initializers::accelerationStructureGeometryKHR();
@ -93,7 +92,7 @@ public:
accelerationStructureGeometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
accelerationStructureGeometry.geometry.triangles.vertexFormat = VK_FORMAT_R32G32B32_SFLOAT;
accelerationStructureGeometry.geometry.triangles.vertexData = vertexBufferDeviceAddress;
accelerationStructureGeometry.geometry.triangles.maxVertex = maxVertex;
accelerationStructureGeometry.geometry.triangles.maxVertex = scene.vertices.count - 1;
accelerationStructureGeometry.geometry.triangles.vertexStride = sizeof(vkglTF::Vertex);
accelerationStructureGeometry.geometry.triangles.indexType = VK_INDEX_TYPE_UINT32;
accelerationStructureGeometry.geometry.triangles.indexData = indexBufferDeviceAddress;

View file

@ -83,7 +83,6 @@ public:
indexBufferDeviceAddress.deviceAddress = getBufferDeviceAddress(scene.indices.buffer);
uint32_t numTriangles = static_cast<uint32_t>(scene.indices.count) / 3;
uint32_t maxVertex = scene.vertices.count;
// Build
VkAccelerationStructureGeometryKHR accelerationStructureGeometry = vks::initializers::accelerationStructureGeometryKHR();
@ -92,7 +91,7 @@ public:
accelerationStructureGeometry.geometry.triangles.sType = VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_TRIANGLES_DATA_KHR;
accelerationStructureGeometry.geometry.triangles.vertexFormat = VK_FORMAT_R32G32B32_SFLOAT;
accelerationStructureGeometry.geometry.triangles.vertexData = vertexBufferDeviceAddress;
accelerationStructureGeometry.geometry.triangles.maxVertex = maxVertex;
accelerationStructureGeometry.geometry.triangles.maxVertex = scene.vertices.count - 1;
accelerationStructureGeometry.geometry.triangles.vertexStride = sizeof(vkglTF::Vertex);
accelerationStructureGeometry.geometry.triangles.indexType = VK_INDEX_TYPE_UINT32;
accelerationStructureGeometry.geometry.triangles.indexData = indexBufferDeviceAddress;