crosire / d3d8to9

A D3D8 pseudo-driver which converts API calls and bytecode shaders to equivalent D3D9 ones.
BSD 2-Clause "Simplified" License
911 stars 83 forks source link

D3DXAssembleShader error on simple pixel shader #65

Closed PatrickvL closed 6 years ago

PatrickvL commented 6 years ago

On my NVIDIA Quadro M2000, given this input :

ps.1.3
mad r0, t1,v0,c0
mul r1, r0,t0
mov r0.rgb, r1
+sub r0.a, 1-v0,-v0

d3d8to9 generates this log :

Disassembling shader and translating assembly to Direct3D 9 compatible code ... Dumping translated shader assembly:

   ps_1_3
   mad r0, t1, v0, c0
   mul r1, r0, t0
   mov r0.xyz, r1
 + sub r0.w, 1-v0, -v0

// approximately 3 instruction slots used

Failed to reassemble shader:

[...]\build\win32\Debug\memory(2,5): error X5036: Read of uninitialized components(*) in t1: *r/0 *g/1 *b/2 *a/3 [...]\build\win32\Debug\memory(3,5): error X5036: Read of uninitialized components(*) in t0: *r/0 *g/1 *b/2 *a/3

What can be done to fix this?

PatrickvL commented 6 years ago

My bad - this was a mistake in my own code; "tex t0" and "tex t1" weren't generated... Please forgive my ignorance.