Project

General

Profile

Actions

Emulator Issues #13582

open

Mario Kart Wii Custom Track Causes a Shader Error on Dolpin, Works on Console

Added by p00ks 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name?

Mario Kart Wii

Game ID? (right click the game in the game list, Properties, Info tab)

RMCE01

MD5 Hash? (right click the game in the game list, Properties, Verify tab, Verify Integrity button)

bb7f2c926cbcdee65e2a48b7002a52ea

What's the problem? Describe what went wrong.

A custom track that works fine on console gives a shader error on emulator, the error will additionally appear upon launching the game every time until the shader cache is cleared.

What steps will reproduce the problem?

[Playing the track https://wiki.tockdom.com/wiki/Punch_City_2_(Marianne8559) will cause the error, it occurs both in distributions and when played through an extracted game]

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

Unsure, Only played on Release

Is the issue present in the latest release? For future reference, please also write down the version number of the latest release.

Yes, Dolphin 2407

If the issue isn't present in the latest release, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

[First broken version number here (if applicable)]

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

[Attach any fifologs if possible, write a description of fifologs and screenshots here to assist people unfamiliar with the game.]

What are your PC specifications? (CPU, GPU, Operating System, more)

Windows 10
Intel(R) Core(TM) i5-10400F CPU @ 2.90GHz 2.90 GHz
Nvidia 3060 GPU
16GB Ram

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

bad_vs_vulkan_0

// Target GLSL 4.5.
#version 450 core
#define ATTRIBUTE_LOCATION(x) layout(location = x)
#define FRAGMENT_OUTPUT_LOCATION(x) layout(location = x)
#define FRAGMENT_OUTPUT_LOCATION_INDEXED(x, y) layout(location = x, index = y)
#define UBO_BINDING(packing, x) layout(packing, set = 0, binding = (x - 1))
#define SAMPLER_BINDING(x) layout(set = 1, binding = x)
#define TEXEL_BUFFER_BINDING(x) layout(set = 1, binding = (x + 8))
#define SSBO_BINDING(x) layout(std430, set = 2, binding = x)
#define INPUT_ATTACHMENT_BINDING(x, y, z) layout(set = x, binding = y, input_attachment_index = z)
#define VARYING_LOCATION(x) layout(location = x)
#define FORCE_EARLY_Z layout(early_fragment_tests) in

// Metal framebuffer fetch helpers.
#define FB_FETCH_VALUE subpassLoad(in_ocol0)

// hlsl to glsl function translation
#define API_VULKAN 1
#define float2 vec2
#define float3 vec3
#define float4 vec4
#define uint2 uvec2
#define uint3 uvec3
#define uint4 uvec4
#define int2 ivec2
#define int3 ivec3
#define int4 ivec4
#define frac fract
#define lerp mix

// These were changed in Vulkan
#define gl_VertexID gl_VertexIndex
#define gl_InstanceID gl_InstanceIndex

#extension GL_KHR_shader_subgroup_basic : enable
#extension GL_KHR_shader_subgroup_arithmetic : enable
#extension GL_KHR_shader_subgroup_ballot : enable
#extension GL_KHR_shader_subgroup_shuffle : enable

#define SUPPORTS_SUBGROUP_REDUCTION 1
#define IS_HELPER_INVOCATION gl_HelperInvocation
#define IS_FIRST_ACTIVE_INVOCATION (subgroupElect())
#define SUBGROUP_MIN(value) value = subgroupMin(value)
#define SUBGROUP_MAX(value) value = subgroupMax(value)
struct Light {
int4 color;
float4 cosatt;
float4 distatt;
float4 pos;
float4 dir;
};
UBO_BINDING(std140, 2) uniform VSBlock {
uint components;
uint xfmem_dualTexInfo;
uint xfmem_numColorChans;
uint missing_color_hex;
float4 missing_color_value;
float4 cpnmtx[6];
float4 cproj[4];
int4 cmtrl[4];
Light clights[8];
float4 ctexmtx[24];
float4 ctrmtx[64];
float4 cnmtx[32];
float4 cpostmtx[64];
float4 cpixelcenter;
float2 cviewport;
uint4 xfmem_pack1[8];
float4 ctangent;
float4 cbinormal;
uint vertex_stride;
uint vertex_offset_rawnormal;
uint vertex_offset_rawtangent;
uint vertex_offset_rawbinormal;
uint vertex_offset_rawpos;
uint vertex_offset_posmtx;
uint vertex_offset_rawcolor0;
uint vertex_offset_rawcolor1;
uint4 vertex_offset_rawtex[2];
#define xfmem_texMtxInfo(i) (xfmem_pack1[(i)].x)
#define xfmem_postMtxInfo(i) (xfmem_pack1[(i)].y)
#define xfmem_color(i) (xfmem_pack1[(i)].z)
#define xfmem_alpha(i) (xfmem_pack1[(i)].w)
};
struct VS_OUTPUT {
float4 pos;
float4 colors_0;
float4 colors_1;
float clipDist0;
float clipDist1;
float3 tex0;
float3 tex1;
float3 tex2;
};

#define dolphin_isnan(f) isnan(f)
ATTRIBUTE_LOCATION(0x0u /* Position /) in float4 rawpos;
ATTRIBUTE_LOCATION(0x2u /
Normal /) in float3 rawnormal;
ATTRIBUTE_LOCATION(0x5u /
Color 0 /) in float4 rawcolor0;
ATTRIBUTE_LOCATION(0x6u /
Color 1 /) in float4 rawcolor1;
ATTRIBUTE_LOCATION(0x8u /
Tex Coord 0 /) in float2 rawtex0;
ATTRIBUTE_LOCATION(0x9u /
Tex Coord 1 */) in float2 rawtex1;
VARYING_LOCATION(0) out VertexData {
float4 pos;
float4 colors_0;
float4 colors_1;
float clipDist0;
float clipDist1;
float3 tex0;
float3 tex1;
float3 tex2;
} vs;
void main()
{
VS_OUTPUT o;
float4 vertex_color_0, vertex_color_1;
vertex_color_0 = rawcolor0;
vertex_color_1 = rawcolor1;
float4 P0 = cpnmtx[0];
float4 P1 = cpnmtx[1];
float4 P2 = cpnmtx[2];
float3 N0 = cpnmtx[3].xyz;
float3 N1 = cpnmtx[4].xyz;
float3 N2 = cpnmtx[5].xyz;
// Multiply the position vector by the position matrix
float4 pos = float4(dot(P0, rawpos), dot(P1, rawpos), dot(P2, rawpos), 1.0);
float3 rawtangent = ctangent.xyz;
float3 rawbinormal = cbinormal.xyz;
float3 _normal = normalize(float3(dot(N0, rawnormal), dot(N1, rawnormal), dot(N2, rawnormal)));
float3 _tangent = float3(dot(N0, rawtangent), dot(N1, rawtangent), dot(N2, rawtangent));
float3 _binormal = float3(dot(N0, rawbinormal), dot(N1, rawbinormal), dot(N2, rawbinormal));
o.pos = float4(dot(cproj[0], pos), dot(cproj[1], pos), dot(cproj[2], pos), dot(cproj[3], pos));
int4 lacc;
float3 ldir, h, cosAttn, distAttn;
float dist, dist2, attn;
{
int4 mat = int4(round(vertex_color_0 * 255.0));
lacc = int4(255, 255, 255, 255);
lacc.w = 255;
lacc = clamp(lacc, 0, 255);
o.colors_0 = float4((mat * (lacc + (lacc >> 7))) >> 8) / 255.0;
}
{
int4 mat = cmtrl[3];
lacc = int4(255, 255, 255, 255);
lacc.w = 255;
lacc = clamp(lacc, 0, 255);
o.colors_1 = float4((mat * (lacc + (lacc >> 7))) >> 8) / 255.0;
}
float4 coord = float4(0.0, 0.0, 1.0, 1.0);
{
coord = float4(0.0, 0.0, 1.0, 1.0);
coord = float4(rawtex0.x, rawtex0.y, 1.0, 1.0);
coord.z = 1.0;
// Convert NaN to 1
if (dolphin_isnan(coord.x)) coord.x = 1.0;
if (dolphin_isnan(coord.y)) coord.y = 1.0;
if (dolphin_isnan(coord.z)) coord.z = 1.0;
o.tex0.xyz = float3(dot(coord, ctexmtx[0]), dot(coord, ctexmtx[1]), 1);
float4 P0 = cpostmtx[0];
float4 P1 = cpostmtx[1];
float4 P2 = cpostmtx[2];
o.tex0.xyz = float3(dot(P0.xyz, o.tex0.xyz) + P0.w, dot(P1.xyz, o.tex0.xyz) + P1.w, dot(P2.xyz, o.tex0.xyz) + P2.w);
if(o.tex0.z == 0.0f)
o.tex0.xy = clamp(o.tex0.xy / 2.0f, float2(-1.0f,-1.0f), float2(1.0f,1.0f));
}
{
coord = float4(0.0, 0.0, 1.0, 1.0);
coord = float4(rawtex0.x, rawtex0.y, 1.0, 1.0);
coord.z = 1.0;
// Convert NaN to 1
if (dolphin_isnan(coord.x)) coord.x = 1.0;
if (dolphin_isnan(coord.y)) coord.y = 1.0;
if (dolphin_isnan(coord.z)) coord.z = 1.0;
o.tex1.xyz = float3(dot(coord, ctexmtx[3]), dot(coord, ctexmtx[4]), 1);
float4 P0 = cpostmtx[3];
float4 P1 = cpostmtx[4];
float4 P2 = cpostmtx[5];
o.tex1.xyz = float3(dot(P0.xyz, o.tex1.xyz) + P0.w, dot(P1.xyz, o.tex1.xyz) + P1.w, dot(P2.xyz, o.tex1.xyz) + P2.w);
if(o.tex1.z == 0.0f)
o.tex1.xy = clamp(o.tex1.xy / 2.0f, float2(-1.0f,-1.0f), float2(1.0f,1.0f));
}
{
coord = float4(0.0, 0.0, 1.0, 1.0);
coord.z = 1.0;
// Convert NaN to 1
if (dolphin_isnan(coord.x)) coord.x = 1.0;
if (dolphin_isnan(coord.y)) coord.y = 1.0;
if (dolphin_isnan(coord.z)) coord.z = 1.0;
ldir = normalize(clights[0].pos.xyz - pos.xyz);
o.tex2.xyz = o.tex5.xyz + float3(dot(ldir, _tangent), dot(ldir, _binormal), 0.0);
}
o.colors_1 = float4(0.0, 0.0, 0.0, 0.0);
float clipDepth = o.pos.z * (1.0 - 1e-7);
float clipDist0 = clipDepth + o.pos.w;
float clipDist1 = -clipDepth;
o.clipDist0 = clipDist0;
o.clipDist1 = clipDist1;
o.pos.z = o.pos.w * cpixelcenter.w - o.pos.z * cpixelcenter.z;
o.pos.xy *= sign(cpixelcenter.xy * float2(1.0, -1.0));
o.pos.xy = o.pos.xy - o.pos.w * cpixelcenter.xy;
vs.pos = o.pos;
vs.colors_0 = o.colors_0;
vs.colors_1 = o.colors_1;
vs.tex0 = o.tex0;
vs.tex1 = o.tex1;
vs.tex2 = o.tex2;
vs.clipDist0 = o.clipDist0;
vs.clipDist1 = o.clipDist1;
gl_ClipDistance[0] = clipDist0;
gl_ClipDistance[1] = clipDist1;
gl_Position = float4(o.pos.x, -o.pos.y, o.pos.z, o.pos.w);
}

Failed to parse shader
Shader Info Log:
ERROR: 0:192: 'tex5' : no such field in structure 'o'
ERROR: 0:192: 'assign' : cannot convert from ' temp structure{ global highp 4-component vector of float pos, global highp 4-component vector of float colors_0, global highp 4-component vector of float colors_1, global highp float clipDist0, global highp float clipDist1, global highp 3-component vector of float tex0, global highp 3-component vector of float tex1, global highp 3-component vector of float tex2}' to ' temp highp 3-component vector of float'
ERROR: 0:192: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.

Dolphin Version: Dolphin 2407
Video Backend: Vulkan

No data to display

Actions

Also available in: Atom PDF