Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions tests/loadtests/appfwSDL/VulkanAppSDL/VulkanAppSDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ VulkanAppSDL::createInstance()
{
MAYBE_UNUSED VkResult err;
uint32_t instanceLayerCount = 0;
std::vector<const char *>* instanceValidationLayers = nullptr;
std::vector<const char *> instanceValidationLayers;

std::vector<const char *> instanceValidationLayers_alt1 = {
"VK_LAYER_KHRONOS_validation"
Expand Down Expand Up @@ -498,21 +498,16 @@ VulkanAppSDL::createInstance()
instanceLayerCount,
instanceLayers);
if (validationFound) {
instanceValidationLayers = &instanceValidationLayers_alt1;
instanceValidationLayers = instanceValidationLayers_alt1;
} else {
// Use alternative set of validation layers.
validationFound = checkLayers(
(uint32_t)instanceValidationLayers_alt2.size(),
instanceValidationLayers_alt2.data(),
instanceLayerCount,
instanceLayers);
instanceValidationLayers = &instanceValidationLayers_alt2;
}
if (validationFound) {
for (uint32_t i = 0; i < instanceValidationLayers->size(); i++)
{
deviceValidationLayers.push_back(
instanceValidationLayers->data()[i]);
if (validationFound) {
instanceValidationLayers = instanceValidationLayers_alt2;
}
}
delete [] instanceLayers;
Expand Down Expand Up @@ -585,8 +580,8 @@ VulkanAppSDL::createInstance()
vk::InstanceCreateInfo instanceInfo(
{},
&app,
(uint32_t)deviceValidationLayers.size(),
(const char *const *)deviceValidationLayers.data(),
(uint32_t)instanceValidationLayers.size(),
(const char *const *)instanceValidationLayers.data(),
(uint32_t)extensionNames.size(),
(const char *const *)extensionNames.data());
#if VK_KHR_portability_subset
Expand Down Expand Up @@ -806,7 +801,7 @@ VulkanAppSDL::createDevice()
if (hdr)
wantedExtensions.push_back({VK_EXT_HDR_METADATA_EXTENSION_NAME, optional});
#if VK_EXT_texture_compression_astc_3d
wantedExtensions.push_back({TEXTURE_COMPRESSION_ASTC_3D_EXTENSION_NAME, optional});
wantedExtensions.push_back({VK_EXT_TEXTURE_COMPRESSION_ASTC_3D_EXTENSION_NAME, optional});
#endif

vk::Result err;
Expand Down Expand Up @@ -913,10 +908,8 @@ VulkanAppSDL::createDevice()
{},
1,
&queueInfo,
(uint32_t)deviceValidationLayers.size(),
(const char *const *)((validate)
? deviceValidationLayers.data()
: NULL),
0, // enabledLayerCount
nullptr,
(uint32_t)extensionsToEnable.size(),
(const char *const *)extensionsToEnable.data(),
nullptr);
Expand Down
1 change: 0 additions & 1 deletion tests/loadtests/appfwSDL/VulkanAppSDL/VulkanAppSDL.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ class VulkanAppSDL : public AppBaseSDL {
VkColorSpaceKHR colorSpace = VK_COLOR_SPACE_SRGB_NONLINEAR_KHR;

std::vector<const char*> extensionNames;
std::vector<const char*> deviceValidationLayers;

VkCommandBuffer setupCmdBuffer;
VkSurfaceKHR vsSurface;
Expand Down
2 changes: 1 addition & 1 deletion tests/loadtests/appfwSDL/VulkanAppSDL/VulkanContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct VulkanContext {
#endif
#if VK_EXT_texture_compression_astc_3d
vk::PhysicalDeviceTextureCompressionASTC3DFeaturesEXT& gpuAstc3dFeatures =
gpuFeaturesChain.get<vk::PhysicalDeviceTextureCompressionASTC3DFeaturesEXT();
gpuFeaturesChain.get<vk::PhysicalDeviceTextureCompressionASTC3DFeaturesEXT>();
#endif
#if VK_KHR_portability_subset
vk::PhysicalDevicePortabilitySubsetFeaturesKHR& gpuPortabilityFeatures =
Expand Down
6 changes: 3 additions & 3 deletions tests/loadtests/compile_shader.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function(compile_shader shader_target shader_name shader_src_path shader_path)
add_custom_command(OUTPUT
${vert2spirv_out}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${shader_path}
COMMAND glslc "-fshader-stage=vertex" -o "${vert2spirv_out}" "${vert2spirv_in}"
COMMAND ${Vulkan_GLSLC_EXECUTABLE} "-fshader-stage=vertex" -o "${vert2spirv_out}" "${vert2spirv_in}"
DEPENDS ${vert2spirv_in}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMENT "Compiling ${vert_name}."
Expand All @@ -24,7 +24,7 @@ function(compile_shader shader_target shader_name shader_src_path shader_path)
add_custom_command(OUTPUT
${frag2spirv_out}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${shader_path}
COMMAND glslc "-fshader-stage=fragment" -o "${frag2spirv_out}" "${frag2spirv_in}"
COMMAND ${Vulkan_GLSLC_EXECUTABLE} "-fshader-stage=fragment" -o "${frag2spirv_out}" "${frag2spirv_in}"
DEPENDS ${frag2spirv_in}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMENT "Compiling ${frag_name}."
Expand Down Expand Up @@ -57,7 +57,7 @@ function(compile_shader_list shader_target shader_src_path shader_path)
add_custom_command(OUTPUT
${spirv_out}
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${shader_path}
COMMAND glslc -o "${spirv_out}" "${spirv_in}"
COMMAND ${Vulkan_GLSLC_EXECUTABLE} -o "${spirv_out}" "${spirv_in}"
DEPENDS ${spirv_in}
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}
COMMENT "Compiling ${shader}."
Expand Down
8 changes: 8 additions & 0 deletions tests/loadtests/glloadtests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ function( create_gl_target target version sources common_resources ktx_file_sour
${EXE_FLAG}
glloadtests.cmake
${sources}
)
# Resource files will not be copied to their destination (app bundle or
# directory specified by the RESOURCE option of the install(TARGETS)
# command) unless they appear in both the target's RESOURCE and SOURCES
# properties. Add them to SOURCES this way so we can mark them private
# though I'm not sure there is any benefit to doing so.
target_sources( ${target}
PRIVATE
${resources}
)

Expand Down
13 changes: 12 additions & 1 deletion tests/loadtests/vkloadtests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -180,15 +180,26 @@ add_executable( vkloadtests
vkloadtests/VulkanLoadTestSample.cpp
vkloadtests/VulkanLoadTestSample.h
vkloadtests.cmake
)
# Resource files will not be copied to their destination (app bundle or
# directory specified by the RESOURCE option of the install(TARGETS) command)
# unless they appear in both the target's RESOURCE and SOURCES properties.
# Add them to SOURCES this way so we can mark them private though I'm not
# sure there is any benefit to doing so.
target_sources( vkloadtests
PRIVATE
${ktx2_file_sources}
${ktx1_file_sources}
${KTX_ICON_SOURCES}
${LOAD_TEST_COMMON_MODEL_SOURCES}
${SHADER_SOURCES}
${Vulkan_SHARE_VULKAN}
# These are shader binaries not sources. Annoying they have to be in SOURCES.
${SHADER_SPVS}
)

source_group( "Resources/Shaders" FILES ${SHADER_SOURCES})
source_group( "Shader Source Files" FILES ${SHADER_SOURCES})
source_group( "Resources/Shader Binaries" FILES ${SHADER_SPVS})
source_group( "Resources/KTX Images" REGULAR_EXPRESSION "${TEST_RESOURCES_DIR}/ktx(2?)/.*" )

# Keep this in case something changes in the Vulkan implementation and we need to
Expand Down
Loading