Skip to content

Commit

Permalink
vkd3d: Add config flag to force precise math globally.
Browse files Browse the repository at this point in the history
Mostly for triaging game issues.
Some invariance issues exist outside just BuiltInPosition.

Signed-off-by: Hans-Kristian Arntzen <[email protected]>
  • Loading branch information
HansKristian-Work committed Jul 11, 2024
1 parent 5cd7260 commit 69f1665
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/vkd3d.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ extern "C" {
#define VKD3D_CONFIG_FLAG_DISABLE_NV_DGCC (1ull << 46)
#define VKD3D_CONFIG_FLAG_MEMORY_ALLOCATOR_SKIP_IMAGE_HEAP_CLEAR (1ull << 47)
#define VKD3D_CONFIG_FLAG_DRIVER_VERSION_SENSITIVE_SHADERS (1ull << 48)
#define VKD3D_CONFIG_FLAG_FORCE_NOCONTRACTION (1ull << 49)

struct vkd3d_instance;

Expand Down
2 changes: 2 additions & 0 deletions libs/vkd3d/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ static void vkd3d_instance_apply_global_shader_quirks(void)
static const struct override overrides[] =
{
{ VKD3D_CONFIG_FLAG_FORCE_NO_INVARIANT_POSITION, VKD3D_SHADER_QUIRK_INVARIANT_POSITION, true },
{ VKD3D_CONFIG_FLAG_FORCE_NOCONTRACTION, VKD3D_SHADER_QUIRK_FORCE_NOCONTRACT_MATH, false },
};
uint64_t eq_test;
unsigned int i;
Expand Down Expand Up @@ -932,6 +933,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},
{"force_nocontraction", VKD3D_CONFIG_FLAG_FORCE_NOCONTRACTION},
};

static void vkd3d_config_flags_init_once(void)
Expand Down

0 comments on commit 69f1665

Please sign in to comment.