3Dmigoto now open-source...
  55 / 141    
And another question : is there a way to force 3Dvision to work in windowed mode ? We have to go to a kind of full screen mode with DCS, that make display of jauges on second screen impossible.
And another question : is there a way to force 3Dvision to work in windowed mode ? We have to go to a kind of full screen mode with DCS, that make display of jauges on second screen impossible.

Posted 02/07/2016 05:15 PM   
I'm having troubles with exitting the fullscreen after the recent update. It happens when I change the resolution in game to smaller, then back to 1080p and then press alt+enter. The game still occupies the whole screen but the focus is on the explorer's window below.
I'm having troubles with exitting the fullscreen after the recent update. It happens when I change the resolution in game to smaller, then back to 1080p and then press alt+enter. The game still occupies the whole screen but the focus is on the explorer's window below.

EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64

Posted 02/07/2016 07:26 PM   
[center][color="orange"]3DMigoto 1.2.29 is out:[/color] [url]https://github.com/bo3b/3Dmigoto/releases/tag/1.2.29[/url][/center] This is a bug fix release: - Fixes crash when compiling a custom shader that produces warnings when logging is disabled. - The SetWindowPos hook introduced in 1.2.28 must now be explicitly requested with full_screen=2 - The StereoParams texture is now updated once per frame on Present (previously it was updated in ClearRenderTarget, which in some games like The Witness could cause it be become significantly out of date, and in other games would needlessly update multiple times per frame). @Oomek can you please test to see if this resolves your full screen issue?


This is a bug fix release:
- Fixes crash when compiling a custom shader that produces warnings when logging is disabled.
- The SetWindowPos hook introduced in 1.2.28 must now be explicitly requested with full_screen=2
- The StereoParams texture is now updated once per frame on Present (previously it was updated in ClearRenderTarget, which in some games like The Witness could cause it be become significantly out of date, and in other games would needlessly update multiple times per frame).

@Oomek can you please test to see if this resolves your full screen issue?

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

Posted 02/08/2016 03:02 AM   
@DarkStarSword sorry mate. I had fullscreen set to 0, that's why I wasn't able to minimize the game window. If it's not supposed to be like this bear in mind it's still like that in 1.2.29 I've also tried your new copy_desc method of adding a new render targets. Unfortunately the custom shader which supposed to clear the buffer is adding values to it. I believe it's something to do with the OM blending state of the [s]resource[/s] render target I'm copying the description from. I hope I understood your example correctly. [code] [Present] run = CustomShaderClearBuffer [ResourceHeadlights] [ShaderOverride-4977ae594eb27c06] Hash = 4977ae594eb27c06 ResourceHeadlights = copy_desc o0 o1 = reference ResourceHeadlights post o1 = null [ResourceBackupo0] [CustomShaderClearBuffer] vs = Shaders\clear_rt.vs.hlsl ps = Shaders\clear_rt.ps.hlsl ResourceBackupo0 = ref o0 o0 = ResourceHeadlights Draw = 6, 0 post o0 = ResourceBackupo0 [/code]
@DarkStarSword sorry mate. I had fullscreen set to 0, that's why I wasn't able to minimize the game window. If it's not supposed to be like this bear in mind it's still like that in 1.2.29

I've also tried your new copy_desc method of adding a new render targets.
Unfortunately the custom shader which supposed to clear the buffer is adding values to it. I believe it's something to do with the OM blending state of the resource render target I'm copying the description from.
I hope I understood your example correctly.

[Present]
run = CustomShaderClearBuffer

[ResourceHeadlights]

[ShaderOverride-4977ae594eb27c06]
Hash = 4977ae594eb27c06
ResourceHeadlights = copy_desc o0
o1 = reference ResourceHeadlights
post o1 = null

[ResourceBackupo0]

[CustomShaderClearBuffer]
vs = Shaders\clear_rt.vs.hlsl
ps = Shaders\clear_rt.ps.hlsl
ResourceBackupo0 = ref o0
o0 = ResourceHeadlights
Draw = 6, 0
post o0 = ResourceBackupo0

EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64

Posted 02/08/2016 02:39 PM   
I modified the post [url=https://forums.geforce.com/default/topic/685657/3d-vision/3dmigoto-now-open-source-/post/4801019/#4801019]810[/url] because the faulty shader was not uploaded in the post. Is it something to do in order to make it work ?
I modified the post 810 because the faulty shader was not uploaded in the post.
Is it something to do in order to make it work ?

Posted 02/08/2016 09:23 PM   
I found another bug in the decompiler: [code]// Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float // TEXCOORD 0 xyz 1 NONE float xyz // TEXCOORD 1 xy 2 NONE float xy // TEXCOORD 2 zw 2 NONE float zw // TEXCOORD 3 xyz 3 NONE float xyz // TEXCOORD 4 xyz 4 NONE float xyz // TEXCOORD 5 xyzw 5 NONE float xy w [/code] [code]dcl_input_ps linear centroid v1.xyz dcl_input_ps linear centroid v2.xy dcl_input_ps linear centroid v2.zw dcl_input_ps linear centroid v3.xyz dcl_input_ps linear centroid v4.xyz dcl_input_ps linear centroid v5.xyw [/code] [code]void main( float4 v0 : SV_Position0, linear centroid float4 v1 : TEXCOORD0, linear centroid float2 v2 : TEXCOORD1, linear centroid float2 w2 : TEXCOORD2, linear centroid float4 v3 : TEXCOORD3, linear centroid float4 v4 : TEXCOORD4, linear centroid float4 v5 : TEXCOORD5, out float4 o0 : SV_Target0) [/code] Then in the code I got the following throwing an error: [code] r0.xyzw = r0.xyxy * float4(0.400000006,0.400000006,0.5,0.5) + v2.xyzw; [/code] It's just one shader so I fixed it. There is no rush with that.
I found another bug in the decompiler:

// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xy 2 NONE float xy
// TEXCOORD 2 zw 2 NONE float zw
// TEXCOORD 3 xyz 3 NONE float xyz
// TEXCOORD 4 xyz 4 NONE float xyz
// TEXCOORD 5 xyzw 5 NONE float xy w


dcl_input_ps linear centroid v1.xyz
dcl_input_ps linear centroid v2.xy
dcl_input_ps linear centroid v2.zw
dcl_input_ps linear centroid v3.xyz
dcl_input_ps linear centroid v4.xyz
dcl_input_ps linear centroid v5.xyw


void main( 
float4 v0 : SV_Position0,
linear centroid float4 v1 : TEXCOORD0,
linear centroid float2 v2 : TEXCOORD1,
linear centroid float2 w2 : TEXCOORD2,
linear centroid float4 v3 : TEXCOORD3,
linear centroid float4 v4 : TEXCOORD4,
linear centroid float4 v5 : TEXCOORD5,
out float4 o0 : SV_Target0)


Then in the code I got the following throwing an error:
r0.xyzw = r0.xyxy * float4(0.400000006,0.400000006,0.5,0.5) + v2.xyzw;


It's just one shader so I fixed it. There is no rush with that.

EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64

Posted 02/10/2016 11:23 AM   
Catching up on the posts in this thread... [quote="Oomek"]Would it be possible to add some switch which would allow 3DM to load precompiled shaders even if all the hlsl files were deleted?[/quote]Possible, yes - but someone needs to add the code to do it, and I'm a bit reluctant to touch the code responsible for replacing shaders without refactoring it to make it easier to understand and more manageable first as I will surely break something and not know. [quote="helifax"]I was wondering if there a way to copy the Depth Buffer from the current Frame without specifying a HASH from which shader to copy?[/quote]I've been thinking about this possibility as well. I've got a few ideas for how it might work, but I need to implement them and try them out in a few games to see how well they work in practice. There is also the old ZRepair support from Chiri's original code, which can match a depth buffer by hash and inject it, and it kind of worked last time I tried, but had some fairly major problems with incorrect bind flags and using a resource simultaneously as an input and output. [quote="lefuneste"]Hi DarkStarSword, I found a new problems with DCS 3DMigoto dump a shader than can not be reloaded. Here are the related messages in d3d11_log.txt[/quote] That's a known limitation of the decompiler - you need to add the structure definition (copied from the assembly version) and work out the right item in the structure that the instruction was accessing (which in this case will be whatever the first item is since it's accessing byte offset 0). There's more info here: [url]https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4739720/#4739720[/url] [quote]By the way, it seems also that some shaders can not be dumped. Here is the log when I try to dump it: [code]*** Overlay call CoInitializeEx failed: -2147417850 StereoScreenShot on Mark: D:\jeux\DCS World 2 OpenAlpha\bin\ShaderFixes\1ebdb3925859d5f6-vs.jps, result: 0 creating HLSL representation. ******* Exception caught while decompiling shader ****** error while decompiling. > FAILED to copy Marked shader to ShaderFixes[/code][/quote]Can you dump out the assembly of that shader (export_shaders=1) and post that?
Catching up on the posts in this thread...

Oomek said:Would it be possible to add some switch which would allow 3DM to load precompiled shaders even if all the hlsl files were deleted?
Possible, yes - but someone needs to add the code to do it, and I'm a bit reluctant to touch the code responsible for replacing shaders without refactoring it to make it easier to understand and more manageable first as I will surely break something and not know.

helifax said:I was wondering if there a way to copy the Depth Buffer from the current Frame without specifying a HASH from which shader to copy?
I've been thinking about this possibility as well. I've got a few ideas for how it might work, but I need to implement them and try them out in a few games to see how well they work in practice. There is also the old ZRepair support from Chiri's original code, which can match a depth buffer by hash and inject it, and it kind of worked last time I tried, but had some fairly major problems with incorrect bind flags and using a resource simultaneously as an input and output.


lefuneste said:Hi DarkStarSword,
I found a new problems with DCS
3DMigoto dump a shader than can not be reloaded. Here are the related messages in d3d11_log.txt

That's a known limitation of the decompiler - you need to add the structure definition (copied from the assembly version) and work out the right item in the structure that the instruction was accessing (which in this case will be whatever the first item is since it's accessing byte offset 0). There's more info here:

https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4739720/#4739720

By the way, it seems also that some shaders can not be dumped. Here is the log when I try to dump it:
*** Overlay call CoInitializeEx failed: -2147417850 
StereoScreenShot on Mark: D:\jeux\DCS World 2 OpenAlpha\bin\ShaderFixes\1ebdb3925859d5f6-vs.jps, result: 0
creating HLSL representation.
******* Exception caught while decompiling shader ******
error while decompiling.
> FAILED to copy Marked shader to ShaderFixes
Can you dump out the assembly of that shader (export_shaders=1) and post that?

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

Posted 02/12/2016 09:16 AM   
[quote="lefuneste"]And another question : is there a way to force 3Dvision to work in windowed mode ? We have to go to a kind of full screen mode with DCS, that make display of jauges on second screen impossible.[/quote]Not possible (unless you want to use Discover mode) - that's a driver limitation that 3D will only work in exclusive full screen mode for DX11 games. [quote="Oomek"]@DarkStarSword sorry mate. I had fullscreen set to 0, that's why I wasn't able to minimize the game window. If it's not supposed to be like this bear in mind it's still like that in 1.2.29[/quote]Thanks for clearing that up. I was surprised that fullscreen=0 is having an effect, but I checked the 3DMigoto nvapi project and see it has additional code which might be causing that. [quote]I've also tried your new copy_desc method of adding a new render targets. Unfortunately the custom shader which supposed to clear the buffer is adding values to it. I believe it's something to do with the OM blending state of the [s]resource[/s] render target I'm copying the description from.[/quote]Very likely. It looks like I'll need to add support for overriding the OM blend state sooner rather than later. I was thinking about initially just adding this to the CustomShader sections since they will often need it and don't have to worry about merging it with the game's existing blend state for multiple render targets. Adding it to the generic command list can come later. [quote="Oomek"]I found another bug in the decompiler:[/quote]The bug isn't in the definition, it's in the referencing of whatever variable was overloaded in TEXCOORD2. This is a known issue, but is a rare enough edge case that we have been hand fixing it whenever it comes up.
lefuneste said:And another question : is there a way to force 3Dvision to work in windowed mode ? We have to go to a kind of full screen mode with DCS, that make display of jauges on second screen impossible.
Not possible (unless you want to use Discover mode) - that's a driver limitation that 3D will only work in exclusive full screen mode for DX11 games.

Oomek said:@DarkStarSword sorry mate. I had fullscreen set to 0, that's why I wasn't able to minimize the game window. If it's not supposed to be like this bear in mind it's still like that in 1.2.29
Thanks for clearing that up. I was surprised that fullscreen=0 is having an effect, but I checked the 3DMigoto nvapi project and see it has additional code which might be causing that.

I've also tried your new copy_desc method of adding a new render targets.
Unfortunately the custom shader which supposed to clear the buffer is adding values to it. I believe it's something to do with the OM blending state of the resource render target I'm copying the description from.
Very likely. It looks like I'll need to add support for overriding the OM blend state sooner rather than later. I was thinking about initially just adding this to the CustomShader sections since they will often need it and don't have to worry about merging it with the game's existing blend state for multiple render targets. Adding it to the generic command list can come later.

Oomek said:I found another bug in the decompiler:
The bug isn't in the definition, it's in the referencing of whatever variable was overloaded in TEXCOORD2. This is a known issue, but is a rare enough edge case that we have been hand fixing it whenever it comes up.

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

Posted 02/12/2016 09:23 AM   
I also need some assistance with a shader. The d3d11 log is showing "wrapper1349(70,13-72): error X3018: invalid subscript 'xyzw'" Here's the pixel shader in question: [code]// ---- Created with 3Dmigoto v1.2.29 on Wed Feb 10 13:34:39 2016 cbuffer _Globals : register(b0) { float4 CamNearFarInvXY : packoffset(c0); float2 PixelSize : packoffset(c1); float4 DebugMaskValues : packoffset(c2); float4x4 LocalToWorld : packoffset(c3); float3 SpherePosition : packoffset(c7); float Radius : packoffset(c7.w); } cbuffer SceneWideParameterConstantBuffer : register(b1) { float4x4 ViewProjection : packoffset(c0); float4x4 View : packoffset(c4); float4x4 Projection : packoffset(c8); float4x4 ViewInverse : packoffset(c12); float3 EyePosition : packoffset(c16); float cameraNearTimesFar : packoffset(c16.w); float3 GlobalAmbientColor : packoffset(c17); float cameraFarMinusNear : packoffset(c17.w); float2 cameraNearFar : packoffset(c18); float2 ViewportWidthHeight : packoffset(c18.z); float2 screenWidthHeightInv : packoffset(c19); float2 screenWidthHeight : packoffset(c19.z); float4x4 PrevViewProj : packoffset(c20); float4 Jitter : packoffset(c24); float2 InvProjXY : packoffset(c25); uint PointLightCount : packoffset(c25.z); uint SpotLightCount : packoffset(c25.w); uint FoliageSpheresCount : packoffset(c26); float time : packoffset(c26.y); float2 CubeFadeValues : packoffset(c26.z); float4 FogParameters0 : packoffset(c27); float4 FogParameters1 : packoffset(c28); float4 FogParameters2 : packoffset(c29); float4 FogParameters3 : packoffset(c30); float3 CubeSunDir : packoffset(c31); float padding0 : packoffset(c31.w); float3 CubeSunColor : packoffset(c32); float padding1 : packoffset(c32.w); float2 WindDirection : packoffset(c33); } SamplerState PointSampler_s : register(s0); Texture2D<float> LinearDepthBuffer : register(t0); Texture2D<float4> NormalBuffer : register(t1); // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float4 v0 : SV_POSITION0, out float2 o0 : SV_TARGET0) { float4 r0,r1,r2,r3; uint4 bitmask, uiDest; float4 fDest; r0.xy = float2(1,1) / ViewportWidthHeight.xy; r1.z = -v0.y * r0.y + 1; r1.xy = v0.xy * r0.xy; r0.xy = r1.xz * float2(2,2) + float2(-1,-1); r0.xy = InvProjXY.xy * r0.xy; r2.xyzw = LinearDepthBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw; r1.xyzw = NormalBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw; r0.zw = r1.xy * float2(2,2) + float2(-1,-1); r1.x = cameraNearFar.y * r2.x; r2.xy = r1.xx * r0.xy; r2.z = -r1.x; r2.w = 1; r1.x = dot(r2.xyzw, ViewInverse._m00_m10_m20_m30); r1.y = dot(r2.xyzw, ViewInverse._m01_m11_m21_m31); r1.z = dot(r2.xyzw, ViewInverse._m02_m12_m22_m32); r1.xyz = SpherePosition.xyz + -r1.xyz; r0.x = dot(r1.xyz, r1.xyz); r0.y = rsqrt(r0.x); r1.xyz = r1.xyz * r0.yyy; r2.xy = cmp(r0.zw >= float2(0,0)); r2.xy = r2.xy ? float2(1,1) : float2(-1,-1); r3.xyz = float3(1,1,1) + -abs(r0.zwz); r2.xy = r3.yz * r2.xy; r3.z = r3.x + -abs(r0.w); r0.y = cmp(r3.z < 0); r3.xy = r0.yy ? r2.xy : r0.zw; r0.y = dot(r3.xyz, r3.xyz); r0.y = rsqrt(r0.y); r0.yzw = r3.xyz * r0.yyy; r0.y = saturate(dot(r0.yzw, r1.xyz)); r0.z = Radius * Radius; r0.x = max(r0.z, r0.x); r0.x = r0.z / r0.x; r0.x = r0.x * r0.y + -0.0199999996; r0.x = saturate(1.02040815 * r0.x); r0.x = sqrt(r0.x); o0.x = 1 + -r0.x; o0.y = 0; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546 // // using 3Dmigoto v1.2.29 on Wed Feb 10 13:34:39 2016 // // // Buffer Definitions: // // cbuffer $Globals // { // // float4 CamNearFarInvXY; // Offset: 0 Size: 16 [unused] // float2 PixelSize; // Offset: 16 Size: 8 [unused] // float4 DebugMaskValues; // Offset: 32 Size: 16 [unused] // float4x4 LocalToWorld; // Offset: 48 Size: 64 [unused] // float3 SpherePosition; // Offset: 112 Size: 12 // float Radius; // Offset: 124 Size: 4 // // } // // cbuffer SceneWideParameterConstantBuffer // { // // float4x4 ViewProjection; // Offset: 0 Size: 64 [unused] // float4x4 View; // Offset: 64 Size: 64 [unused] // float4x4 Projection; // Offset: 128 Size: 64 [unused] // float4x4 ViewInverse; // Offset: 192 Size: 64 // float3 EyePosition; // Offset: 256 Size: 12 [unused] // float cameraNearTimesFar; // Offset: 268 Size: 4 [unused] // float3 GlobalAmbientColor; // Offset: 272 Size: 12 [unused] // float cameraFarMinusNear; // Offset: 284 Size: 4 [unused] // float2 cameraNearFar; // Offset: 288 Size: 8 // float2 ViewportWidthHeight; // Offset: 296 Size: 8 // float2 screenWidthHeightInv; // Offset: 304 Size: 8 [unused] // float2 screenWidthHeight; // Offset: 312 Size: 8 [unused] // float4x4 PrevViewProj; // Offset: 320 Size: 64 [unused] // float4 Jitter; // Offset: 384 Size: 16 [unused] // float2 InvProjXY; // Offset: 400 Size: 8 // uint PointLightCount; // Offset: 408 Size: 4 [unused] // uint SpotLightCount; // Offset: 412 Size: 4 [unused] // uint FoliageSpheresCount; // Offset: 416 Size: 4 [unused] // float time; // Offset: 420 Size: 4 [unused] // float2 CubeFadeValues; // Offset: 424 Size: 8 [unused] // float4 FogParameters0; // Offset: 432 Size: 16 [unused] // float4 FogParameters1; // Offset: 448 Size: 16 [unused] // float4 FogParameters2; // Offset: 464 Size: 16 [unused] // float4 FogParameters3; // Offset: 480 Size: 16 [unused] // float3 CubeSunDir; // Offset: 496 Size: 12 [unused] // float padding0; // Offset: 508 Size: 4 [unused] // float3 CubeSunColor; // Offset: 512 Size: 12 [unused] // float padding1; // Offset: 524 Size: 4 [unused] // float2 WindDirection; // Offset: 528 Size: 8 [unused] // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // PointSampler sampler NA NA 0 1 // LinearDepthBuffer texture float 2d 0 1 // NormalBuffer texture float4 2d 1 1 // $Globals cbuffer NA NA 0 1 // SceneWideParameterConstantBuffer cbuffer NA NA 1 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_POSITION 0 xyzw 0 POS float xy // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_TARGET 0 xy 0 TARGET float xy // ps_4_0 dcl_constantbuffer cb0[8], immediateIndexed dcl_constantbuffer cb1[26], immediateIndexed dcl_sampler s0, mode_default dcl_resource_texture2d (float,float,float,float) t0 dcl_resource_texture2d (float,float,float,float) t1 dcl_input_ps_siv linear noperspective v0.xy, position dcl_output o0.xy dcl_temps 4 div r0.xy, l(1.000000, 1.000000, 1.000000, 1.000000), cb1[18].zwzz mad r1.z, -v0.y, r0.y, l(1.000000) mul r1.xy, r0.xyxx, v0.xyxx mad r0.xy, r1.xzxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000) mul r0.xy, r0.xyxx, cb1[25].xyxx sample_l r2.xyzw, r1.xyxx, t0.xyzw, s0, l(0.000000) sample_l r1.xyzw, r1.xyxx, t1.xyzw, s0, l(0.000000) mad r0.zw, r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000) mul r1.x, r2.x, cb1[18].y mul r2.xy, r0.xyxx, r1.xxxx mov r2.z, -r1.x mov r2.w, l(1.000000) dp4 r1.x, r2.xyzw, cb1[12].xyzw dp4 r1.y, r2.xyzw, cb1[13].xyzw dp4 r1.z, r2.xyzw, cb1[14].xyzw add r1.xyz, -r1.xyzx, cb0[7].xyzx dp3 r0.x, r1.xyzx, r1.xyzx rsq r0.y, r0.x mul r1.xyz, r0.yyyy, r1.xyzx ge r2.xy, r0.zwzz, l(0.000000, 0.000000, 0.000000, 0.000000) movc r2.xy, r2.xyxx, l(1.000000,1.000000,0,0), l(-1.000000,-1.000000,0,0) add r3.xyz, -|r0.zwzz|, l(1.000000, 1.000000, 1.000000, 0.000000) mul r2.xy, r2.xyxx, r3.yzyy add r3.z, -|r0.w|, r3.x lt r0.y, r3.z, l(0.000000) movc r3.xy, r0.yyyy, r2.xyxx, r0.zwzz dp3 r0.y, r3.xyzx, r3.xyzx rsq r0.y, r0.y mul r0.yzw, r0.yyyy, r3.xxyz dp3_sat r0.y, r0.yzwy, r1.xyzx mul r0.z, cb0[7].w, cb0[7].w max r0.x, r0.x, r0.z div r0.x, r0.z, r0.x mad r0.x, r0.x, r0.y, l(-0.020000) mul_sat r0.x, r0.x, l(1.02040815) sqrt r0.x, r0.x add o0.x, -r0.x, l(1.000000) mov o0.y, l(0) ret // Approximately 39 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code]
I also need some assistance with a shader. The d3d11 log is showing "wrapper1349(70,13-72): error X3018: invalid subscript 'xyzw'"

Here's the pixel shader in question:

// ---- Created with 3Dmigoto v1.2.29 on Wed Feb 10 13:34:39 2016

cbuffer _Globals : register(b0)
{
float4 CamNearFarInvXY : packoffset(c0);
float2 PixelSize : packoffset(c1);
float4 DebugMaskValues : packoffset(c2);
float4x4 LocalToWorld : packoffset(c3);
float3 SpherePosition : packoffset(c7);
float Radius : packoffset(c7.w);
}

cbuffer SceneWideParameterConstantBuffer : register(b1)
{
float4x4 ViewProjection : packoffset(c0);
float4x4 View : packoffset(c4);
float4x4 Projection : packoffset(c8);
float4x4 ViewInverse : packoffset(c12);
float3 EyePosition : packoffset(c16);
float cameraNearTimesFar : packoffset(c16.w);
float3 GlobalAmbientColor : packoffset(c17);
float cameraFarMinusNear : packoffset(c17.w);
float2 cameraNearFar : packoffset(c18);
float2 ViewportWidthHeight : packoffset(c18.z);
float2 screenWidthHeightInv : packoffset(c19);
float2 screenWidthHeight : packoffset(c19.z);
float4x4 PrevViewProj : packoffset(c20);
float4 Jitter : packoffset(c24);
float2 InvProjXY : packoffset(c25);
uint PointLightCount : packoffset(c25.z);
uint SpotLightCount : packoffset(c25.w);
uint FoliageSpheresCount : packoffset(c26);
float time : packoffset(c26.y);
float2 CubeFadeValues : packoffset(c26.z);
float4 FogParameters0 : packoffset(c27);
float4 FogParameters1 : packoffset(c28);
float4 FogParameters2 : packoffset(c29);
float4 FogParameters3 : packoffset(c30);
float3 CubeSunDir : packoffset(c31);
float padding0 : packoffset(c31.w);
float3 CubeSunColor : packoffset(c32);
float padding1 : packoffset(c32.w);
float2 WindDirection : packoffset(c33);
}

SamplerState PointSampler_s : register(s0);
Texture2D<float> LinearDepthBuffer : register(t0);
Texture2D<float4> NormalBuffer : register(t1);


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


void main(
float4 v0 : SV_POSITION0,
out float2 o0 : SV_TARGET0)
{
float4 r0,r1,r2,r3;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = float2(1,1) / ViewportWidthHeight.xy;
r1.z = -v0.y * r0.y + 1;
r1.xy = v0.xy * r0.xy;
r0.xy = r1.xz * float2(2,2) + float2(-1,-1);
r0.xy = InvProjXY.xy * r0.xy;
r2.xyzw = LinearDepthBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw;
r1.xyzw = NormalBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw;
r0.zw = r1.xy * float2(2,2) + float2(-1,-1);
r1.x = cameraNearFar.y * r2.x;
r2.xy = r1.xx * r0.xy;
r2.z = -r1.x;
r2.w = 1;
r1.x = dot(r2.xyzw, ViewInverse._m00_m10_m20_m30);
r1.y = dot(r2.xyzw, ViewInverse._m01_m11_m21_m31);
r1.z = dot(r2.xyzw, ViewInverse._m02_m12_m22_m32);
r1.xyz = SpherePosition.xyz + -r1.xyz;
r0.x = dot(r1.xyz, r1.xyz);
r0.y = rsqrt(r0.x);
r1.xyz = r1.xyz * r0.yyy;
r2.xy = cmp(r0.zw >= float2(0,0));
r2.xy = r2.xy ? float2(1,1) : float2(-1,-1);
r3.xyz = float3(1,1,1) + -abs(r0.zwz);
r2.xy = r3.yz * r2.xy;
r3.z = r3.x + -abs(r0.w);
r0.y = cmp(r3.z < 0);
r3.xy = r0.yy ? r2.xy : r0.zw;
r0.y = dot(r3.xyz, r3.xyz);
r0.y = rsqrt(r0.y);
r0.yzw = r3.xyz * r0.yyy;
r0.y = saturate(dot(r0.yzw, r1.xyz));
r0.z = Radius * Radius;
r0.x = max(r0.z, r0.x);
r0.x = r0.z / r0.x;
r0.x = r0.x * r0.y + -0.0199999996;
r0.x = saturate(1.02040815 * r0.x);
r0.x = sqrt(r0.x);
o0.x = 1 + -r0.x;
o0.y = 0;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
// using 3Dmigoto v1.2.29 on Wed Feb 10 13:34:39 2016
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
// float4 CamNearFarInvXY; // Offset: 0 Size: 16 [unused]
// float2 PixelSize; // Offset: 16 Size: 8 [unused]
// float4 DebugMaskValues; // Offset: 32 Size: 16 [unused]
// float4x4 LocalToWorld; // Offset: 48 Size: 64 [unused]
// float3 SpherePosition; // Offset: 112 Size: 12
// float Radius; // Offset: 124 Size: 4
//
// }
//
// cbuffer SceneWideParameterConstantBuffer
// {
//
// float4x4 ViewProjection; // Offset: 0 Size: 64 [unused]
// float4x4 View; // Offset: 64 Size: 64 [unused]
// float4x4 Projection; // Offset: 128 Size: 64 [unused]
// float4x4 ViewInverse; // Offset: 192 Size: 64
// float3 EyePosition; // Offset: 256 Size: 12 [unused]
// float cameraNearTimesFar; // Offset: 268 Size: 4 [unused]
// float3 GlobalAmbientColor; // Offset: 272 Size: 12 [unused]
// float cameraFarMinusNear; // Offset: 284 Size: 4 [unused]
// float2 cameraNearFar; // Offset: 288 Size: 8
// float2 ViewportWidthHeight; // Offset: 296 Size: 8
// float2 screenWidthHeightInv; // Offset: 304 Size: 8 [unused]
// float2 screenWidthHeight; // Offset: 312 Size: 8 [unused]
// float4x4 PrevViewProj; // Offset: 320 Size: 64 [unused]
// float4 Jitter; // Offset: 384 Size: 16 [unused]
// float2 InvProjXY; // Offset: 400 Size: 8
// uint PointLightCount; // Offset: 408 Size: 4 [unused]
// uint SpotLightCount; // Offset: 412 Size: 4 [unused]
// uint FoliageSpheresCount; // Offset: 416 Size: 4 [unused]
// float time; // Offset: 420 Size: 4 [unused]
// float2 CubeFadeValues; // Offset: 424 Size: 8 [unused]
// float4 FogParameters0; // Offset: 432 Size: 16 [unused]
// float4 FogParameters1; // Offset: 448 Size: 16 [unused]
// float4 FogParameters2; // Offset: 464 Size: 16 [unused]
// float4 FogParameters3; // Offset: 480 Size: 16 [unused]
// float3 CubeSunDir; // Offset: 496 Size: 12 [unused]
// float padding0; // Offset: 508 Size: 4 [unused]
// float3 CubeSunColor; // Offset: 512 Size: 12 [unused]
// float padding1; // Offset: 524 Size: 4 [unused]
// float2 WindDirection; // Offset: 528 Size: 8 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// PointSampler sampler NA NA 0 1
// LinearDepthBuffer texture float 2d 0 1
// NormalBuffer texture float4 2d 1 1
// $Globals cbuffer NA NA 0 1
// SceneWideParameterConstantBuffer cbuffer NA NA 1 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xy 0 TARGET float xy
//
ps_4_0
dcl_constantbuffer cb0[8], immediateIndexed
dcl_constantbuffer cb1[26], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xy
dcl_temps 4
div r0.xy, l(1.000000, 1.000000, 1.000000, 1.000000), cb1[18].zwzz
mad r1.z, -v0.y, r0.y, l(1.000000)
mul r1.xy, r0.xyxx, v0.xyxx
mad r0.xy, r1.xzxx, l(2.000000, 2.000000, 0.000000, 0.000000), l(-1.000000, -1.000000, 0.000000, 0.000000)
mul r0.xy, r0.xyxx, cb1[25].xyxx
sample_l r2.xyzw, r1.xyxx, t0.xyzw, s0, l(0.000000)
sample_l r1.xyzw, r1.xyxx, t1.xyzw, s0, l(0.000000)
mad r0.zw, r1.xxxy, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
mul r1.x, r2.x, cb1[18].y
mul r2.xy, r0.xyxx, r1.xxxx
mov r2.z, -r1.x
mov r2.w, l(1.000000)
dp4 r1.x, r2.xyzw, cb1[12].xyzw
dp4 r1.y, r2.xyzw, cb1[13].xyzw
dp4 r1.z, r2.xyzw, cb1[14].xyzw
add r1.xyz, -r1.xyzx, cb0[7].xyzx
dp3 r0.x, r1.xyzx, r1.xyzx
rsq r0.y, r0.x
mul r1.xyz, r0.yyyy, r1.xyzx
ge r2.xy, r0.zwzz, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r2.xy, r2.xyxx, l(1.000000,1.000000,0,0), l(-1.000000,-1.000000,0,0)
add r3.xyz, -|r0.zwzz|, l(1.000000, 1.000000, 1.000000, 0.000000)
mul r2.xy, r2.xyxx, r3.yzyy
add r3.z, -|r0.w|, r3.x
lt r0.y, r3.z, l(0.000000)
movc r3.xy, r0.yyyy, r2.xyxx, r0.zwzz
dp3 r0.y, r3.xyzx, r3.xyzx
rsq r0.y, r0.y
mul r0.yzw, r0.yyyy, r3.xxyz
dp3_sat r0.y, r0.yzwy, r1.xyzx
mul r0.z, cb0[7].w, cb0[7].w
max r0.x, r0.x, r0.z
div r0.x, r0.z, r0.x
mad r0.x, r0.x, r0.y, l(-0.020000)
mul_sat r0.x, r0.x, l(1.02040815)
sqrt r0.x, r0.x
add o0.x, -r0.x, l(1.000000)
mov o0.y, l(0)
ret
// Approximately 39 instruction slots used

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

Dual boot Win 7 x64 & Win 10 (1809) | Geforce Drivers 417.35

Posted 02/12/2016 10:40 AM   
Replace these two lines: [code]r2.xyzw = LinearDepthBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw; r1.xyzw = NormalBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw;[/code]with: [code]r2 = LinearDepthBuffer.SampleLevel(PointSampler_s, r1.xy, 0); r1 = NormalBuffer.SampleLevel(PointSampler_s, r1.xy, 0);[/code]
Replace these two lines:
r2.xyzw = LinearDepthBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw;
r1.xyzw = NormalBuffer.SampleLevel(PointSampler_s, r1.xy, 0).xyzw;
with:
r2 = LinearDepthBuffer.SampleLevel(PointSampler_s, r1.xy, 0);
r1 = NormalBuffer.SampleLevel(PointSampler_s, r1.xy, 0);

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

Posted 02/12/2016 11:12 AM   
Tried the new lines and it works now. Thanks again DarkStar!
Tried the new lines and it works now. Thanks again DarkStar!

Dual boot Win 7 x64 & Win 10 (1809) | Geforce Drivers 417.35

Posted 02/12/2016 01:28 PM   
[quote="DarkStarSword"]Thanks for clearing that up. I was surprised that fullscreen=0 is having an effect, but I checked the 3DMigoto nvapi project and see it has additional code which might be causing that. [/quote] Currently I'm using Migoto with nvapi.dll renamed. The problem still exists even with full_screen commented out. I'm uploading a video showing how to reproduce that borderless and "always on top" game window. What works I think is: 1. launch the game in fullscreen 2. alt+enter to window 3. maximize window 4. alt+enter to fullscreen 5. temporarily change the game resolution. at this moment alt+enter and alt+tab will fail. [url]https://youtu.be/yhQV-nSoZ9s[/url]
DarkStarSword said:Thanks for clearing that up. I was surprised that fullscreen=0 is having an effect, but I checked the 3DMigoto nvapi project and see it has additional code which might be causing that.


Currently I'm using Migoto with nvapi.dll renamed. The problem still exists even with full_screen commented out.
I'm uploading a video showing how to reproduce that borderless and "always on top" game window.

What works I think is:
1. launch the game in fullscreen
2. alt+enter to window
3. maximize window
4. alt+enter to fullscreen
5. temporarily change the game resolution.

at this moment alt+enter and alt+tab will fail.

https://youtu.be/yhQV-nSoZ9s

EVGA GeForce GTX 980 SC
Core i5 2500K
MSI Z77A-G45
8GB DDR3
Windows 10 x64

Posted 02/12/2016 02:46 PM   
[quote="DarkStarSword"]Can you dump out the assembly of that shader (export_shaders=1) and post that? [/quote] I set export_shaders=1 and had the same messages (and still no shader dumped) [code]*** Overlay call CoInitializeEx failed: -2147417850 StereoScreenShot on Mark: D:\jeux\DCS World 2 OpenAlpha\bin\ShaderFixes\1ebdb3925859d5f6-vs.jps, result: 0 creating HLSL representation. ******* Exception caught while decompiling shader ****** error while decompiling. > FAILED to copy Marked shader to ShaderFixes[/code] If it can helps, DCS World is freely downloadable : http://www.digitalcombatsimulator.com/en/downloads/world/alpha/
DarkStarSword said:Can you dump out the assembly of that shader (export_shaders=1) and post that?

I set export_shaders=1 and had the same messages (and still no shader dumped)

*** Overlay call CoInitializeEx failed: -2147417850 
StereoScreenShot on Mark: D:\jeux\DCS World 2 OpenAlpha\bin\ShaderFixes\1ebdb3925859d5f6-vs.jps, result: 0
creating HLSL representation.
******* Exception caught while decompiling shader ******
error while decompiling.
> FAILED to copy Marked shader to ShaderFixes


If it can helps, DCS World is freely downloadable : http://www.digitalcombatsimulator.com/en/downloads/world/alpha/

Posted 02/13/2016 12:18 PM   
export_shaders dumps it into ShaderCache as assembly when it is first loaded, so you should be able to find it there.
export_shaders dumps it into ShaderCache as assembly when it is first loaded, so you should be able to find it there.

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

Posted 02/14/2016 06:04 AM   
[quote="DarkStarSword"]export_shaders dumps it into ShaderCache as assembly when it is first loaded, so you should be able to find it there.[/quote] Here is a shader fot which I only have a jps generated and he error message above: http://www.mediafire.com/view/78upt944b447gzp/faulty_1ebdb3925859d5f6-vs.txt
DarkStarSword said:export_shaders dumps it into ShaderCache as assembly when it is first loaded, so you should be able to find it there.


Here is a shader fot which I only have a jps generated and he error message above: http://www.mediafire.com/view/78upt944b447gzp/faulty_1ebdb3925859d5f6-vs.txt

Posted 02/14/2016 12:26 PM   
  55 / 141    
Scroll To Top