mojoshader icon indicating copy to clipboard operation
mojoshader copied to clipboard

[glsl] mova not implemented

Open kg opened this issue 5 years ago • 2 comments

In some specific cases, fxc will emit the mova instruction, which moves a float or int value into the a0 address register (which is an integer).

So the source assembly would look like:

dcl_blendindices v6
mova a0.x, v6.x

However, right now the generated GLSL looks like this:

vec4 vs_r1;
ivec4 vs_a0;

// error C7011: implicit cast from "float" to "int"
vs_a0.x = vs_r1.z;

Should be an easy fix, just ensure that we do an explicit cast when handling mova.

kg avatar Jun 07 '20 16:06 kg

This is where the important stuff starts:

https://github.com/FNA-XNA/MojoShader/blob/upstream/profiles/mojoshader_profile_glsl.c#L258

We also need the shader binary in question.

flibitijibibo avatar Jun 07 '20 16:06 flibitijibibo

Whoops, it’s actually its own function:

https://github.com/FNA-XNA/MojoShader/blob/upstream/profiles/mojoshader_profile_glsl.c#L1670

flibitijibibo avatar Jun 07 '20 16:06 flibitijibibo