Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add config flag to disable SSBO alignment workaround #1983

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions include/vkd3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ extern "C" {
#define VKD3D_CONFIG_FLAG_DISABLE_DEPTH_COMPRESSION (1ull << 44)
#define VKD3D_CONFIG_FLAG_DISABLE_COLOR_COMPRESSION (1ull << 45)
#define VKD3D_CONFIG_FLAG_DISABLE_NV_DGCC (1ull << 46)
#define VKD3D_CONFIG_FLAG_FORCE_NO_SSBO_ALIGNMENT (1ull << 47)

struct vkd3d_instance;

Expand Down
4 changes: 3 additions & 1 deletion libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,7 @@ static const struct vkd3d_debug_option vkd3d_config_options[] =
{"disable_depth_compression", VKD3D_CONFIG_FLAG_DISABLE_DEPTH_COMPRESSION},
{"disable_color_compression", VKD3D_CONFIG_FLAG_DISABLE_COLOR_COMPRESSION},
{"app_debug_marker_only", VKD3D_CONFIG_FLAG_APP_DEBUG_MARKER_ONLY},
{"no_ssbo_alignment", VKD3D_CONFIG_FLAG_FORCE_NO_SSBO_ALIGNMENT},
};

static void vkd3d_config_flags_init_once(void)
Expand Down Expand Up @@ -1419,7 +1420,8 @@ static void vkd3d_physical_device_info_apply_workarounds(struct vkd3d_physical_d
* use vectorized load-stores. When we emit vectorized load-store ops,
* the storage buffer must be aligned properly, so this is fine in practice
* and is a nice speed boost. */
if (info->vulkan_1_2_properties.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY)
if (!(vkd3d_config_flags & VKD3D_CONFIG_FLAG_FORCE_NO_SSBO_ALIGNMENT) &&
info->vulkan_1_2_properties.driverID == VK_DRIVER_ID_NVIDIA_PROPRIETARY)
info->properties2.properties.limits.minStorageBufferOffsetAlignment = 4;

/* UE5 is broken and assumes that if mesh shaders are supported, barycentrics are also supported.
Expand Down