Skip to content
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
6 changes: 6 additions & 0 deletions src/vulkan/wrapper/wrapper_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1230,6 +1230,12 @@ wrapper_emit_diag(struct wrapper_physical_device *pdev,
D("engine: '%s' -> detected %s (app '%s')\n", eng, detected,
pdev->instance->vk.app_info.app_name ? pdev->instance->vk.app_info.app_name : "");
D("--- native capabilities (what THIS device actually has) ---\n");
D(" fillModeNonSolid : native=%d advertised=%d\n",
pdev->base_supported_features.fillModeNonSolid,
pdev->vk.supported_features.fillModeNonSolid);
D(" shaderClipDistance : native=%d advertised=%d\n",
pdev->base_supported_features.shaderClipDistance,
pdev->vk.supported_features.shaderClipDistance);
D(" textureCompressionBC : %d\n", pdev->base_supported_features.textureCompressionBC);
D(" textureCompressionASTC_LDR : %d\n", pdev->base_supported_features.textureCompressionASTC_LDR);
D(" robustBufferAccess2 : %d\n", pdev->base_supported_features.robustBufferAccess2);
Expand Down
7 changes: 7 additions & 0 deletions src/vulkan/wrapper/wrapper_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ void write_to_logfile(const char *fmt, const char *level, ...) {

void init_wrapper_logging()
{
/* Diagnostic package: keep the existing capability/format/copy probes on
* even when the launcher does not pass the guest diagnostic environment
* through to the native OpenGL/Zink driver process. */
setenv("WRAPPER_DIAG", "1", 1);
fprintf(stderr, "[WRAPPER_DIAG] isaac-wrapper-diagnostic-1 loaded; automatic capability/format/copy capture enabled\n");
fflush(stderr);

char *wrapper_log_level_env = getenv("WRAPPER_LOG_LEVEL");
parse_wrapper_debug_str(wrapper_log_level_env);

Expand Down
34 changes: 34 additions & 0 deletions src/vulkan/wrapper/wrapper_physical_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,27 @@
#include "util/os_misc.h"
#include "util/u_debug.h"

static bool
wrapper_zink_discard_workaround(const struct wrapper_physical_device *pdevice)
{
const char *engine = pdevice->instance->vk.app_info.engine_name;
return engine && !strcmp(engine, "mesa zink") &&
pdevice->driver_properties.driverID == VK_DRIVER_ID_ARM_PROPRIETARY &&
pdevice->properties2.properties.deviceID == 0xd8300010;
}

static void
wrapper_zink_discard_cache_uuid(const struct wrapper_physical_device *pdevice,
VkPhysicalDeviceProperties *properties)
{
/* Zink keys both its NIR/SPIR-V and pipeline disk caches with this UUID.
* Separate the discard variant from shaders compiled with demote enabled.
* Native pipeline cache blobs still pass through to the same base driver.
*/
if (wrapper_zink_discard_workaround(pdevice))
properties->pipelineCacheUUID[0] ^= 0xd1;
}

static uint32_t
parse_vk_version_from_env_named(const char *name)
{
Expand Down Expand Up @@ -438,6 +459,17 @@ VkResult enumerate_physical_device(struct vk_instance *_instance)
const uint32_t engine_version = instance->vk.app_info.engine_version;
const uint32_t driver_version = pdevice->properties2.properties.driverVersion;

/* Comparison build for RGB flicker with Zink fragment discard on G925.
* Mask the feature as well as the extension: it is promoted in Vulkan
* 1.3, so hiding only the extension can leave the core path available.
* Keep base capabilities intact; Zink generates the fallback itself.
*/
if (wrapper_zink_discard_workaround(pdevice)) {
pdevice->vk.supported_extensions.EXT_shader_demote_to_helper_invocation = false;
supported_features->shaderDemoteToHelperInvocation = false;
WRAPPER_LOG(info, "Zink discard comparison: demote extension and core feature hidden; separate shader cache");
}

/* DXVK forces hostQueryReset on from D3D_FEATURE_LEVEL_9_1 up, so a driver
* without it gets no D3D11 device at any level. Gated on the driver
* rather than on the engine name: the base-lacks guard already limits
Expand Down Expand Up @@ -767,6 +799,7 @@ wrapper_GetPhysicalDeviceProperties(VkPhysicalDevice physicalDevice,
VK_FROM_HANDLE(wrapper_physical_device, pdevice, physicalDevice);
pdevice->dispatch_table.GetPhysicalDeviceProperties(
pdevice->dispatch_handle, pProperties);
wrapper_zink_discard_cache_uuid(pdevice, pProperties);

uint32_t api_version =
wrapper_effective_api_version(pdevice, pProperties->apiVersion);
Expand Down Expand Up @@ -850,6 +883,7 @@ wrapper_GetPhysicalDeviceProperties2(VkPhysicalDevice physicalDevice,
VK_FROM_HANDLE(wrapper_physical_device, pdevice, physicalDevice);
pdevice->dispatch_table.GetPhysicalDeviceProperties2(
pdevice->dispatch_handle, pProperties);
wrapper_zink_discard_cache_uuid(pdevice, &pProperties->properties);

uint32_t api_version = wrapper_effective_api_version(
pdevice, pProperties->properties.apiVersion);
Expand Down
Loading