Song of the Deep
  1 / 2    
Excellent 3D used 3D-Hubplay profile. http://store.steampowered.com/app/460700/
Excellent 3D used 3D-Hubplay profile.


http://store.steampowered.com/app/460700/

Gigabyte Z370 Gaming 7 32GB Ram i9-9900K GigaByte Aorus Extreme Gaming 2080TI (single) Game Blaster Z Windows 10 X64 build #17763.195 Define R6 Blackout Case Corsair H110i GTX Sandisk 1TB (OS) SanDisk 2TB SSD (Games) Seagate EXOs 8 and 12 TB drives Samsung UN46c7000 HD TV Samsung UN55HU9000 UHD TVCurrently using ACER PASSIVE EDID override on 3D TVs LG 55

#1
Posted 07/12/2016 09:07 AM   
This game has style that fits great for 3d but I couldnt turn 3d on. Resolution choice only allows 60hz. How do I use 3D-Hubplay?
This game has style that fits great for 3d but I couldnt turn 3d on. Resolution choice only allows 60hz. How do I use 3D-Hubplay?

i5 2500K/16gb/GTX 970/Asus VG278H + Sony HMZ-T1

#2
Posted 07/12/2016 04:30 PM   
[quote="mindw0rk"]This game has style that fits great for 3d but I couldnt turn 3d on. Resolution choice only allows 60hz. How do I use 3D-Hubplay? [/quote] You must assign the game exe to the 3D-Hub Player profile using nvidiainspector.
mindw0rk said:This game has style that fits great for 3d but I couldnt turn 3d on. Resolution choice only allows 60hz. How do I use 3D-Hubplay?


You must assign the game exe to the 3D-Hub Player profile using nvidiainspector.

Gigabyte Z370 Gaming 7 32GB Ram i9-9900K GigaByte Aorus Extreme Gaming 2080TI (single) Game Blaster Z Windows 10 X64 build #17763.195 Define R6 Blackout Case Corsair H110i GTX Sandisk 1TB (OS) SanDisk 2TB SSD (Games) Seagate EXOs 8 and 12 TB drives Samsung UN46c7000 HD TV Samsung UN55HU9000 UHD TVCurrently using ACER PASSIVE EDID override on 3D TVs LG 55

#3
Posted 07/12/2016 05:02 PM   
I did but this didnt work for me. 3D didnt activate
I did but this didnt work for me. 3D didnt activate

i5 2500K/16gb/GTX 970/Asus VG278H + Sony HMZ-T1

#4
Posted 07/12/2016 06:21 PM   
[quote="mindw0rk"]I did but this didnt work for me. 3D didnt activate[/quote] I had the same problem before assigning the game exe to 3D-Hub Player profile the reason possible I'm working is probably because of EDID override to Samsung UN55HU9000 I found what works fine for me doesn't always work for everyone. The game uses the unity engine which always has a full-screen problem.
mindw0rk said:I did but this didnt work for me. 3D didnt activate


I had the same problem before assigning the game exe to 3D-Hub Player profile the reason possible I'm working is probably because of EDID override to Samsung UN55HU9000 I found what works fine for me doesn't always work for everyone.

The game uses the unity engine which always has a full-screen problem.

Gigabyte Z370 Gaming 7 32GB Ram i9-9900K GigaByte Aorus Extreme Gaming 2080TI (single) Game Blaster Z Windows 10 X64 build #17763.195 Define R6 Blackout Case Corsair H110i GTX Sandisk 1TB (OS) SanDisk 2TB SSD (Games) Seagate EXOs 8 and 12 TB drives Samsung UN46c7000 HD TV Samsung UN55HU9000 UHD TVCurrently using ACER PASSIVE EDID override on 3D TVs LG 55

#5
Posted 07/12/2016 06:42 PM   
I just watched GB's quick look of the game and thought the style seemed a perfect fit for 3D vision. I'll keep an eye on this pupper in the future.
I just watched GB's quick look of the game and thought the style seemed a perfect fit for 3D vision. I'll keep an eye on this pupper in the future.

#6
Posted 07/13/2016 06:00 PM   
mindw0rk - I Couldn't get 3D to activate as Unity engine wouldn't go into fullscreen. Adding command line "-window-mode exclusive" to Steam launch options fixed this ;) Game looks great in 3D.
mindw0rk - I Couldn't get 3D to activate as Unity engine wouldn't go into fullscreen. Adding command line "-window-mode exclusive" to Steam launch options fixed this ;) Game looks great in 3D.

#7
Posted 07/26/2016 08:42 AM   
[quote="TonyBirt"]mindw0rk - I Couldn't get 3D to activate as Unity engine wouldn't go into fullscreen. Adding command line "-window-mode exclusive" to Steam launch options fixed this ;) Game looks great in 3D.[/quote] Thanks, that got it working for me. Game actually has broken lighting effects. Tried running DarkStarSword's unity fix template on the game, and it surprisingly didn't help, but it looks like it's only a couple of broken shaders, so I might do a manual fix on the game.
TonyBirt said:mindw0rk - I Couldn't get 3D to activate as Unity engine wouldn't go into fullscreen. Adding command line "-window-mode exclusive" to Steam launch options fixed this ;) Game looks great in 3D.


Thanks, that got it working for me.

Game actually has broken lighting effects. Tried running DarkStarSword's unity fix template on the game, and it surprisingly didn't help, but it looks like it's only a couple of broken shaders, so I might do a manual fix on the game.

3D Gaming Rig: CPU: i7 7700K @ 4.9Ghz | Mobo: Asus Maximus Hero VIII | RAM: Corsair Dominator 16GB | GPU: 2 x GTX 1080 Ti SLI | 3xSSDs for OS and Apps, 2 x HDD's for 11GB storage | PSU: Seasonic X-1250 M2| Case: Corsair C70 | Cooling: Corsair H115i Hydro cooler | Displays: Asus PG278QR, BenQ XL2420TX & BenQ HT1075 | OS: Windows 10 Pro + Windows 7 dual boot

Like my fixes? Dontations can be made to: www.paypal.me/DShanz or rshannonca@gmail.com
Like electronic music? Check out: www.soundcloud.com/dj-ryan-king

#8
Posted 07/26/2016 05:59 PM   
I started having a look at this one, but it uses custom shaders that we can neither decompile nor assemble with our current tools - kind of the excuse I was looking for to start work on rewriting the assembler, even though that approach isn't going to be the fastest way to fix this.
I started having a look at this one, but it uses custom shaders that we can neither decompile nor assemble with our current tools - kind of the excuse I was looking for to start work on rewriting the assembler, even though that approach isn't going to be the fastest way to fix this.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#9
Posted 07/28/2016 02:02 AM   
What are the HLSL glitches? If it's something that might be straightforward I can prioritize a look at them, especially if it might be happening in the future for other unity games.
What are the HLSL glitches? If it's something that might be straightforward I can prioritize a look at them, especially if it might be happening in the future for other unity games.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

#10
Posted 07/28/2016 04:33 AM   
These may not be the shaders we actually need to fix - the code doesn't look right for lighting so I need to confirm if they are the right ones with frame analysis, but they were the likely prospects from hunting and were giving me trouble. The pixel shader fails to decompile: [code]$ ~/cmd_Decompiler -D 92b955e453855d47-ps.bin Decompiling 92b955e453855d47-ps.bin... creating HLSL representation error parsing shader> Unknown statement: atomic_or error while decompiling *** At least one error occurred during run *** [/code] [code]$ cat 92b955e453855d47-ps.txt // 3DMigoto: 92b955e453855d47 | Unity headers extracted from LightLinkedListRender.shader // Shader "IgInternal/LightLinkedListRender" { // SubShader 1/1 { // Pass 1/1 { // ZTest False // ZWrite Off // Cull Off // Blend Zero Zero // ColorMask 0 // GpuProgramID 11105 // Program "fp" { // SubProgram "d3d11 " { // GpuProgramIndex 1 // } // } // } // } // } // // Unity 5.3 headers extracted from LightLinkedListRender.shader.decompressed: // API d3d11 // Shader model ps_5_0 // undeciphered1: 2 0 0 // undeciphered2: 1 0 1 0 2 // undeciphered3: 0 0 // ConstBuffer "$Globals" 304 // Float 288 [_LightBit] // BindCB "$Globals" 0 // // Headers extracted with DarkStarSword's extract_unity53_shaders.py // https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.40 on Tue Jul 19 17:30:51 2016 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // TEXCOORD 0 xyzw 0 NONE float // SV_Position 0 xyzw 1 POS float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Target 0 xyzw 0 TARGET float xyzw // ps_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[19], immediateIndexed dcl_uav_typed_texture2d (sint,sint,sint,sint) u1 dcl_input_ps_siv linear noperspective v1.xy, position dcl_output o0.xyzw dcl_temps 1 resinfo_indexable(texture2d)(sint,sint,sint,sint) r0.x, l(0), u1.yxzw add r0.x, r0.x, -v1.y ftoi r0.y, r0.x ftou r0.z, cb0[18].x ishl r0.z, l(1), r0.z ftoi r0.x, v1.x atomic_or u1, r0.xyxx, r0.z mov o0.xyzw, l(1.000000,1.000000,1.000000,1.000000) ret // Approximately 0 instruction slots used [/code] The assembler produces garbage output from the dcl_input_ps_siv line and use of signed integers, which causes DirectX to hang. Vertex shader needs some manual fixups: [code] $ cat c3046510b39f6438-vs_replace.txt // 3DMigoto: c3046510b39f6438 | Unity headers extracted from LightLinkedListRender.shader // Shader "IgInternal/LightLinkedListRender" { // SubShader 1/1 { // Pass 1/1 { // ZTest False // ZWrite Off // Cull Off // Blend Zero Zero // ColorMask 0 // GpuProgramID 11105 // Program "vp" { // SubProgram "d3d11 " { // GpuProgramIndex 0 // } // } // } // } // } // // Unity 5.3 headers extracted from LightLinkedListRender.shader.decompressed: // API d3d11 // Shader model vs_5_0 // undeciphered1: 14 0 0 // undeciphered2: 1 2 2 0 0 // undeciphered3: 0 0 // ConstBuffer "$Globals" 304 // Float 292 [_IndexOffset] // Matrix 144 [s_Mv] // Matrix 208 [s_P] // ConstBuffer "UnityPerCamera" 144 // Vector 80 [_ProjectionParams] // BindCB "$Globals" 0 // BindCB "UnityPerCamera" 1 // SetBuffer 0 [s_Vertices] // SetBuffer 1 [s_Indices] // // Headers extracted with DarkStarSword's extract_unity53_shaders.py // https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py // ---- Created with 3Dmigoto v1.2.40 on Tue Jul 19 17:30:51 2016 cbuffer cb1 : register(b1) { float4 cb1[6]; } cbuffer cb0 : register(b0) { float4 cb0[19]; } // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( uint v0 : SV_VertexID0, uint v1 : SV_InstanceID0, out float4 o0 : TEXCOORD0, out float4 o1 : SV_POSITION0) { // Needs manual fix for instruction: // unknown dcl_: dcl_resource_structured t0, 16 // Needs manual fix for instruction: // unknown dcl_: dcl_resource_structured t1, 4 // Needs manual fix for instruction: // unknown dcl_: dcl_input_sgv v0.x, vertex_id float4 r0,r1; uint4 bitmask, uiDest; float4 fDest; r0.x = (int)cb0[18].y; r0.x = (uint)r0.x << 3; // Missing reflection info for shader. No names possible. // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.y, v0.x, l(0), t1.xxxx r0.y = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz; r0.x = (int)r0.y + (int)r0.x; // Missing reflection info for shader. No names possible. // Known bad code for instruction (needs manual fix): ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyzw, r0.x, l(0), t0.xyzw r0.x = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz; r0.y = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz; r0.z = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz; r0.w = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz; r1.xyzw = cb0[10].xyzw * r0.yyyy; r1.xyzw = cb0[9].xyzw * r0.xxxx + r1.xyzw; r1.xyzw = cb0[11].xyzw * r0.zzzz + r1.xyzw; r0.xyzw = cb0[12].xyzw * r0.wwww + r1.xyzw; r1.xyzw = cb0[14].xyzw * r0.yyyy; r1.xyzw = cb0[13].xyzw * r0.xxxx + r1.xyzw; r1.xyzw = cb0[15].xyzw * r0.zzzz + r1.xyzw; r0.xyzw = cb0[16].xyzw * r0.wwww + r1.xyzw; r1.x = cb1[5].x * r0.y; r1.w = 0.5 * r1.x; r1.xz = float2(0.5,0.5) * r0.xw; o0.xy = r1.xw + r1.zz; o0.zw = r0.zw; o1.xyzw = r0.xyzw; return; } [/code] [code] $ cat c3046510b39f6438-vs.txt // 3DMigoto: c3046510b39f6438 | Unity headers extracted from LightLinkedListRender.shader // Shader "IgInternal/LightLinkedListRender" { // SubShader 1/1 { // Pass 1/1 { // ZTest False // ZWrite Off // Cull Off // Blend Zero Zero // ColorMask 0 // GpuProgramID 11105 // Program "vp" { // SubProgram "d3d11 " { // GpuProgramIndex 0 // } // } // } // } // } // // Unity 5.3 headers extracted from LightLinkedListRender.shader.decompressed: // API d3d11 // Shader model vs_5_0 // undeciphered1: 14 0 0 // undeciphered2: 1 2 2 0 0 // undeciphered3: 0 0 // ConstBuffer "$Globals" 304 // Float 292 [_IndexOffset] // Matrix 144 [s_Mv] // Matrix 208 [s_P] // ConstBuffer "UnityPerCamera" 144 // Vector 80 [_ProjectionParams] // BindCB "$Globals" 0 // BindCB "UnityPerCamera" 1 // SetBuffer 0 [s_Vertices] // SetBuffer 1 [s_Indices] // // Headers extracted with DarkStarSword's extract_unity53_shaders.py // https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py // // Generated by Microsoft (R) D3D Shader Disassembler // // using 3Dmigoto v1.2.40 on Tue Jul 19 17:30:51 2016 // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_VertexID 0 x 0 VERTID uint x // SV_InstanceID 0 x 1 INSTID uint // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // TEXCOORD 0 xyzw 0 NONE float xyzw // SV_POSITION 0 xyzw 1 POS float xyzw // vs_5_0 dcl_globalFlags refactoringAllowed dcl_constantbuffer cb0[19], immediateIndexed dcl_constantbuffer cb1[6], immediateIndexed dcl_resource_structured t0, 16 dcl_resource_structured t1, 4 dcl_input_sgv v0.x, vertex_id dcl_output o0.xyzw dcl_output_siv o1.xyzw, position dcl_temps 2 ftoi r0.x, cb0[18].y ishl r0.x, r0.x, l(3) ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.y, v0.x, l(0), t1.xxxx iadd r0.x, r0.y, r0.x ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyzw, r0.x, l(0), t0.xyzw mul r1.xyzw, r0.yyyy, cb0[10].xyzw mad r1.xyzw, cb0[9].xyzw, r0.xxxx, r1.xyzw mad r1.xyzw, cb0[11].xyzw, r0.zzzz, r1.xyzw mad r0.xyzw, cb0[12].xyzw, r0.wwww, r1.xyzw mul r1.xyzw, r0.yyyy, cb0[14].xyzw mad r1.xyzw, cb0[13].xyzw, r0.xxxx, r1.xyzw mad r1.xyzw, cb0[15].xyzw, r0.zzzz, r1.xyzw mad r0.xyzw, cb0[16].xyzw, r0.wwww, r1.xyzw mul r1.x, r0.y, cb1[5].x mul r1.w, r1.x, l(0.500000) mul r1.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000) add o0.xy, r1.zzzz, r1.xwxx mov o0.zw, r0.zzzw mov o1.xyzw, r0.xyzw ret // Approximately 0 instruction slots used [/code]
These may not be the shaders we actually need to fix - the code doesn't look right for lighting so I need to confirm if they are the right ones with frame analysis, but they were the likely prospects from hunting and were giving me trouble.

The pixel shader fails to decompile:
$ ~/cmd_Decompiler -D 92b955e453855d47-ps.bin
Decompiling 92b955e453855d47-ps.bin...
creating HLSL representation
error parsing shader> Unknown statement: atomic_or
error while decompiling

*** At least one error occurred during run ***

$ cat 92b955e453855d47-ps.txt
// 3DMigoto: 92b955e453855d47 | Unity headers extracted from LightLinkedListRender.shader
// Shader "IgInternal/LightLinkedListRender" {
// SubShader 1/1 {
// Pass 1/1 {
// ZTest False
// ZWrite Off
// Cull Off
// Blend Zero Zero
// ColorMask 0
// GpuProgramID 11105
// Program "fp" {
// SubProgram "d3d11 " {
// GpuProgramIndex 1
// }
// }
// }
// }
// }
//
// Unity 5.3 headers extracted from LightLinkedListRender.shader.decompressed:
// API d3d11
// Shader model ps_5_0
// undeciphered1: 2 0 0
// undeciphered2: 1 0 1 0 2
// undeciphered3: 0 0
// ConstBuffer "$Globals" 304
// Float 288 [_LightBit]
// BindCB "$Globals" 0
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py


//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.40 on Tue Jul 19 17:30:51 2016
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float
// SV_Position 0 xyzw 1 POS float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target 0 xyzw 0 TARGET float xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[19], immediateIndexed
dcl_uav_typed_texture2d (sint,sint,sint,sint) u1
dcl_input_ps_siv linear noperspective v1.xy, position
dcl_output o0.xyzw
dcl_temps 1
resinfo_indexable(texture2d)(sint,sint,sint,sint) r0.x, l(0), u1.yxzw
add r0.x, r0.x, -v1.y
ftoi r0.y, r0.x
ftou r0.z, cb0[18].x
ishl r0.z, l(1), r0.z
ftoi r0.x, v1.x
atomic_or u1, r0.xyxx, r0.z
mov o0.xyzw, l(1.000000,1.000000,1.000000,1.000000)
ret
// Approximately 0 instruction slots used

The assembler produces garbage output from the dcl_input_ps_siv line and use of signed integers, which causes DirectX to hang.

Vertex shader needs some manual fixups:
$ cat c3046510b39f6438-vs_replace.txt
// 3DMigoto: c3046510b39f6438 | Unity headers extracted from LightLinkedListRender.shader
// Shader "IgInternal/LightLinkedListRender" {
// SubShader 1/1 {
// Pass 1/1 {
// ZTest False
// ZWrite Off
// Cull Off
// Blend Zero Zero
// ColorMask 0
// GpuProgramID 11105
// Program "vp" {
// SubProgram "d3d11 " {
// GpuProgramIndex 0
// }
// }
// }
// }
// }
//
// Unity 5.3 headers extracted from LightLinkedListRender.shader.decompressed:
// API d3d11
// Shader model vs_5_0
// undeciphered1: 14 0 0
// undeciphered2: 1 2 2 0 0
// undeciphered3: 0 0
// ConstBuffer "$Globals" 304
// Float 292 [_IndexOffset]
// Matrix 144 [s_Mv]
// Matrix 208 [s_P]
// ConstBuffer "UnityPerCamera" 144
// Vector 80 [_ProjectionParams]
// BindCB "$Globals" 0
// BindCB "UnityPerCamera" 1
// SetBuffer 0 [s_Vertices]
// SetBuffer 1 [s_Indices]
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py


// ---- Created with 3Dmigoto v1.2.40 on Tue Jul 19 17:30:51 2016
cbuffer cb1 : register(b1)
{
float4 cb1[6];
}

cbuffer cb0 : register(b0)
{
float4 cb0[19];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
uint v0 : SV_VertexID0,
uint v1 : SV_InstanceID0,
out float4 o0 : TEXCOORD0,
out float4 o1 : SV_POSITION0)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_resource_structured t0, 16
// Needs manual fix for instruction:
// unknown dcl_: dcl_resource_structured t1, 4
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v0.x, vertex_id
float4 r0,r1;
uint4 bitmask, uiDest;
float4 fDest;

r0.x = (int)cb0[18].y;
r0.x = (uint)r0.x << 3;
// Missing reflection info for shader. No names possible.
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.y, v0.x, l(0), t1.xxxx
r0.y = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz;
r0.x = (int)r0.y + (int)r0.x;
// Missing reflection info for shader. No names possible.
// Known bad code for instruction (needs manual fix):
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyzw, r0.x, l(0), t0.xyzw
r0.x = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz;
r0.y = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz;
r0.z = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz;
r0.w = no_StructuredBufferName[no_srcAddressRegister].no_srcByteOffsetName.swiz;
r1.xyzw = cb0[10].xyzw * r0.yyyy;
r1.xyzw = cb0[9].xyzw * r0.xxxx + r1.xyzw;
r1.xyzw = cb0[11].xyzw * r0.zzzz + r1.xyzw;
r0.xyzw = cb0[12].xyzw * r0.wwww + r1.xyzw;
r1.xyzw = cb0[14].xyzw * r0.yyyy;
r1.xyzw = cb0[13].xyzw * r0.xxxx + r1.xyzw;
r1.xyzw = cb0[15].xyzw * r0.zzzz + r1.xyzw;
r0.xyzw = cb0[16].xyzw * r0.wwww + r1.xyzw;
r1.x = cb1[5].x * r0.y;
r1.w = 0.5 * r1.x;
r1.xz = float2(0.5,0.5) * r0.xw;
o0.xy = r1.xw + r1.zz;
o0.zw = r0.zw;
o1.xyzw = r0.xyzw;
return;
}

$ cat c3046510b39f6438-vs.txt
// 3DMigoto: c3046510b39f6438 | Unity headers extracted from LightLinkedListRender.shader
// Shader "IgInternal/LightLinkedListRender" {
// SubShader 1/1 {
// Pass 1/1 {
// ZTest False
// ZWrite Off
// Cull Off
// Blend Zero Zero
// ColorMask 0
// GpuProgramID 11105
// Program "vp" {
// SubProgram "d3d11 " {
// GpuProgramIndex 0
// }
// }
// }
// }
// }
//
// Unity 5.3 headers extracted from LightLinkedListRender.shader.decompressed:
// API d3d11
// Shader model vs_5_0
// undeciphered1: 14 0 0
// undeciphered2: 1 2 2 0 0
// undeciphered3: 0 0
// ConstBuffer "$Globals" 304
// Float 292 [_IndexOffset]
// Matrix 144 [s_Mv]
// Matrix 208 [s_P]
// ConstBuffer "UnityPerCamera" 144
// Vector 80 [_ProjectionParams]
// BindCB "$Globals" 0
// BindCB "UnityPerCamera" 1
// SetBuffer 0 [s_Vertices]
// SetBuffer 1 [s_Indices]
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py


//
// Generated by Microsoft (R) D3D Shader Disassembler
//
// using 3Dmigoto v1.2.40 on Tue Jul 19 17:30:51 2016
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_VertexID 0 x 0 VERTID uint x
// SV_InstanceID 0 x 1 INSTID uint
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD 0 xyzw 0 NONE float xyzw
// SV_POSITION 0 xyzw 1 POS float xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[19], immediateIndexed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_resource_structured t0, 16
dcl_resource_structured t1, 4
dcl_input_sgv v0.x, vertex_id
dcl_output o0.xyzw
dcl_output_siv o1.xyzw, position
dcl_temps 2
ftoi r0.x, cb0[18].y
ishl r0.x, r0.x, l(3)
ld_structured_indexable(structured_buffer, stride=4)(mixed,mixed,mixed,mixed) r0.y, v0.x, l(0), t1.xxxx
iadd r0.x, r0.y, r0.x
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.xyzw, r0.x, l(0), t0.xyzw
mul r1.xyzw, r0.yyyy, cb0[10].xyzw
mad r1.xyzw, cb0[9].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb0[11].xyzw, r0.zzzz, r1.xyzw
mad r0.xyzw, cb0[12].xyzw, r0.wwww, r1.xyzw
mul r1.xyzw, r0.yyyy, cb0[14].xyzw
mad r1.xyzw, cb0[13].xyzw, r0.xxxx, r1.xyzw
mad r1.xyzw, cb0[15].xyzw, r0.zzzz, r1.xyzw
mad r0.xyzw, cb0[16].xyzw, r0.wwww, r1.xyzw
mul r1.x, r0.y, cb1[5].x
mul r1.w, r1.x, l(0.500000)
mul r1.xz, r0.xxwx, l(0.500000, 0.000000, 0.500000, 0.000000)
add o0.xy, r1.zzzz, r1.xwxx
mov o0.zw, r0.zzzw
mov o1.xyzw, r0.xyzw
ret
// Approximately 0 instruction slots used

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#11
Posted 07/28/2016 05:26 AM   
Thanks for those examples. The Atomic_Or is easy to fix, and a bit of an odd oversight since I already added a bunch of other atomic ops. For the VS with StructuredBuffers, that is problematic. With no header information, that means I can't find out what the structured buffer (usually a struct) looks like, or how big it is. In this case t0 and t1 are basically undefined, so making a general solution there is not clear to me at the moment. I'll take a look at hand-fixing the VS to start, to see if there is something reasonable that might generalize.
Thanks for those examples.

The Atomic_Or is easy to fix, and a bit of an odd oversight since I already added a bunch of other atomic ops.


For the VS with StructuredBuffers, that is problematic. With no header information, that means I can't find out what the structured buffer (usually a struct) looks like, or how big it is.

In this case t0 and t1 are basically undefined, so making a general solution there is not clear to me at the moment.

I'll take a look at hand-fixing the VS to start, to see if there is something reasonable that might generalize.

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

#12
Posted 07/28/2016 09:59 AM   
Another approach for Unity might be to recreate the RDEF section in the binary shader from the Unity headers before running them through the decompiler - that is something I could potentially do in my scripts (and I have the RDEF format partially decoded, but not complete yet), but I haven't needed that so far because the scripts directly use the Unity headers and for the most part are now working on the assembly versions of the shaders.
Another approach for Unity might be to recreate the RDEF section in the binary shader from the Unity headers before running them through the decompiler - that is something I could potentially do in my scripts (and I have the RDEF format partially decoded, but not complete yet), but I haven't needed that so far because the scripts directly use the Unity headers and for the most part are now working on the assembly versions of the shaders.

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#13
Posted 07/28/2016 10:08 AM   
Re-read your comment - yeah, the t0 and t1 buffers would be tricky to come up with a general solution. In this case I don't believe they are structured though, even though the compiler produced code that suggests that - s_Indices is clearly a typed buffer of integers, and s_Vertices is clearly a typed buffer of float4s.... but there's no easy way to determine that programmatically as you need to look at the instructions to see how it is accessed. The vertex shader might be ok with the assembler though - I think it was only the pixel shader giving me trouble there. I don't think it's worth spending time fixing up the vertex shader unless we are fairly sure we need to patch it (e.g. the auto halo fix on it made zero difference).
Re-read your comment - yeah, the t0 and t1 buffers would be tricky to come up with a general solution. In this case I don't believe they are structured though, even though the compiler produced code that suggests that - s_Indices is clearly a typed buffer of integers, and s_Vertices is clearly a typed buffer of float4s.... but there's no easy way to determine that programmatically as you need to look at the instructions to see how it is accessed.

The vertex shader might be ok with the assembler though - I think it was only the pixel shader giving me trouble there. I don't think it's worth spending time fixing up the vertex shader unless we are fairly sure we need to patch it (e.g. the auto halo fix on it made zero difference).

2x Geforce GTX 980 in SLI provided by NVIDIA, i7 6700K 4GHz CPU, Asus 27" VG278HE 144Hz 3D Monitor, BenQ W1070 3D Projector, 120" Elite Screens YardMaster 2, 32GB Corsair DDR4 3200MHz RAM, Samsung 850 EVO 500G SSD, 4x750GB HDD in RAID5, Gigabyte Z170X-Gaming 7 Motherboard, Corsair Obsidian 750D Airflow Edition Case, Corsair RM850i PSU, HTC Vive, Win 10 64bit

Alienware M17x R4 w/ built in 3D, Intel i7 3740QM, GTX 680m 2GB, 16GB DDR3 1600MHz RAM, Win7 64bit, 1TB SSD, 1TB HDD, 750GB HDD

Pre-release 3D fixes, shadertool.py and other goodies: http://github.com/DarkStarSword/3d-fixes
Support me on Patreon: https://www.patreon.com/DarkStarSword or PayPal: https://www.paypal.me/DarkStarSword

#14
Posted 07/28/2016 10:31 AM   
[quote="DarkStarSword"]Re-read your comment - yeah, the t0 and t1 buffers would be tricky to come up with a general solution. In this case I don't believe they are structured though, even though the compiler produced code that suggests that - s_Indices is clearly a typed buffer of integers, and s_Vertices is clearly a typed buffer of float4s.... but there's no easy way to determine that programmatically as you need to look at the instructions to see how it is accessed. The vertex shader might be ok with the assembler though - I think it was only the pixel shader giving me trouble there. I don't think it's worth spending time fixing up the vertex shader unless we are fairly sure we need to patch it (e.g. the auto halo fix on it made zero difference).[/quote] Latest version is shipped as 1.2.42, and I added all the atomic_* opcodes with possible expected manual fixes. The shaders should at least generate HLSL code now. I added the most likely intrinsic that would match, but am not sure it's right. For the VS, I didn't see any good way to generalize that, but if we run into this more, I'll take a deeper look. (Also, we can always special case a fix for something as common as Unity 5 shaders)
DarkStarSword said:Re-read your comment - yeah, the t0 and t1 buffers would be tricky to come up with a general solution. In this case I don't believe they are structured though, even though the compiler produced code that suggests that - s_Indices is clearly a typed buffer of integers, and s_Vertices is clearly a typed buffer of float4s.... but there's no easy way to determine that programmatically as you need to look at the instructions to see how it is accessed.

The vertex shader might be ok with the assembler though - I think it was only the pixel shader giving me trouble there. I don't think it's worth spending time fixing up the vertex shader unless we are fairly sure we need to patch it (e.g. the auto halo fix on it made zero difference).

Latest version is shipped as 1.2.42, and I added all the atomic_* opcodes with possible expected manual fixes. The shaders should at least generate HLSL code now. I added the most likely intrinsic that would match, but am not sure it's right.

For the VS, I didn't see any good way to generalize that, but if we run into this more, I'll take a deeper look. (Also, we can always special case a fix for something as common as Unity 5 shaders)

Acer H5360 (1280x720@120Hz) - ASUS VG248QE with GSync mod - 3D Vision 1&2 - Driver 372.54
GTX 970 - i5-4670K@4.2GHz - 12GB RAM - Win7x64+evilKB2670838 - 4 Disk X25 RAID
SAGER NP9870-S - GTX 980 - i7-6700K - Win10 Pro 1607
Latest 3Dmigoto Release
Bo3b's School for ShaderHackers

#15
Posted 08/03/2016 06:00 AM   
  1 / 2    
Scroll To Top