Skip to content
Draft
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
40 changes: 39 additions & 1 deletion libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ static const struct vkd3d_optional_extension_info optional_device_extensions[] =
VK_EXTENSION(EXT_ZERO_INITIALIZE_DEVICE_MEMORY, EXT_zero_initialize_device_memory),
VK_EXTENSION(EXT_SHADER_FLOAT8, EXT_shader_float8),
VK_EXTENSION_COND(EXT_DESCRIPTOR_HEAP, EXT_descriptor_heap, VKD3D_CONFIG_FLAG_STATIC(DESCRIPTOR_HEAP)),
VK_EXTENSION_DISABLE_COND(EXT_RAY_TRACING_INVOCATION_REORDER, EXT_ray_tracing_invocation_reorder, VKD3D_CONFIG_FLAG_STATIC(NO_DXR)),
VK_EXTENSION(EXT_SHADER_LONG_VECTOR, EXT_shader_long_vector),
/* AMD extensions */
VK_EXTENSION(AMD_BUFFER_MARKER, AMD_buffer_marker),
VK_EXTENSION(AMD_DEVICE_COHERENT_MEMORY, AMD_device_coherent_memory),
Expand Down Expand Up @@ -2709,6 +2711,22 @@ static void vkd3d_physical_device_info_init(struct vkd3d_physical_device_info *i
vk_prepend_struct(&info->features2, &info->dynamic_rendering_local_read_features);
}

if (vulkan_info->EXT_ray_tracing_invocation_reorder)
{
info->invocation_reorder_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_FEATURES_EXT;
info->invocation_reorder_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_INVOCATION_REORDER_PROPERTIES_EXT;
vk_prepend_struct(&info->features2, &info->invocation_reorder_features);
vk_prepend_struct(&info->properties2, &info->invocation_reorder_properties);
}

if (vulkan_info->EXT_shader_long_vector)
{
info->long_vector_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_LONG_VECTOR_FEATURES_EXT;
info->long_vector_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_LONG_VECTOR_PROPERTIES_EXT;
vk_prepend_struct(&info->features2, &info->long_vector_features);
vk_prepend_struct(&info->properties2, &info->long_vector_properties);
}

VK_CALL(vkGetPhysicalDeviceFeatures2(device->vk_physical_device, &info->features2));
VK_CALL(vkGetPhysicalDeviceProperties2(device->vk_physical_device, &info->properties2));

Expand Down Expand Up @@ -10602,7 +10620,8 @@ static void d3d12_device_caps_init_feature_options22(struct d3d12_device *device
options22->CreateByteOffsetViewsSupported =
d3d12_device_use_descriptor_heap(device) || d3d12_device_uses_descriptor_buffers(device);

options22->ShaderExecutionReorderingActuallyReorders = FALSE; /* TODO: Forward SER property. */
options22->ShaderExecutionReorderingActuallyReorders = device->d3d12_caps.max_shader_model >= D3D_SHADER_MODEL_6_9 ?
device->device_info.invocation_reorder_properties.rayTracingInvocationReorderReorderingHint == VK_RAY_TRACING_INVOCATION_REORDER_MODE_REORDER_EXT : FALSE;
options22->Max1DDispatchSize = device->device_info.properties2.properties.limits.maxComputeWorkGroupCount[0];
options22->Max1DDispatchMeshSize = device->device_info.mesh_shader_properties.maxMeshWorkGroupCount[0];
}
Expand Down Expand Up @@ -10892,6 +10911,25 @@ static void d3d12_device_caps_init_shader_model(struct d3d12_device *device)
INFO("Enabling support for SM 6.8.\n");
device->d3d12_caps.max_shader_model = D3D_SHADER_MODEL_6_8;
}

/* SM6.9 adds:
* - RayQuery micromap flags
* - General vector support (SPIR-V 1.0 already supports that)
* - Long vector (hnnnnng)
* - Shader Execution Reordering
* - 16/64-bit is{inf,nan,normal} etc
*/
if (device->d3d12_caps.max_shader_model == D3D_SHADER_MODEL_6_8 &&
device->device_info.opacity_micromap_features.micromap &&
/* For maint9 bitops which support 16-bit / 64-bit. Needed for vector version of these. */
device->device_info.maintenance_9_features.maintenance9 &&
device->device_info.long_vector_features.longVector &&
device->device_info.long_vector_properties.maxVectorComponents >= 1024 &&
device->device_info.invocation_reorder_features.rayTracingInvocationReorder)
{
INFO("Enabling experimental support for SM 6.9.\n");
device->d3d12_caps.max_shader_model = D3D_SHADER_MODEL_6_9;
}
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions libs/vkd3d/vkd3d_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ struct vkd3d_vulkan_info
bool EXT_shader_float8;
bool EXT_present_timing;
bool EXT_descriptor_heap;
bool EXT_ray_tracing_invocation_reorder;
bool EXT_shader_long_vector;
/* AMD device extensions */
bool AMD_buffer_marker;
bool AMD_device_coherent_memory;
Expand Down Expand Up @@ -5352,6 +5354,8 @@ struct vkd3d_physical_device_info
VkPhysicalDeviceLineRasterizationPropertiesEXT line_rasterization_properties;
VkPhysicalDeviceComputeShaderDerivativesPropertiesKHR compute_shader_derivatives_properties_khr;
VkPhysicalDeviceCooperativeMatrixPropertiesKHR cooperative_matrix_properties;
VkPhysicalDeviceRayTracingInvocationReorderPropertiesEXT invocation_reorder_properties;
VkPhysicalDeviceShaderLongVectorPropertiesEXT long_vector_properties;

VkPhysicalDeviceProperties2KHR properties2;

Expand Down Expand Up @@ -5430,6 +5434,8 @@ struct vkd3d_physical_device_info
VkPhysicalDeviceDeviceAddressCommandsFeaturesKHR device_address_commands_features;
VkPhysicalDeviceShaderFloatControls2FeaturesKHR float_controls2_features;
VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR dynamic_rendering_local_read_features;
VkPhysicalDeviceRayTracingInvocationReorderFeaturesEXT invocation_reorder_features;
VkPhysicalDeviceShaderLongVectorFeaturesEXT long_vector_features;

VkPhysicalDeviceFeatures2 features2;

Expand Down
2 changes: 1 addition & 1 deletion subprojects/dxil-spirv
Submodule dxil-spirv updated 157 files
Loading
Loading