mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 00:29:58 -04:00
Port Ocarina of Time (Switch 2) to the recomp host
The NVN2 front end and the SM86 to Maxwell shader lowering (tools/xlate/AmpereLowering.cs, mesh and task stages, bindless texture pools, BRX jump tables, the NVN2 compute c0 layout) with four translator patches (0017-0020) bring the opening of the game to 58-60 fps on the Vulkan renderer. This round fixes the haze: SM86 IPA is lowered as a plain Maxwell IPA.PASS (texture coordinates were corrected for perspective twice); LDSM, TXD, both F2IP byte forms, HMMA, MOVM and HFMA2.RELU are lowered and spill mode has eight uniform register groups; conditional rendering keeps the newest counter report per address and treats a report as pending until its value is in guest memory, so occlusion tests and the depth clears around the depth copy behave; and the upscaler stand-in decodes the post pass's sRGB picture before writing the linear target. Tensor-core programs keep the stand-in unless NX2NAVI_NATIVE_TENSOR=1, because their lowering does not match the hardware yet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -217,6 +217,7 @@ typedef struct {
|
||||
VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT gpl;
|
||||
VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT fbl;
|
||||
VkPhysicalDeviceDynamicRenderingLocalReadFeaturesKHR lr;
|
||||
VkPhysicalDeviceMeshShaderFeaturesEXT mesh;
|
||||
} FeatureChain;
|
||||
|
||||
static int create_device(void) {
|
||||
@@ -251,6 +252,8 @@ static int create_device(void) {
|
||||
// Ryujinx's SPIR-V declares fragment shader interlock whenever the host reports it (vk_pipeline.c spirv_fixup).
|
||||
OPTIONAL_EXT(has_fragment_shader_interlock, VK_EXT_FRAGMENT_SHADER_INTERLOCK_EXTENSION_NAME, fsi,
|
||||
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_INTERLOCK_FEATURES_EXT);
|
||||
// NVN2 task and mesh programs (gameplay geometry) draw through VK_EXT_mesh_shader (vk_exec_draw.c op_draw_mesh)
|
||||
OPTIONAL_EXT(has_mesh_shader, VK_EXT_MESH_SHADER_EXTENSION_NAME, mesh, VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT);
|
||||
// Feedback loops (vk.h VkCtx.feedback): the layout, and barriers inside dynamic rendering
|
||||
int has_fbl = 0, has_lr = 0;
|
||||
if (has_ext(ep, ne, VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME) &&
|
||||
@@ -313,7 +316,14 @@ static int create_device(void) {
|
||||
else if (!h->geometryShader) miss = "geometryShader";
|
||||
else if (!h->textureCompressionBC) miss = "textureCompressionBC";
|
||||
if (miss) { rt_log("vk: required feature missing on %s: %s", g_vk.props.deviceName, miss); free(c); return 0; }
|
||||
if (!c->fault.deviceFault) g_vk.has_device_fault = 0; // vkGetDeviceFaultInfoEXT needs the feature, not just the extension
|
||||
if (!c->fault.deviceFault) g_vk.has_device_fault = 0;
|
||||
if (g_vk.has_mesh_shader) {
|
||||
// these two need features that are not enabled (multiview, primitive fragment shading rate)
|
||||
c->mesh.multiviewMeshShader = c->mesh.primitiveFragmentShadingRateMeshShader = VK_FALSE;
|
||||
c->mesh.meshShaderQueries = VK_FALSE;
|
||||
if (!c->mesh.meshShader || !c->mesh.taskShader) g_vk.has_mesh_shader = 0;
|
||||
rt_log("vk: mesh shaders: %s", g_vk.has_mesh_shader ? "VK_EXT_mesh_shader" : "not supported (task/mesh draws are skipped)");
|
||||
} // vkGetDeviceFaultInfoEXT needs the feature, not just the extension
|
||||
g_vk.has_buffer_device_address = c->f12.bufferDeviceAddress;
|
||||
g_vk.has_astc_ldr = h->textureCompressionASTC_LDR;
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user