mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 03:59:59 -04:00
Mesh emulation: the vertex shader declares the fragment shader's inputs one for one.
The generated vertex shader wrote one vector per location. A fragment shader that packs two inputs into one location (Component decorations: a vec2 at component 0 and another at component 2) then had nothing matching its second input, whose value is undefined: wrong colours on the emulated foliage. The vertex shader now declares an output for every input variable of the fragment shader, with its Location, Component, type and Flat, filled from those components of the mesh stage's vector at that location (zero where the mesh stage writes none). (cherry picked from commit c38eb31889314ebfb164ff9dffad5796eba46ed4) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3257,6 +3257,9 @@ static VkPipeline create_graphics(const VkPipeState *s, const GKey *k, const Lay
|
||||
cp[i] = need >> i & 1 && !fin[i].packed && fin[i].comps ? (uint8_t)fin[i].comps : 4;
|
||||
}
|
||||
size_t vn = 0;
|
||||
uint64_t fsw = 0;
|
||||
const uint32_t *fcode0 = s->fs ? gfx_shader_spirv(s->fs, &fsw) : NULL;
|
||||
vpatched = mesh_emu_vs(&me->mi, need, ty, cp, fcode0, (size_t)fsw, &vn);
|
||||
if (!vpatched) return VK_NULL_HANDLE;
|
||||
vcode = vpatched, vw = vn;
|
||||
mesh = 0; // a vertex pipeline from here on
|
||||
|
||||
Reference in New Issue
Block a user