Welcome, Guest.
Username: Password: Remember me

TOPIC: Bloodrayne & Bloodrayne 2

Bloodrayne & Bloodrayne 2 1 year 4 months ago #1

  • paxton676
  • paxton676's Avatar
  • Offline
  • Posts: 72
  • Thank you received: 10
Anyone get Reshade and Bloodrayne working?

For me, the game crashes on startup and says error in 3D subsystem. I tried the steam exe , retail exe, enb injector, and just renaming the reshade dll to d3d8. All give same error so it seems there is some conflict with Reshade and the game.

The Reshade log error is this:

03/08/2015 23:23:34:252 [02520] | ERROR | > Failed to reassemble shader:

C:\Program Files (x86)\Steam\steamapps\common\BloodRayne\memory(158,1): error X5349: Number of instruction slots used too high: 142. Max. allowed is 128.


The game error log is this:

Video card error message

DirectX error
Code: 80004005
Description: An undetermined error occurred inside the Direct3D subsystem.
While trying to do this: Vskelspc


Similar errors with Bloodrayne 2

The Reshade log error is this:

03/08/2015 23:58:33:019 [05912] | ERROR | > Failed to reassemble shader:

C:\Program Files (x86)\Steam\steamapps\common\BloodRayne 2\memory(159,1): error X5349: Number of instruction slots used too high: 143. Max. allowed is 128.

The game error log is this:

Msg: DirectX error
Code: 80004005
Description: An undetermined error occurred inside the Direct3D subsystem.
While trying to do this: Vskelspc
File: rendd3d.cpp line 1198
Time: Mon Aug 3 23:58:33 2015
errno = 4 (Bad file number)
Last Edit: 1 year 4 months ago by paxton676.
The administrator has disabled public write access.

Bloodrayne & Bloodrayne 2 1 year 3 months ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2438
  • Thank you received: 1387
Looks like the D3D9 shader ReShade generates out of the D3D8 shader is too complex, the D3D9 driver only allows shaders with less instructions. That's because ReShade has to add a few instructions in various places to make the shader assembly code compatible and if the game shader already used up the available instructions slots there are no more left. Could you post the assembly code for the shader giving that error? It can be found in the trace log, right next to the error message.
Cheers, crosire =)
The administrator has disabled public write access.

Bloodrayne & Bloodrayne 2 1 year 3 months ago #3

  • paxton676
  • paxton676's Avatar
  • Offline
  • Posts: 72
  • Thank you received: 10
I hope this is what you wanted, not sure. :)



vs_1_1
dcl_position1 v15
dcl_position v0
dcl_blendweight v1
dcl_blendindices v2
dcl_normal v3
dcl_psize v4
dcl_color v5
dcl_color1 v6
dcl_texcoord v7
dcl_texcoord1 v8
dcl_texcoord2 v9
def c95, 0, 0, 0, 0
mov r9, c95 /* initialize register r9 */
mov r8, c95 /* initialize register r8 */
mov r7, c95 /* initialize register r7 */
mov r6, c95 /* initialize register r6 */
mov r5, c95 /* initialize register r5 */
mov r4, c95 /* initialize register r4 */
mov r3, c95 /* initialize register r3 */
mov r2, c95 /* initialize register r2 */
mov r1, c95 /* initialize register r1 */
mov r0, c95 /* initialize register r0 */
mov oT1, c95 /* initialize output register oT1 */
mov oT0, c95 /* initialize output register oT0 */
mov oD1, c95 /* initialize output register oD1 */
mov oD0, c95 /* initialize output register oD0 */
mov a0.x, v6.x
dp4 r0.x, v0, c0[a0.x]
dp4 r0.y, v0, c1[a0.x]
dp4 r0.z, v0, c2[a0.x]
dp3 r1.x, v5, c0[a0.x]
dp3 r1.y, v5, c1[a0.x]
dp3 r1.z, v5, c2[a0.x]
dp3 r2.x, v8, c0[a0.x]
dp3 r2.y, v8, c1[a0.x]
dp3 r2.z, v8, c2[a0.x]
dp3 r3.x, v9, c0[a0.x]
dp3 r3.y, v9, c1[a0.x]
dp3 r3.z, v9, c2[a0.x]
mov a0.x, v6.y
dp4 r4.x, v1, c0[a0.x]
dp4 r4.y, v1, c1[a0.x]
dp4 r4.z, v1, c2[a0.x]
dp3 r5.x, v5, c0[a0.x]
dp3 r5.y, v5, c1[a0.x]
dp3 r5.z, v5, c2[a0.x]
dp3 r6.x, v8, c0[a0.x]
dp3 r6.y, v8, c1[a0.x]
dp3 r6.z, v8, c2[a0.x]
dp3 r7.x, v9, c0[a0.x]
dp3 r7.y, v9, c1[a0.x]
dp3 r7.z, v9, c2[a0.x]
mul r0.xyz, r0.xyzz, v4.x
mul r1.xyz, r1.xyzz, v4.x
mul r2.xyz, r2.xyzz, v4.x
mul r3.xyz, r3.xyzz, v4.x
mul r4.xyz, r4.xyzz, v4.y
mul r5.xyz, r5.xyzz, v4.y
mul r6.xyz, r6.xyzz, v4.y
mul r7.xyz, r7.xyzz, v4.y
add r0.xyz, r0.xyzz, r4.xyzz
add r1.xyz, r1.xyzz, r5.xyzz
add r2.xyz, r2.xyzz, r6.xyzz
add r3.xyz, r3.xyzz, r7.xyzz
mov a0.x, v6.z
dp4 r4.x, v2, c0[a0.x]
dp4 r4.y, v2, c1[a0.x]
dp4 r4.z, v2, c2[a0.x]
dp3 r5.x, v5, c0[a0.x]
dp3 r5.y, v5, c1[a0.x]
dp3 r5.z, v5, c2[a0.x]
dp3 r6.x, v8, c0[a0.x]
dp3 r6.y, v8, c1[a0.x]
dp3 r6.z, v8, c2[a0.x]
dp3 r7.x, v9, c0[a0.x]
dp3 r7.y, v9, c1[a0.x]
dp3 r7.z, v9, c2[a0.x]
mul r4.xyz, r4.xyzz, v4.z
mul r5.xyz, r5.xyzz, v4.z
mul r6.xyz, r6.xyzz, v4.z
mul r7.xyz, r7.xyzz, v4.z
add r0.xyz, r0.xyzz, r4.xyzz
add r1.xyz, r1.xyzz, r5.xyzz
add r2.xyz, r2.xyzz, r6.xyzz
add r3.xyz, r3.xyzz, r7.xyzz
mov a0.x, v6.w
dp4 r4.x, v3, c0[a0.x]
dp4 r4.y, v3, c1[a0.x]
dp4 r4.z, v3, c2[a0.x]
dp3 r5.x, v5, c0[a0.x]
dp3 r5.y, v5, c1[a0.x]
dp3 r5.z, v5, c2[a0.x]
dp3 r6.x, v8, c0[a0.x]
dp3 r6.y, v8, c1[a0.x]
dp3 r6.z, v8, c2[a0.x]
dp3 r7.x, v9, c0[a0.x]
dp3 r7.y, v9, c1[a0.x]
dp3 r7.z, v9, c2[a0.x]
mul r4.xyz, r4.xyzz, v4.w
mul r5.xyz, r5.xyzz, v4.w
mul r6.xyz, r6.xyzz, v4.w
mul r7.xyz, r7.xyzz, v4.w
add r0.xyz, r0.xyzz, r4.xyzz
add r8.xyz, r2.xyzz, r6.xyzz
add r9.xyz, r3.xyzz, r7.xyzz
add r7.xyz, r1.xyzz, r5.xyzz
mov r0.w, c5.y
dp4 oPos.x, r0, c0
dp4 oPos.y, r0, c1
dp4 oPos.z, r0, c2
dp4 oPos.w, r0, c3
mov oT0, v7
mov oT1, v7
dp3 r7.w, r7, r7
rsq r7.w, r7.w
mul r7, r7, r7.w
dp3 r8.w, r8, r8
rsq r8.w, r8.w
mul r8, r8, r8.w
dp3 r9.w, r9, r9
rsq r9.w, r9.w
mul r9, r9, r9.w
add r1, c9, -r0
dp3 r1.w, r1, r1
rsq r1.w, r1.w
mul r1, r1, r1.w
add r2, c4, r1
dp3 r2.w, r2, r2
rsq r2.w, r2.w
mul r2, r2, r2.w
mul r0.xyz, r8.yzxx, r9.zxyy
mad r0.xyz, -r8.zxyy, r9.yzxx, r0.xyzz
dp3 r1.x, r2, r8
dp3 r1.y, r2, r9
dp3 r1.z, r2, r0
dp3 r2.x, r7, r0
sge r3.x, r2.x, c5.x
add r3.x, r3.x, r3.x
add r3.x, r3.x, -c5.y
mul r1.z, r1.z, r3.x
mad oD0.xyz, r1, c5.z, c5.z
mov oD0.w, c5.y
dp4 r0.z, v0, c2
add r0.z, r0.z, -c6.x
mul r0.z, r0.z, c6.y
max r0.z, r0.z, c5.x
min r0.w, r0.z, c5.y
add r0.w, c5.y, -r0.w
mul oD0.w, r0.w, c5.w
mov oFog /* removed swizzle */, c5.y
mov oD1.x, c8.x
mov oD1.y, c21.x
mov oD1.z, c23.x
mov oD1.w, c5.w

// approximately 128 instruction slots used

08/08/2015 09:11:42:935 [04480] | ERROR | > Failed to reassemble shader:

C:\Program Files (x86)\Steam\steamapps\common\BloodRayne\memory(158,1): error X5349: Number of instruction slots used too high: 142. Max. allowed is 128.
Last Edit: 1 year 3 months ago by paxton676.
The administrator has disabled public write access.

Bloodrayne & Bloodrayne 2 1 year 3 months ago #4

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 2438
  • Thank you received: 1387
Yes, that was it. And as expected, the original shader already uses 128 instruction slots. ReShade added the following code to the beginning:
mov r9, c95 /* initialize register r9 */
mov r8, c95 /* initialize register r8 */
mov r7, c95 /* initialize register r7 */
mov r6, c95 /* initialize register r6 */
mov r5, c95 /* initialize register r5 */
mov r4, c95 /* initialize register r4 */
mov r3, c95 /* initialize register r3 */
mov r2, c95 /* initialize register r2 */
mov r1, c95 /* initialize register r1 */
mov r0, c95 /* initialize register r0 */
mov oT1, c95 /* initialize output register oT1 */
mov oT0, c95 /* initialize output register oT0 */
mov oD1, c95 /* initialize output register oD1 */
mov oD0, c95 /* initialize output register oD0 */
Another 14 instructions, which make the 142 instructions the driver is complaining about. Unfortunately those are required, because while D3D8 allows the following for instance, D3D9 doesn't. It fails to reassemble complaining about the access to an uninitialized register (because the code only writes to the first component, but the other three are left unitialized to a random value if not filled with a fixed value beforehand, which is what the above code does):
mov oD1.x, c8.x

The 128 instructions cap is a limitation of vertex shader model 1.1, version 2.0 increased it to 256. So changing the shader model might work, but forcing it could cause other problems (I think I ran into some major issues with Max Payne 1/2 here when I tried).
Cheers, crosire =)
The administrator has disabled public write access.