Skip to content

Commit

Permalink
[vulkan] set version requirement to 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
PanosK92 committed Jan 23, 2025
1 parent ab013b9 commit 27a078f
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 50 deletions.
27 changes: 9 additions & 18 deletions runtime/RHI/Vulkan/Vulkan_Device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ namespace spartan
uint32_t sdk_version = VK_HEADER_VERSION_COMPLETE;
app_info.apiVersion = min(sdk_version, driver_version);

// 1.3 the minimum required version as we are using extensions from 1.3
if (app_info.apiVersion < VK_API_VERSION_1_3)
// the minimum required version is 1.4
if (app_info.apiVersion < VK_API_VERSION_1_4)
{
SP_ERROR_WINDOW("Your machine doesn't support Vulkan 1.3");
SP_ERROR_WINDOW("Your machine doesn't support Vulkan 1.4");
}

// in case the SDK is not supported by the driver, prompt the user to update
Expand Down Expand Up @@ -231,15 +231,15 @@ namespace spartan
vector<const char*> extensions_device = {
"VK_KHR_swapchain",
"VK_EXT_memory_budget", // to obtain precise memory usage information from Vulkan Memory Allocator
"VK_KHR_fragment_shading_rate",
"VK_EXT_hdr_metadata",
"VK_EXT_robustness2",
"VK_KHR_fragment_shading_rate",
"VK_EXT_hdr_metadata",
"VK_EXT_robustness2",
"VK_KHR_external_memory", // to share images with Intel Open Image Denoise
#if defined(_MSC_VER)
#if defined(_MSC_VER)
"VK_KHR_external_memory_win32", // external memory handle type, linux alternative: VK_KHR_external_memory_fd
#endif
"VK_KHR_synchronization2", // needed by AMD FidelityFX - Breadcrumbs
"VK_KHR_get_memory_requirements2" // needed by AMD FidelityFX - FSR 3
"VK_KHR_synchronization2", // this is part of Vulkan 1.4 but AMD FidelityFX Breadcrumbs without it (they fetch device pointers from some table)
"VK_KHR_get_memory_requirements2" // this is part of Vulkan 1.4 but AMD FidelityFX FSR 3 crashes without it (they fetch device pointers from some table)
};

bool is_present_device(const char* extension_name, VkPhysicalDevice device_physical)
Expand Down Expand Up @@ -291,15 +291,6 @@ namespace spartan
}
}

// check and add VK_KHR_portability_subset if present
// this extension is needed for portability across different platforms and
// must be enabled if the physical device supports it
//const char* portability_extension = "VK_KHR_portability_subset";
//if (is_present_device(portability_extension, RHI_Context::device_physical))
//{
// extensions_supported.emplace_back(portability_extension);
//}

return extensions_supported;
}

Expand Down
2 changes: 1 addition & 1 deletion runtime/RHI/Vulkan/Vulkan_FidelityFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ namespace spartan
description_context.fpMessage = &ffx_message_callback;
#endif
description_context.backendInterface = ffx_interface;

// context
SP_ASSERT(ffxFsr3UpscalerContextCreate(&context, &description_context) == FFX_OK);
context_created = true;
Expand Down
64 changes: 33 additions & 31 deletions runtime/Rendering/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,37 +147,39 @@ namespace spartan
RHI_Device::Initialize();
}

// set options (after the device has been created since it can clamp values like max shadow resolution etc)
m_options.clear();
SetOption(Renderer_Option::WhitePoint, 350.0f);
SetOption(Renderer_Option::Tonemapping, static_cast<float>(Renderer_Tonemapping::Max));
SetOption(Renderer_Option::Bloom, 1.0f); // non-zero values activate it and control the intensity
SetOption(Renderer_Option::MotionBlur, 1.0f);
SetOption(Renderer_Option::DepthOfField, 1.0f);
SetOption(Renderer_Option::ScreenSpaceAmbientOcclusion, 1.0f);
SetOption(Renderer_Option::ScreenSpaceShadows, static_cast<float>(Renderer_ScreenspaceShadow::Bend));
SetOption(Renderer_Option::ScreenSpaceReflections, 1.0f);
SetOption(Renderer_Option::GlobalIllumination, 0.5f); // 0.5 is the percentage of the internal resolution (options are 25%, 50%, 75% and 100%)
SetOption(Renderer_Option::Anisotropy, 16.0f);
SetOption(Renderer_Option::ShadowResolution, 4096.0f);
SetOption(Renderer_Option::Exposure, 1.0f);
SetOption(Renderer_Option::Sharpness, 0.0f); // becomes the upsampler's sharpness as well
SetOption(Renderer_Option::Fog, 1.0f); // controls the intensity of the volumetric fog as well
SetOption(Renderer_Option::FogVolumetric, 1.0f); // these is only a toggle for the volumetric fog
SetOption(Renderer_Option::Antialiasing, static_cast<float>(Renderer_Antialiasing::Taa)); // this is using fsr 3 for taa
SetOption(Renderer_Option::Upsampling, static_cast<float>(Renderer_Upsampling::Fsr3));
SetOption(Renderer_Option::ResolutionScale, 1.0f);
SetOption(Renderer_Option::VariableRateShading, 0.0f);
SetOption(Renderer_Option::Vsync, 0.0f);
SetOption(Renderer_Option::TransformHandle, 1.0f);
SetOption(Renderer_Option::SelectionOutline, 1.0f);
SetOption(Renderer_Option::Grid, 1.0f);
SetOption(Renderer_Option::Lights, 1.0f);
SetOption(Renderer_Option::Physics, 0.0f);
SetOption(Renderer_Option::PerformanceMetrics, 1.0f);
SetOption(Renderer_Option::OcclusionCulling, 0.0f); // disabled by default as it's a WIP (you can see the query delays)

SetWind(Vector3(1.0f, 0.0f, 0.5f));
// options
{
m_options.clear();
SetOption(Renderer_Option::WhitePoint, 350.0f);
SetOption(Renderer_Option::Tonemapping, static_cast<float>(Renderer_Tonemapping::Max));
SetOption(Renderer_Option::Bloom, 1.0f); // non-zero values activate it and control the intensity
SetOption(Renderer_Option::MotionBlur, 1.0f);
SetOption(Renderer_Option::DepthOfField, 1.0f);
SetOption(Renderer_Option::ScreenSpaceAmbientOcclusion, 1.0f);
SetOption(Renderer_Option::ScreenSpaceShadows, static_cast<float>(Renderer_ScreenspaceShadow::Bend));
SetOption(Renderer_Option::ScreenSpaceReflections, 1.0f);
SetOption(Renderer_Option::GlobalIllumination, 0.5f); // 0.5 is the percentage of the internal resolution (options are 25%, 50%, 75% and 100%)
SetOption(Renderer_Option::Anisotropy, 16.0f);
SetOption(Renderer_Option::ShadowResolution, 4096.0f);
SetOption(Renderer_Option::Exposure, 1.0f);
SetOption(Renderer_Option::Sharpness, 0.0f); // becomes the upsampler's sharpness as well
SetOption(Renderer_Option::Fog, 1.0f); // controls the intensity of the volumetric fog as well
SetOption(Renderer_Option::FogVolumetric, 1.0f); // these is only a toggle for the volumetric fog
SetOption(Renderer_Option::Antialiasing, static_cast<float>(Renderer_Antialiasing::Taa)); // this is using fsr 3 for taa
SetOption(Renderer_Option::Upsampling, static_cast<float>(Renderer_Upsampling::Fsr3));
SetOption(Renderer_Option::ResolutionScale, 1.0f);
SetOption(Renderer_Option::VariableRateShading, 0.0f);
SetOption(Renderer_Option::Vsync, 0.0f);
SetOption(Renderer_Option::TransformHandle, 1.0f);
SetOption(Renderer_Option::SelectionOutline, 1.0f);
SetOption(Renderer_Option::Grid, 1.0f);
SetOption(Renderer_Option::Lights, 1.0f);
SetOption(Renderer_Option::Physics, 0.0f);
SetOption(Renderer_Option::PerformanceMetrics, 1.0f);
SetOption(Renderer_Option::OcclusionCulling, 0.0f); // disabled by default as it's a WIP (you can see the query delays)

SetWind(Vector3(1.0f, 0.0f, 0.5f));
}

// resolution
{
Expand Down

0 comments on commit 27a078f

Please sign in to comment.