diff --git a/bin/benchmark-all.py b/bin/benchmark-all.py deleted file mode 100644 index 2bb6fe43..00000000 --- a/bin/benchmark-all.py +++ /dev/null @@ -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") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index d9c8ec1c..8e7ef554 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -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) diff --git a/examples/rayquery/rayquery.cpp b/examples/rayquery/rayquery.cpp index fa4c7167..98f0e3f8 100644 --- a/examples/rayquery/rayquery.cpp +++ b/examples/rayquery/rayquery.cpp @@ -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,8 +73,7 @@ public: indexBufferDeviceAddress.deviceAddress = getBufferDeviceAddress(scene.indices.buffer); uint32_t numTriangles = static_cast(scene.indices.count) / 3; - uint32_t maxVertex = scene.vertices.count; - + // Build VkAccelerationStructureGeometryKHR accelerationStructureGeometry = vks::initializers::accelerationStructureGeometryKHR(); accelerationStructureGeometry.flags = VK_GEOMETRY_OPAQUE_BIT_KHR; @@ -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; diff --git a/examples/raytracingbasic/raytracingbasic.cpp b/examples/raytracingbasic/raytracingbasic.cpp index 265c7c4f..d67f4c15 100644 --- a/examples/raytracingbasic/raytracingbasic.cpp +++ b/examples/raytracingbasic/raytracingbasic.cpp @@ -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; diff --git a/examples/raytracingcallable/raytracingcallable.cpp b/examples/raytracingcallable/raytracingcallable.cpp index 978cc976..933868d9 100644 --- a/examples/raytracingcallable/raytracingcallable.cpp +++ b/examples/raytracingcallable/raytracingcallable.cpp @@ -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; diff --git a/examples/raytracingreflections/raytracingreflections.cpp b/examples/raytracingreflections/raytracingreflections.cpp index 29c782f1..32ba5c45 100644 --- a/examples/raytracingreflections/raytracingreflections.cpp +++ b/examples/raytracingreflections/raytracingreflections.cpp @@ -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(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; diff --git a/examples/raytracingshadows/raytracingshadows.cpp b/examples/raytracingshadows/raytracingshadows.cpp index e979ec2a..f0ea25f2 100644 --- a/examples/raytracingshadows/raytracingshadows.cpp +++ b/examples/raytracingshadows/raytracingshadows.cpp @@ -83,7 +83,6 @@ public: indexBufferDeviceAddress.deviceAddress = getBufferDeviceAddress(scene.indices.buffer); uint32_t numTriangles = static_cast(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;