3Dmigoto now open-source...
  91 / 143    
Hey folks. Just an interesting discovery I made a few days ago. I tried Dying Light with the updated 3Dmigoto fix available on helixmod. And with it, for the very first time (in the case of a dx11 game) I was able to render at 1080p and display at 2160p with correct interleaving lines. It is a little tricky though. There is an option for forcing a resolution in the recent 3dmigoto releases, so you can enter 3840x2160 there. The game seems to follow this forcing and set its rendering resolution to that too. But if you set it to 1920x1080 in the game and then restart the game, it works as it should! Unfortunately the next time you start the game it changes it back to 2160p again, so you have to repeat this changing-to-1080p-and-restarting every time. Or you can make the game's video config file read-only, but only when you finished setting everything right, as you won't be able to change the songs ingame once you make the file read-only.
Hey folks.
Just an interesting discovery I made a few days ago. I tried Dying Light with the updated 3Dmigoto fix available on helixmod. And with it, for the very first time (in the case of a dx11 game) I was able to render at 1080p and display at 2160p with correct interleaving lines. It is a little tricky though. There is an option for forcing a resolution in the recent 3dmigoto releases, so you can enter 3840x2160 there. The game seems to follow this forcing and set its rendering resolution to that too. But if you set it to 1920x1080 in the game and then restart the game, it works as it should! Unfortunately the next time you start the game it changes it back to 2160p again, so you have to repeat this changing-to-1080p-and-restarting every time. Or you can make the game's video config file read-only, but only when you finished setting everything right, as you won't be able to change the songs ingame once you make the file read-only.

Posted 05/21/2017 03:17 PM   
Great find [b]innuendo1231b[/b]. I tried only overriding the resolution through 3DMigoto before, but it didn't worked. Now thanks to you I did more tries and it's working great as you said. I don't know if it's same for you but I set and enabled these settings step by step with the latest 3DMigoto: - overrides screen resolution. (game crashed) width=3840 height=2160 - overrides refresh rate set by game. (after enabling this game started without a crash) refresh_rate=60 - full_screen=1 (at this step interleaving lines corrected) Tried it on Mafia 3 with 1080p and 1440p and both working great. Edit: Also tried Syberia 3 with it's helixmod fix, game stucked with black screen. I deleted "-window-mode exclusive" command from Steam Launch Options and game upscaled to 4K with correct interleaving lines at 1080p and 1440p. Both games didn't reset or change their settings after second or third start. This is a great day, thanks again [b]innuendo1231b[/b].
Great find innuendo1231b. I tried only overriding the resolution through 3DMigoto before, but it didn't worked. Now thanks to you I did more tries and it's working great as you said.

I don't know if it's same for you but I set and enabled these settings step by step with the latest 3DMigoto:

- overrides screen resolution. (game crashed)
width=3840
height=2160

- overrides refresh rate set by game. (after enabling this game started without a crash)
refresh_rate=60

- full_screen=1 (at this step interleaving lines corrected)

Tried it on Mafia 3 with 1080p and 1440p and both working great.


Edit: Also tried Syberia 3 with it's helixmod fix, game stucked with black screen. I deleted "-window-mode exclusive" command from Steam Launch Options and game upscaled to 4K with correct interleaving lines at 1080p and 1440p.

Both games didn't reset or change their settings after second or third start.

This is a great day, thanks again innuendo1231b.

Asus Deluxe Gen3, Core i7 2700k@4.5Ghz, GTX 1080Ti, 16 GB RAM, Win 7 64bit
Samsung Pro 250 GB SSD, 4 TB WD Black (games)
Benq XL2720Z

Posted 05/21/2017 07:31 PM   
Tried more games with above settings: - The Witcher 3: Game works but broken interleaving lines. Tried with both helixmod fix and latest 3DMigoto version. - Mad Max: Same as TW3. - Assassin's Creed Unity: Game crashes. - TheCrew: Same as TW3. I hope this feature will be developed more, if it gets better we can play any game at any resolution with great upscaling quality to 4K.
Tried more games with above settings:

- The Witcher 3: Game works but broken interleaving lines. Tried with both helixmod fix and latest 3DMigoto version.

- Mad Max: Same as TW3.

- Assassin's Creed Unity: Game crashes.

- TheCrew: Same as TW3.


I hope this feature will be developed more, if it gets better we can play any game at any resolution with great upscaling quality to 4K.

Asus Deluxe Gen3, Core i7 2700k@4.5Ghz, GTX 1080Ti, 16 GB RAM, Win 7 64bit
Samsung Pro 250 GB SSD, 4 TB WD Black (games)
Benq XL2720Z

Posted 05/22/2017 07:48 AM   
Hm. Maybe it depends on the engine. I was hoping it would work with witcher 3 too :/
Hm. Maybe it depends on the engine. I was hoping it would work with witcher 3 too :/

Posted 05/22/2017 09:57 AM   
[quote="lacuna"]Only 3DMigoto (DX11) has SBS support.[/quote] Which is why I wish 3DMigoto supported wrapping DX9 and DX10 games to DX11 :( Is it possible to use a different Dx9 to Dx11 wrapper along side 3DMigoto?
lacuna said:Only 3DMigoto (DX11) has SBS support.


Which is why I wish 3DMigoto supported wrapping DX9 and DX10 games to DX11 :(

Is it possible to use a different Dx9 to Dx11 wrapper along side 3DMigoto?

Posted 05/23/2017 04:13 PM   
[quote="markbradley"]for those of us with HMDs but no 3d monitors. [/quote] Dude! Get a 3D Vision monitor or compatible display and stop spamming about support for your Vive. There are VR forums where you can post about your "Vive" You can also open a support ticket with Nvidia to express your disappointment at the lack of Side by Side support.
markbradley said:for those of us with HMDs but no 3d monitors.


Dude! Get a 3D Vision monitor or compatible display and stop spamming about support for your Vive.

There are VR forums where you can post about your "Vive"

You can also open a support ticket with Nvidia to express your disappointment at the lack of Side by Side support.

Posted 05/24/2017 04:55 AM   
[quote="markbradley"] Which is why I wish 3DMigoto supported wrapping DX9 and DX10 games to DX11 :([/quote] It would be cool if it worked natively with DX9 games. Even if just for making hotkeys for controller buttons, using transitions and delays, etc. I was thinking about Bayonetta for that, but that game already has a use for all buttons :p. Polishing the DX11 part, features (I would love being able to show OSD messages when using hotkeys, like "Bloom OFF", "DoF strength: 8", or something like that) and game compatibility (dat Dishonored 2) should have a higher priority than that, of course. I assume it would be a giant amount of work and we already have the Helix DX9 dlls.
markbradley said:
Which is why I wish 3DMigoto supported wrapping DX9 and DX10 games to DX11 :(


It would be cool if it worked natively with DX9 games. Even if just for making hotkeys for controller buttons, using transitions and delays, etc. I was thinking about Bayonetta for that, but that game already has a use for all buttons :p.

Polishing the DX11 part, features (I would love being able to show OSD messages when using hotkeys, like "Bloom OFF", "DoF strength: 8", or something like that) and game compatibility (dat Dishonored 2) should have a higher priority than that, of course. I assume it would be a giant amount of work and we already have the Helix DX9 dlls.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 05/24/2017 01:45 PM   
[b][center][color="orange"][size="XL"]3Dmigoto 1.2.61[/size][/color] [size="M"][url]https://github.com/bo3b/3Dmigoto/releases[/url][/size] [/center][/b] - Add new option for 3D Vision Direct Mode support, by setting force_stereo=2. - Improve Win10 support by tweaking defaults for known problem spots in d3dx.ini [code] allow_create_device=2 ... ;vs-t125 = StereoParams ;ps-t125 = StereoParams ;vs-t120 = IniParams ;ps-t120 = IniParams [/code] Build 1.2.60 was broken, and has been deleted.


- Add new option for 3D Vision Direct Mode support, by setting force_stereo=2.
- Improve Win10 support by tweaking defaults for known problem spots in d3dx.ini

allow_create_device=2
...
;vs-t125 = StereoParams
;ps-t125 = StereoParams
;vs-t120 = IniParams
;ps-t120 = IniParams



Build 1.2.60 was broken, and has been deleted.

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

Posted 06/10/2017 12:39 AM   
[quote="bo3b"][b][center][color="orange"][size="XL"]3Dmigoto 1.2.61[/size][/color] [size="M"][url]https://github.com/bo3b/3Dmigoto/releases[/url][/size] [/center][/b] - Add new option for 3D Vision Direct Mode support, by setting force_stereo=2. - Improve Win10 support by tweaking defaults for known problem spots in d3dx.ini [code] allow_create_device=2 ... ;vs-t125 = StereoParams ;ps-t125 = StereoParams ;vs-t120 = IniParams ;ps-t120 = IniParams [/code] Build 1.2.60 was broken, and has been deleted.[/quote] Thank you for this update! I tested the new version with some fixes and it works flawless. I'll include this in the next version of 3D Fix Manager! Sorry for the stupid question but what is "3D Vision Direct Mode"? Does this mean that the game uses its own 3D mode (if implemented) instead of the driver's 3D automatic mode?
bo3b said:

- Add new option for 3D Vision Direct Mode support, by setting force_stereo=2.
- Improve Win10 support by tweaking defaults for known problem spots in d3dx.ini

allow_create_device=2
...
;vs-t125 = StereoParams
;ps-t125 = StereoParams
;vs-t120 = IniParams
;ps-t120 = IniParams



Build 1.2.60 was broken, and has been deleted.


Thank you for this update! I tested the new version with some fixes and it works flawless. I'll include this in the next version of 3D Fix Manager!

Sorry for the stupid question but what is "3D Vision Direct Mode"? Does this mean that the game uses its own 3D mode (if implemented) instead of the driver's 3D automatic mode?

ASUS ROG Strix GeForce GTX 1080 | Core I7-7700K | 16GB RAM | Win10 Pro x64
Asus ROG Swift PG278Q 3D Vision Monitor
Optoma UHD 40 3D Vision Projector
Paypal donations for 3D Fix Manager: duselpaul86@gmx.de

Posted 06/10/2017 08:39 PM   
It was added for the Unity Injector that sgsrules was/is working on, bo3b figured out a way to code Direct Mode to work with the wrapper and drivers, then added it to 3Dmigoto. You can read about it [url=https://forums.geforce.com/default/topic/1004765/] in this thread[/url]
It was added for the Unity Injector that sgsrules was/is working on, bo3b figured out a way to code Direct Mode to work with the wrapper and drivers, then added it to 3Dmigoto.

You can read about it in this thread

Posted 06/10/2017 11:21 PM   
innuendo1231b's find for upscaling also works for Quantum Break, currently playing at 1440p with the 3DV fix. In game settings "borderless window" must be selected.
innuendo1231b's find for upscaling also works for Quantum Break, currently playing at 1440p with the 3DV fix. In game settings "borderless window" must be selected.

Asus Deluxe Gen3, Core i7 2700k@4.5Ghz, GTX 1080Ti, 16 GB RAM, Win 7 64bit
Samsung Pro 250 GB SSD, 4 TB WD Black (games)
Benq XL2720Z

Posted 06/13/2017 04:01 AM   
Link please lacuna
Link please lacuna

Intel i7 8086K
Gigabyte GTX 1080Ti Aorus Extreme
DDR4 2x8gb 3200mhz Cl14
TV LG OLED65E6V
Avegant Glyph
Windows 10 64bits

Posted 06/13/2017 05:24 AM   
No need for a link, look at the first two messages of this page. Edit: Tried Witcher 3 again after QB success and [b][u]upscaling from 1440p to 4K works for Witcher 3 too[/u][/b] for me. Borderless Window must be selected for Witcher 3 too, but after restarting the game interleaving lines was broken. So you must set the game to 3840x2160 and exclusive fullscreen then set to desired resolution and change to borderless again. You must do this everytime you start the game. I tried this for W3 before and it didn't work as you can read in my previous post. So I'm guessing driver change or the GPU change (from gtx980 to 1080ti) somehow make it possible, or I was unlucky. :) Edit 2: I was able to upscale The Crew too, but it's very problematic. Needs config file editing and making it read only, but it breaks 3DV fix and you may need to alt+tab several times until it starts.
No need for a link, look at the first two messages of this page.


Edit: Tried Witcher 3 again after QB success and upscaling from 1440p to 4K works for Witcher 3 too for me. Borderless Window must be selected for Witcher 3 too, but after restarting the game interleaving lines was broken. So you must set the game to 3840x2160 and exclusive fullscreen then set to desired resolution and change to borderless again. You must do this everytime you start the game.

I tried this for W3 before and it didn't work as you can read in my previous post. So I'm guessing driver change or the GPU change (from gtx980 to 1080ti) somehow make it possible, or I was unlucky. :)

Edit 2: I was able to upscale The Crew too, but it's very problematic. Needs config file editing and making it read only, but it breaks 3DV fix and you may need to alt+tab several times until it starts.

Asus Deluxe Gen3, Core i7 2700k@4.5Ghz, GTX 1080Ti, 16 GB RAM, Win 7 64bit
Samsung Pro 250 GB SSD, 4 TB WD Black (games)
Benq XL2720Z

Posted 06/13/2017 05:44 AM   
Hello, I had a problem with this shader uncorrectly dumped by 3dmigoto: [code]cbuffer _Globals : register(b0) { float4x4 g_mCloudsShadowsSpace : packoffset(c0); float4 g_vCloudsShadowDesc : packoffset(c4); float4 g_vKSettings : packoffset(c5); float4x4 g_mPrevObjViewProj : packoffset(c6); float4 SmoothOffs : packoffset(c10) = {0.0009765625,0.0009765625,1,1}; float4x4 LightSpace : packoffset(c11); float4 ShadowsDesc : packoffset(c15); float4 specColor : packoffset(c16); float4 ControlData : packoffset(c17); float4 difColor : packoffset(c18); float4 ambient : packoffset(c19); float4 g_vDefLightDir : packoffset(c20); float4 g_vDefLightColor : packoffset(c21); float4 g_vDefSpecColor : packoffset(c22); uint CS_FRONT : packoffset(c23) = 0x00000000; uint CS_RIGHT : packoffset(c23) = = 0x00000001; uint CS_BACK : packoffset(c23) = 0x00000002; uint CS_LEFT : packoffset(c23) = 0x00000003; uint CS_TOP : packoffset(c24) = 0x00000004; uint CS_BOTTOM : packoffset(c24) = 0x00000005; float4 g_vAmbientSettings : packoffset(c25); float4 g_vScreenDepthRect : packoffset(c26); struct { float4 vDesc; float4 vFogLayerPlane; float4 vFogLayerColor; float4 vFogLayerSettings; float4 vFogColor; float4 vFogDistance; } g_FogDesc : packoffset(c27); float4 g_vForestPlaneThreshold : packoffset(c33) = {1300,0.00200000009,0,0}; float4 LowDeepColor : packoffset(c34) = {0.300000012,0.400000006,0.400000006,0}; float4 SeaColor : packoffset(c35) = {0.100000001,0.300000012,0.300000012,0}; float4 DetailScale : packoffset(c36) = {1,1,1,1}; float4 g_vIceScale : packoffset(c37) = {1,1,1,1}; float4 g_vSpecSettings : packoffset(c38) = {1,1,1,1}; float4 g_vSeaCorrection : packoffset(c39); float4 g_vSeaDesc : packoffset(c40) = {0.400000006,0.600000024,4,0.980000019}; float4 g_vSeaHarmonics : packoffset(c41) = {1,1,1,1}; float4 WaterDesc : packoffset(c42) = {0.400000006,0.600000024,4,0.980000019}; float4 g_vWaterColor : packoffset(c43) = {1,0,0,0}; float4 g_vWaterSpecColor : packoffset(c44) = {1,1,1,80}; float4 Anim : packoffset(c45); float4 g_vAsyncTextureSize : packoffset(c46) = {1,1,0,0}; float4 g_vRTTexSize : packoffset(c47); float4 g_vAnisotropy : packoffset(c48); float2 TexelOffs[9] : packoffset(c49) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; // 3Dmigoto declarations #define cmp - Texture1D<float4> IniParams : register(t120); Texture2D<float4> StereoParams : register(t125); void main( float2 v0 : COLOR0, uint2 v1 : SV_VertexID0, uint2 v2 : SV_InstanceID0, out float4 o0 : SV_Position0, out float4 o1 : TEXCOORD0, out float2 o2 : TEXCOORD1, out float2 p2 : TEXCOORD2) { // Needs manual fix for instruction: // unknown dcl_: dcl_input_sgv v1.x, vertex_id // Needs manual fix for instruction: // unknown dcl_: dcl_input_sgv v2.x, instance_id float4 r0,r1,r2; uint4 bitmask, uiDest; float4 fDest; r0.xy = v0.yx * float2(255,255) + float2(0.5,0.5); r0.xy = (uint2)r0.xy; r0.x = (uint)r0.x << 8; r0.x = (int)r0.x + (int)r0.y; r0.y = cmp(0x00008000 < (int)r0.x); if (r0.y != 0) { r0.x = (int)r0.x + 0xffff0000; } r0.x = (int)r0.x; r0.y = (int)cb0[82].x; r0.z = cmp((int)v1.x >= (int)r0.y); if (r0.z != 0) { r1.xyz = (int3)r0.yyy + int3(16,32,48); r0.zw = cmp((int2)v1.xx < (int2)r1.xy); if (r0.z != 0) { r0.z = (int)v1.x + (int)-r0.y; r0.z = (int)r0.z; r0.z = cb0[82].y * r0.z; r2.y = r0.z * 50 + cb0[82].w; r2.x = cb0[82].z; } else { r2.xy = float2(0,0); } r0.z = cmp((int)v1.x >= (int)r1.x); r0.z = r0.w ? r0.z : 0; if (r0.z != 0) { r0.z = (int)v1.x + -16; r0.w = (int)r0.z + (int)-r0.y; r0.w = (int)r0.w; r0.w = cb0[82].y * r0.w; r2.x = r0.w * 50 + cb0[82].z; r2.y = cb0[82].w; } else { r0.z = v1.x; } r0.w = cmp((int)r0.z >= (int)r1.z); if (r0.w != 0) { r0.z = (int)r0.z + -48; r0.w = (int)r0.z + (int)-r0.y; r0.w = (int)r0.w; r0.w = cb0[82].y * r0.w; r2.y = r0.w * 50 + cb0[82].w; r0.w = cb0[82].y * 800 + cb0[82].z; r2.x = cb0[82].y + r0.w; } r0.w = cmp((int)r0.z >= (int)r1.y); r1.x = cmp((int)r0.z < (int)r1.z); r0.w = r0.w ? r1.x : 0; if (r0.w != 0) { r0.z = (int)r0.z + -32; r0.y = (int)r0.z + (int)-r0.y; r0.y = (int)r0.y; r0.y = cb0[82].y * r0.y; r2.x = r0.y * 50 + cb0[82].z; r0.y = cb0[82].y * 800 + cb0[82].w; r2.y = cb0[82].y + r0.y; } } else { r0.y = (int)v1.x ^ 257; r0.z = max((int)-v1.x, (int)v1.x); uiDest.z = (uint)r0.z / 257; r0.z = uiDest.z; r0.w = -(int)r0.z; r0.y = (int)r0.y & 0x80000000; r0.y = r0.y ? r0.w : r0.z; r1.y = (int)r0.y; r0.y = mad((int)r0.y, -257, (int)v1.x); r1.x = (int)r0.y; r2.xy = float2(50,50) * r1.xy; } r2.z = cb0[90].z * r0.x; r0.xyz = cb0[80].xyzx + r2.xzy; r1.x = (uint)v2.x; r1.x = cb0[90].w * r1.x; r1.x = 0.5 * r1.x; r1.x = max(0.100000001, r1.x); r0.y = r1.x + r0.y; r0.w = 1; o0.x = dot(r0.xyzw, cb0[67].xyzw); o0.y = dot(r0.xyzw, cb0[68].xyzw); o0.z = dot(r0.xyzw, cb0[69].xyzw); o0.w = dot(r0.xyzw, cb0[70].xyzw); r1.xy = cb0[89].xyxx + r2.xy; r1.xy = r1.xy / cb0[90].xyxx; r1.zw = cb0[88].xxxy + cb0[87].xxxy; o2.xy = r1.xy * r1.zw + cb0[87].xyxx; r0.w = g_vAsyncTextureSize.x * r2.y; r1.x = -r2.x * 7.81249983e-005 + 1; r1.z = 7.81249983e-005 * r0.w; r1.w = g_vAsyncTextureSize.y * r1.x; p2.xy = g_vAsyncTextureSize.zw + r1.zw; o1.xyz = r0.xyz; return; } /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111 // // using 3Dmigoto v1.2.57 on Sun Jun 18 17:07:52 2017 // // // Buffer Definitions: // // cbuffer $Globals // { // // float4x4 g_mCloudsShadowsSpace; // Offset: 0 Size: 64 [unused] // float4 g_vCloudsShadowDesc; // Offset: 64 Size: 16 [unused] // float4 g_vKSettings; // Offset: 80 Size: 16 [unused] // float4x4 g_mPrevObjViewProj; // Offset: 96 Size: 64 [unused] // float4 SmoothOffs; // Offset: 160 Size: 16 [unused] // = 0x3a800000 0x3a800000 0x3f800000 0x3f800000 // float4x4 LightSpace; // Offset: 176 Size: 64 [unused] // float4 ShadowsDesc; // Offset: 240 Size: 16 [unused] // float4 specColor; // Offset: 256 Size: 16 [unused] // float4 ControlData; // Offset: 272 Size: 16 [unused] // float4 difColor; // Offset: 288 Size: 16 [unused] // float4 ambient; // Offset: 304 Size: 16 [unused] // float4 g_vDefLightDir; // Offset: 320 Size: 16 [unused] // float4 g_vDefLightColor; // Offset: 336 Size: 16 [unused] // float4 g_vDefSpecColor; // Offset: 352 Size: 16 [unused] // uint CS_FRONT; // Offset: 368 Size: 4 [unused] // = 0x00000000 // uint CS_RIGHT; // Offset: 372 Size: 4 [unused] // = 0x00000001 // uint CS_BACK; // Offset: 376 Size: 4 [unused] // = 0x00000002 // uint CS_LEFT; // Offset: 380 Size: 4 [unused] // = 0x00000003 // uint CS_TOP; // Offset: 384 Size: 4 [unused] // = 0x00000004 // uint CS_BOTTOM; // Offset: 388 Size: 4 [unused] // = 0x00000005 // float4 g_vAmbientSettings; // Offset: 400 Size: 16 [unused] // float4 g_vScreenDepthRect; // Offset: 416 Size: 16 [unused] // // struct // { // // float4 vDesc; // Offset: 432 // float4 vFogLayerPlane; // Offset: 448 // float4 vFogLayerColor; // Offset: 464 // float4 vFogLayerSettings; // Offset: 480 // float4 vFogColor; // Offset: 496 // float4 vFogDistance; // Offset: 512 // // } g_FogDesc; // Offset: 432 Size: 96 [unused] // float4 g_vForestPlaneThreshold; // Offset: 528 Size: 16 [unused] // = 0x44a28000 0x3b03126f 0x00000000 0x00000000 // float4 LowDeepColor; // Offset: 544 Size: 16 [unused] // = 0x3e99999a 0x3ecccccd 0x3ecccccd 0x00000000 // float4 SeaColor; // Offset: 560 Size: 16 [unused] // = 0x3dcccccd 0x3e99999a 0x3e99999a 0x00000000 // float4 DetailScale; // Offset: 576 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 g_vIceScale; // Offset: 592 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 g_vSpecSettings; // Offset: 608 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 g_vSeaCorrection; // Offset: 624 Size: 16 [unused] // float4 g_vSeaDesc; // Offset: 640 Size: 16 [unused] // = 0x3ecccccd 0x3f19999a 0x40800000 0x3f7ae148 // float4 g_vSeaHarmonics; // Offset: 656 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x3f800000 // float4 WaterDesc; // Offset: 672 Size: 16 [unused] // = 0x3ecccccd 0x3f19999a 0x40800000 0x3f7ae148 // float4 g_vWaterColor; // Offset: 688 Size: 16 [unused] // = 0x3f800000 0x00000000 0x00000000 0x00000000 // float4 g_vWaterSpecColor; // Offset: 704 Size: 16 [unused] // = 0x3f800000 0x3f800000 0x3f800000 0x42a00000 // float4 Anim; // Offset: 720 Size: 16 [unused] // float4 g_vAsyncTextureSize; // Offset: 736 Size: 16 // = 0x3f800000 0x3f800000 0x00000000 0x00000000 // float4 g_vRTTexSize; // Offset: 752 Size: 16 [unused] // float4 g_vAnisotropy; // Offset: 768 Size: 16 [unused] // float2 TexelOffs[9]; // Offset: 784 Size: 136 [unused] // = 0x00000000 0x00000000 0x00000000 0x00000000 // 0xba800000 0x00000000 0x00000000 0x00000000 // 0x3a800000 0x00000000 0x00000000 0x00000000 // 0x00000000 0xba800000 0x00000000 0x00000000 // 0x00000000 0x3a800000 0x00000000 0x00000000 // 0xbb000000 0xbb000000 0x00000000 0x00000000 // 0x3b000000 0xbb000000 0x00000000 0x00000000 // 0x3b000000 0x3b000000 0x00000000 0x00000000 // 0xbb000000 0x3b000000 // float4 g_avGroundColor[9]; // Offset: 928 Size: 144 [unused] // float4x4 g_mWorldViewProjection; // Offset: 1072 Size: 64 // float4x4 g_mView; // Offset: 1136 Size: 64 [unused] // float4x4 g_mWorldView; // Offset: 1200 Size: 64 [unused] // float3 chunkColor; // Offset: 1264 Size: 12 [unused] // float3 g_deltaCam; // Offset: 1280 Size: 12 // float4 mapSize; // Offset: 1296 Size: 16 [unused] // float4 skirtInfo; // Offset: 1312 Size: 16 // float4x4 g_textureRotation; // Offset: 1328 Size: 64 [unused] // float3 textureCoordsP1; // Offset: 1392 Size: 12 // float3 textureCoordsP2; // Offset: 1408 Size: 12 // float3 chunkInSectorCoords; // Offset: 1424 Size: 12 // float4 chunkInfo; // Offset: 1440 Size: 16 // float4 g_vSettings; // Offset: 1456 Size: 16 [unused] // float4 g_vPlaneSettings; // Offset: 1472 Size: 16 [unused] // float4 g_vPlaneOffset; // Offset: 1488 Size: 16 [unused] // float3 GrayK; // Offset: 1504 Size: 12 [unused] // = 0x3eaa7efa 0x3eaa7efa 0x3eaa7efa // float4 g_vForestFarSettings; // Offset: 1520 Size: 16 [unused] // float4 DetailOffset; // Offset: 1536 Size: 16 [unused] // float4 DetailSectorOffset; // Offset: 1552 Size: 16 [unused] // float4 DetailSettings; // Offset: 1568 Size: 16 [unused] // float4 ParalaxSettings; // Offset: 1584 Size: 16 [unused] // = 0x3e19999a 0x3f800000 0x43480000 0x00000000 // float4 DetailH[64]; // Offset: 1600 Size: 1024 [unused] // float4 DetailRTCoords; // Offset: 2624 Size: 16 [unused] // float4 g_vPRTSettings; // Offset: 2640 Size: 16 [unused] // = 0x00000000 0x00000000 0x42480000 0x3a000000 // float4 g_avMask[4]; // Offset: 2656 Size: 64 [unused] // = 0x3f800000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x3f800000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x3f800000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x3f800000 // float4 g_avPRTMask[4]; // Offset: 2720 Size: 64 [unused] // = 0x3f800000 0x00000000 0x00000000 0x00000000 // 0x00000000 0x3f800000 0x00000000 0x00000000 // 0x00000000 0x00000000 0x3f800000 0x00000000 // 0x00000000 0x00000000 0x00000000 0x3f800000 // // } // // // Resource Bindings: // // Name Type Format Dim Slot Elements // ------------------------------ ---------- ------- ----------- ---- -------- // $Globals cbuffer NA NA 0 1 // // // // Input signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // COLOR 0 xy 0 NONE float xy // SV_VertexID 0 x 1 VERTID uint x // SV_InstanceID 0 x 2 INSTID uint x // // // Output signature: // // Name Index Mask Register SysValue Format Used // -------------------- ----- ------ -------- -------- ------- ------ // SV_Position 0 xyzw 0 POS float xyzw // TEXCOORD 0 xyz 1 NONE float xyz // TEXCOORD 1 xy 2 NONE float xy // TEXCOORD 2 zw 2 NONE float zw // vs_4_0 dcl_constantbuffer cb0[91], immediateIndexed dcl_input v0.xy dcl_input_sgv v1.x, vertex_id dcl_input_sgv v2.x, instance_id dcl_output_siv o0.xyzw, position dcl_output o1.xyz dcl_output o2.xy dcl_output o2.zw dcl_temps 3 mad r0.xy, v0.yxyy, l(255.000000, 255.000000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000) ftou r0.xy, r0.xyxx ishl r0.x, r0.x, l(8) iadd r0.x, r0.x, r0.y ilt r0.y, l(0x00008000), r0.x if_nz r0.y iadd r0.x, r0.x, l(0xffff0000) endif itof r0.x, r0.x ftoi r0.y, cb0[82].x ige r0.z, v1.x, r0.y if_nz r0.z iadd r1.xyz, r0.yyyy, l(16, 32, 48, 0) ilt r0.zw, v1.xxxx, r1.xxxy if_nz r0.z iadd r0.z, v1.x, -r0.y itof r0.z, r0.z mul r0.z, r0.z, cb0[82].y mad r2.y, r0.z, l(50.000000), cb0[82].w mov r2.x, cb0[82].z else mov r2.xy, l(0,0,0,0) endif ige r0.z, v1.x, r1.x and r0.z, r0.w, r0.z if_nz r0.z iadd r0.z, v1.x, l(-16) iadd r0.w, r0.z, -r0.y itof r0.w, r0.w mul r0.w, r0.w, cb0[82].y mad r2.x, r0.w, l(50.000000), cb0[82].z mov r2.y, cb0[82].w else mov r0.z, v1.x endif ige r0.w, r0.z, r1.z if_nz r0.w iadd r0.z, r0.z, l(-48) iadd r0.w, r0.z, -r0.y itof r0.w, r0.w mul r0.w, r0.w, cb0[82].y mad r2.y, r0.w, l(50.000000), cb0[82].w mad r0.w, cb0[82].y, l(800.000000), cb0[82].z add r2.x, r0.w, -cb0[82].y endif ige r0.w, r0.z, r1.y ilt r1.x, r0.z, r1.z and r0.w, r0.w, r1.x if_nz r0.w iadd r0.z, r0.z, l(-32) iadd r0.y, r0.z, -r0.y itof r0.y, r0.y mul r0.y, r0.y, cb0[82].y mad r2.x, r0.y, l(50.000000), cb0[82].z mad r0.y, cb0[82].y, l(800.000000), cb0[82].w add r2.y, r0.y, -cb0[82].y endif else xor r0.y, v1.x, l(257) imax r0.z, v1.x, -v1.x udiv r0.z, null, r0.z, l(257) ineg r0.w, r0.z and r0.y, r0.y, l(0x80000000) movc r0.y, r0.y, r0.w, r0.z itof r1.y, r0.y imad r0.y, r0.y, l(-257), v1.x itof r1.x, r0.y mul r2.xy, r1.xyxx, l(50.000000, 50.000000, 0.000000, 0.000000) endif mul r2.z, r0.x, cb0[90].z add r0.xyz, r2.xzyx, cb0[80].xyzx utof r1.x, v2.x mul r1.x, r1.x, cb0[90].w mul r1.x, r1.x, l(0.500000) max r1.x, r1.x, l(0.100000) add r0.y, r0.y, r1.x mov r0.w, l(1.000000) dp4 o0.x, r0.xyzw, cb0[67].xyzw dp4 o0.y, r0.xyzw, cb0[68].xyzw dp4 o0.z, r0.xyzw, cb0[69].xyzw dp4 o0.w, r0.xyzw, cb0[70].xyzw add r1.xy, r2.xyxx, -cb0[89].xyxx div r1.xy, r1.xyxx, cb0[90].xyxx add r1.zw, -cb0[87].xxxy, cb0[88].xxxy mad o2.xy, r1.xyxx, r1.zwzz, cb0[87].xyxx mul r0.w, r2.y, cb0[46].x mad r1.x, -r2.x, l(0.0000781249983), l(1.000000) mul r1.z, r0.w, l(0.0000781249983) mul r1.w, r1.x, cb0[46].y add o2.zw, r1.zzzw, cb0[46].zzzw mov o1.xyz, r0.xyzx ret // Approximately 92 instruction slots used ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ [/code] I tried to fix some parts of it (I replaced uint by uint2 for v1&v2) but how do I fix the cb0[] calls ? I have the error: [code]78f0abe82da377f1-vs_replace.txt(96,27-29): error X3004: undeclared identifier 'cb0'[/code]
Hello,
I had a problem with this shader uncorrectly dumped by 3dmigoto:
cbuffer _Globals : register(b0)
{
float4x4 g_mCloudsShadowsSpace : packoffset(c0);
float4 g_vCloudsShadowDesc : packoffset(c4);
float4 g_vKSettings : packoffset(c5);
float4x4 g_mPrevObjViewProj : packoffset(c6);
float4 SmoothOffs : packoffset(c10) = {0.0009765625,0.0009765625,1,1};
float4x4 LightSpace : packoffset(c11);
float4 ShadowsDesc : packoffset(c15);
float4 specColor : packoffset(c16);
float4 ControlData : packoffset(c17);
float4 difColor : packoffset(c18);
float4 ambient : packoffset(c19);
float4 g_vDefLightDir : packoffset(c20);
float4 g_vDefLightColor : packoffset(c21);
float4 g_vDefSpecColor : packoffset(c22);
uint CS_FRONT : packoffset(c23) = 0x00000000;
uint CS_RIGHT : packoffset(c23) = = 0x00000001;
uint CS_BACK : packoffset(c23) = 0x00000002;
uint CS_LEFT : packoffset(c23) = 0x00000003;
uint CS_TOP : packoffset(c24) = 0x00000004;
uint CS_BOTTOM : packoffset(c24) = 0x00000005;
float4 g_vAmbientSettings : packoffset(c25);
float4 g_vScreenDepthRect : packoffset(c26);

struct
{
float4 vDesc;
float4 vFogLayerPlane;
float4 vFogLayerColor;
float4 vFogLayerSettings;
float4 vFogColor;
float4 vFogDistance;
} g_FogDesc : packoffset(c27);

float4 g_vForestPlaneThreshold : packoffset(c33) = {1300,0.00200000009,0,0};
float4 LowDeepColor : packoffset(c34) = {0.300000012,0.400000006,0.400000006,0};
float4 SeaColor : packoffset(c35) = {0.100000001,0.300000012,0.300000012,0};
float4 DetailScale : packoffset(c36) = {1,1,1,1};
float4 g_vIceScale : packoffset(c37) = {1,1,1,1};
float4 g_vSpecSettings : packoffset(c38) = {1,1,1,1};
float4 g_vSeaCorrection : packoffset(c39);
float4 g_vSeaDesc : packoffset(c40) = {0.400000006,0.600000024,4,0.980000019};
float4 g_vSeaHarmonics : packoffset(c41) = {1,1,1,1};
float4 WaterDesc : packoffset(c42) = {0.400000006,0.600000024,4,0.980000019};
float4 g_vWaterColor : packoffset(c43) = {1,0,0,0};
float4 g_vWaterSpecColor : packoffset(c44) = {1,1,1,80};
float4 Anim : packoffset(c45);
float4 g_vAsyncTextureSize : packoffset(c46) = {1,1,0,0};
float4 g_vRTTexSize : packoffset(c47);
float4 g_vAnisotropy : packoffset(c48);
float2 TexelOffs[9] : packoffset(c49) = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};



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


void main(
float2 v0 : COLOR0,
uint2 v1 : SV_VertexID0,
uint2 v2 : SV_InstanceID0,
out float4 o0 : SV_Position0,
out float4 o1 : TEXCOORD0,
out float2 o2 : TEXCOORD1,
out float2 p2 : TEXCOORD2)
{
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v1.x, vertex_id
// Needs manual fix for instruction:
// unknown dcl_: dcl_input_sgv v2.x, instance_id
float4 r0,r1,r2;
uint4 bitmask, uiDest;
float4 fDest;

r0.xy = v0.yx * float2(255,255) + float2(0.5,0.5);
r0.xy = (uint2)r0.xy;
r0.x = (uint)r0.x << 8;
r0.x = (int)r0.x + (int)r0.y;
r0.y = cmp(0x00008000 < (int)r0.x);
if (r0.y != 0) {
r0.x = (int)r0.x + 0xffff0000;
}
r0.x = (int)r0.x;
r0.y = (int)cb0[82].x;
r0.z = cmp((int)v1.x >= (int)r0.y);
if (r0.z != 0) {
r1.xyz = (int3)r0.yyy + int3(16,32,48);
r0.zw = cmp((int2)v1.xx < (int2)r1.xy);
if (r0.z != 0) {
r0.z = (int)v1.x + (int)-r0.y;
r0.z = (int)r0.z;
r0.z = cb0[82].y * r0.z;
r2.y = r0.z * 50 + cb0[82].w;
r2.x = cb0[82].z;
} else {
r2.xy = float2(0,0);
}
r0.z = cmp((int)v1.x >= (int)r1.x);
r0.z = r0.w ? r0.z : 0;
if (r0.z != 0) {
r0.z = (int)v1.x + -16;
r0.w = (int)r0.z + (int)-r0.y;
r0.w = (int)r0.w;
r0.w = cb0[82].y * r0.w;
r2.x = r0.w * 50 + cb0[82].z;
r2.y = cb0[82].w;
} else {
r0.z = v1.x;
}
r0.w = cmp((int)r0.z >= (int)r1.z);
if (r0.w != 0) {
r0.z = (int)r0.z + -48;
r0.w = (int)r0.z + (int)-r0.y;
r0.w = (int)r0.w;
r0.w = cb0[82].y * r0.w;
r2.y = r0.w * 50 + cb0[82].w;
r0.w = cb0[82].y * 800 + cb0[82].z;
r2.x = cb0[82].y + r0.w;
}
r0.w = cmp((int)r0.z >= (int)r1.y);
r1.x = cmp((int)r0.z < (int)r1.z);
r0.w = r0.w ? r1.x : 0;
if (r0.w != 0) {
r0.z = (int)r0.z + -32;
r0.y = (int)r0.z + (int)-r0.y;
r0.y = (int)r0.y;
r0.y = cb0[82].y * r0.y;
r2.x = r0.y * 50 + cb0[82].z;
r0.y = cb0[82].y * 800 + cb0[82].w;
r2.y = cb0[82].y + r0.y;
}
} else {
r0.y = (int)v1.x ^ 257;
r0.z = max((int)-v1.x, (int)v1.x);
uiDest.z = (uint)r0.z / 257;
r0.z = uiDest.z;
r0.w = -(int)r0.z;
r0.y = (int)r0.y & 0x80000000;
r0.y = r0.y ? r0.w : r0.z;
r1.y = (int)r0.y;
r0.y = mad((int)r0.y, -257, (int)v1.x);
r1.x = (int)r0.y;
r2.xy = float2(50,50) * r1.xy;
}
r2.z = cb0[90].z * r0.x;
r0.xyz = cb0[80].xyzx + r2.xzy;
r1.x = (uint)v2.x;
r1.x = cb0[90].w * r1.x;
r1.x = 0.5 * r1.x;
r1.x = max(0.100000001, r1.x);
r0.y = r1.x + r0.y;
r0.w = 1;
o0.x = dot(r0.xyzw, cb0[67].xyzw);
o0.y = dot(r0.xyzw, cb0[68].xyzw);
o0.z = dot(r0.xyzw, cb0[69].xyzw);
o0.w = dot(r0.xyzw, cb0[70].xyzw);
r1.xy = cb0[89].xyxx + r2.xy;
r1.xy = r1.xy / cb0[90].xyxx;
r1.zw = cb0[88].xxxy + cb0[87].xxxy;
o2.xy = r1.xy * r1.zw + cb0[87].xyxx;
r0.w = g_vAsyncTextureSize.x * r2.y;
r1.x = -r2.x * 7.81249983e-005 + 1;
r1.z = 7.81249983e-005 * r0.w;
r1.w = g_vAsyncTextureSize.y * r1.x;
p2.xy = g_vAsyncTextureSize.zw + r1.zw;
o1.xyz = r0.xyz;
return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// using 3Dmigoto v1.2.57 on Sun Jun 18 17:07:52 2017
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
// float4x4 g_mCloudsShadowsSpace; // Offset: 0 Size: 64 [unused]
// float4 g_vCloudsShadowDesc; // Offset: 64 Size: 16 [unused]
// float4 g_vKSettings; // Offset: 80 Size: 16 [unused]
// float4x4 g_mPrevObjViewProj; // Offset: 96 Size: 64 [unused]
// float4 SmoothOffs; // Offset: 160 Size: 16 [unused]
// = 0x3a800000 0x3a800000 0x3f800000 0x3f800000
// float4x4 LightSpace; // Offset: 176 Size: 64 [unused]
// float4 ShadowsDesc; // Offset: 240 Size: 16 [unused]
// float4 specColor; // Offset: 256 Size: 16 [unused]
// float4 ControlData; // Offset: 272 Size: 16 [unused]
// float4 difColor; // Offset: 288 Size: 16 [unused]
// float4 ambient; // Offset: 304 Size: 16 [unused]
// float4 g_vDefLightDir; // Offset: 320 Size: 16 [unused]
// float4 g_vDefLightColor; // Offset: 336 Size: 16 [unused]
// float4 g_vDefSpecColor; // Offset: 352 Size: 16 [unused]
// uint CS_FRONT; // Offset: 368 Size: 4 [unused]
// = 0x00000000
// uint CS_RIGHT; // Offset: 372 Size: 4 [unused]
// = 0x00000001
// uint CS_BACK; // Offset: 376 Size: 4 [unused]
// = 0x00000002
// uint CS_LEFT; // Offset: 380 Size: 4 [unused]
// = 0x00000003
// uint CS_TOP; // Offset: 384 Size: 4 [unused]
// = 0x00000004
// uint CS_BOTTOM; // Offset: 388 Size: 4 [unused]
// = 0x00000005
// float4 g_vAmbientSettings; // Offset: 400 Size: 16 [unused]
// float4 g_vScreenDepthRect; // Offset: 416 Size: 16 [unused]
//
// struct
// {
//
// float4 vDesc; // Offset: 432
// float4 vFogLayerPlane; // Offset: 448
// float4 vFogLayerColor; // Offset: 464
// float4 vFogLayerSettings; // Offset: 480
// float4 vFogColor; // Offset: 496
// float4 vFogDistance; // Offset: 512
//
// } g_FogDesc; // Offset: 432 Size: 96 [unused]
// float4 g_vForestPlaneThreshold; // Offset: 528 Size: 16 [unused]
// = 0x44a28000 0x3b03126f 0x00000000 0x00000000
// float4 LowDeepColor; // Offset: 544 Size: 16 [unused]
// = 0x3e99999a 0x3ecccccd 0x3ecccccd 0x00000000
// float4 SeaColor; // Offset: 560 Size: 16 [unused]
// = 0x3dcccccd 0x3e99999a 0x3e99999a 0x00000000
// float4 DetailScale; // Offset: 576 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 g_vIceScale; // Offset: 592 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 g_vSpecSettings; // Offset: 608 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 g_vSeaCorrection; // Offset: 624 Size: 16 [unused]
// float4 g_vSeaDesc; // Offset: 640 Size: 16 [unused]
// = 0x3ecccccd 0x3f19999a 0x40800000 0x3f7ae148
// float4 g_vSeaHarmonics; // Offset: 656 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x3f800000
// float4 WaterDesc; // Offset: 672 Size: 16 [unused]
// = 0x3ecccccd 0x3f19999a 0x40800000 0x3f7ae148
// float4 g_vWaterColor; // Offset: 688 Size: 16 [unused]
// = 0x3f800000 0x00000000 0x00000000 0x00000000
// float4 g_vWaterSpecColor; // Offset: 704 Size: 16 [unused]
// = 0x3f800000 0x3f800000 0x3f800000 0x42a00000
// float4 Anim; // Offset: 720 Size: 16 [unused]
// float4 g_vAsyncTextureSize; // Offset: 736 Size: 16
// = 0x3f800000 0x3f800000 0x00000000 0x00000000
// float4 g_vRTTexSize; // Offset: 752 Size: 16 [unused]
// float4 g_vAnisotropy; // Offset: 768 Size: 16 [unused]
// float2 TexelOffs[9]; // Offset: 784 Size: 136 [unused]
// = 0x00000000 0x00000000 0x00000000 0x00000000
// 0xba800000 0x00000000 0x00000000 0x00000000
// 0x3a800000 0x00000000 0x00000000 0x00000000
// 0x00000000 0xba800000 0x00000000 0x00000000
// 0x00000000 0x3a800000 0x00000000 0x00000000
// 0xbb000000 0xbb000000 0x00000000 0x00000000
// 0x3b000000 0xbb000000 0x00000000 0x00000000
// 0x3b000000 0x3b000000 0x00000000 0x00000000
// 0xbb000000 0x3b000000
// float4 g_avGroundColor[9]; // Offset: 928 Size: 144 [unused]
// float4x4 g_mWorldViewProjection; // Offset: 1072 Size: 64
// float4x4 g_mView; // Offset: 1136 Size: 64 [unused]
// float4x4 g_mWorldView; // Offset: 1200 Size: 64 [unused]
// float3 chunkColor; // Offset: 1264 Size: 12 [unused]
// float3 g_deltaCam; // Offset: 1280 Size: 12
// float4 mapSize; // Offset: 1296 Size: 16 [unused]
// float4 skirtInfo; // Offset: 1312 Size: 16
// float4x4 g_textureRotation; // Offset: 1328 Size: 64 [unused]
// float3 textureCoordsP1; // Offset: 1392 Size: 12
// float3 textureCoordsP2; // Offset: 1408 Size: 12
// float3 chunkInSectorCoords; // Offset: 1424 Size: 12
// float4 chunkInfo; // Offset: 1440 Size: 16
// float4 g_vSettings; // Offset: 1456 Size: 16 [unused]
// float4 g_vPlaneSettings; // Offset: 1472 Size: 16 [unused]
// float4 g_vPlaneOffset; // Offset: 1488 Size: 16 [unused]
// float3 GrayK; // Offset: 1504 Size: 12 [unused]
// = 0x3eaa7efa 0x3eaa7efa 0x3eaa7efa
// float4 g_vForestFarSettings; // Offset: 1520 Size: 16 [unused]
// float4 DetailOffset; // Offset: 1536 Size: 16 [unused]
// float4 DetailSectorOffset; // Offset: 1552 Size: 16 [unused]
// float4 DetailSettings; // Offset: 1568 Size: 16 [unused]
// float4 ParalaxSettings; // Offset: 1584 Size: 16 [unused]
// = 0x3e19999a 0x3f800000 0x43480000 0x00000000
// float4 DetailH[64]; // Offset: 1600 Size: 1024 [unused]
// float4 DetailRTCoords; // Offset: 2624 Size: 16 [unused]
// float4 g_vPRTSettings; // Offset: 2640 Size: 16 [unused]
// = 0x00000000 0x00000000 0x42480000 0x3a000000
// float4 g_avMask[4]; // Offset: 2656 Size: 64 [unused]
// = 0x3f800000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x3f800000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x3f800000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x3f800000
// float4 g_avPRTMask[4]; // Offset: 2720 Size: 64 [unused]
// = 0x3f800000 0x00000000 0x00000000 0x00000000
// 0x00000000 0x3f800000 0x00000000 0x00000000
// 0x00000000 0x00000000 0x3f800000 0x00000000
// 0x00000000 0x00000000 0x00000000 0x3f800000
//
// }
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// $Globals cbuffer NA NA 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// COLOR 0 xy 0 NONE float xy
// SV_VertexID 0 x 1 VERTID uint x
// SV_InstanceID 0 x 2 INSTID uint x
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position 0 xyzw 0 POS float xyzw
// TEXCOORD 0 xyz 1 NONE float xyz
// TEXCOORD 1 xy 2 NONE float xy
// TEXCOORD 2 zw 2 NONE float zw
//
vs_4_0
dcl_constantbuffer cb0[91], immediateIndexed
dcl_input v0.xy
dcl_input_sgv v1.x, vertex_id
dcl_input_sgv v2.x, instance_id
dcl_output_siv o0.xyzw, position
dcl_output o1.xyz
dcl_output o2.xy
dcl_output o2.zw
dcl_temps 3
mad r0.xy, v0.yxyy, l(255.000000, 255.000000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
ftou r0.xy, r0.xyxx
ishl r0.x, r0.x, l(8)
iadd r0.x, r0.x, r0.y
ilt r0.y, l(0x00008000), r0.x
if_nz r0.y
iadd r0.x, r0.x, l(0xffff0000)
endif
itof r0.x, r0.x
ftoi r0.y, cb0[82].x
ige r0.z, v1.x, r0.y
if_nz r0.z
iadd r1.xyz, r0.yyyy, l(16, 32, 48, 0)
ilt r0.zw, v1.xxxx, r1.xxxy
if_nz r0.z
iadd r0.z, v1.x, -r0.y
itof r0.z, r0.z
mul r0.z, r0.z, cb0[82].y
mad r2.y, r0.z, l(50.000000), cb0[82].w
mov r2.x, cb0[82].z
else
mov r2.xy, l(0,0,0,0)
endif
ige r0.z, v1.x, r1.x
and r0.z, r0.w, r0.z
if_nz r0.z
iadd r0.z, v1.x, l(-16)
iadd r0.w, r0.z, -r0.y
itof r0.w, r0.w
mul r0.w, r0.w, cb0[82].y
mad r2.x, r0.w, l(50.000000), cb0[82].z
mov r2.y, cb0[82].w
else
mov r0.z, v1.x
endif
ige r0.w, r0.z, r1.z
if_nz r0.w
iadd r0.z, r0.z, l(-48)
iadd r0.w, r0.z, -r0.y
itof r0.w, r0.w
mul r0.w, r0.w, cb0[82].y
mad r2.y, r0.w, l(50.000000), cb0[82].w
mad r0.w, cb0[82].y, l(800.000000), cb0[82].z
add r2.x, r0.w, -cb0[82].y
endif
ige r0.w, r0.z, r1.y
ilt r1.x, r0.z, r1.z
and r0.w, r0.w, r1.x
if_nz r0.w
iadd r0.z, r0.z, l(-32)
iadd r0.y, r0.z, -r0.y
itof r0.y, r0.y
mul r0.y, r0.y, cb0[82].y
mad r2.x, r0.y, l(50.000000), cb0[82].z
mad r0.y, cb0[82].y, l(800.000000), cb0[82].w
add r2.y, r0.y, -cb0[82].y
endif
else
xor r0.y, v1.x, l(257)
imax r0.z, v1.x, -v1.x
udiv r0.z, null, r0.z, l(257)
ineg r0.w, r0.z
and r0.y, r0.y, l(0x80000000)
movc r0.y, r0.y, r0.w, r0.z
itof r1.y, r0.y
imad r0.y, r0.y, l(-257), v1.x
itof r1.x, r0.y
mul r2.xy, r1.xyxx, l(50.000000, 50.000000, 0.000000, 0.000000)
endif
mul r2.z, r0.x, cb0[90].z
add r0.xyz, r2.xzyx, cb0[80].xyzx
utof r1.x, v2.x
mul r1.x, r1.x, cb0[90].w
mul r1.x, r1.x, l(0.500000)
max r1.x, r1.x, l(0.100000)
add r0.y, r0.y, r1.x
mov r0.w, l(1.000000)
dp4 o0.x, r0.xyzw, cb0[67].xyzw
dp4 o0.y, r0.xyzw, cb0[68].xyzw
dp4 o0.z, r0.xyzw, cb0[69].xyzw
dp4 o0.w, r0.xyzw, cb0[70].xyzw
add r1.xy, r2.xyxx, -cb0[89].xyxx
div r1.xy, r1.xyxx, cb0[90].xyxx
add r1.zw, -cb0[87].xxxy, cb0[88].xxxy
mad o2.xy, r1.xyxx, r1.zwzz, cb0[87].xyxx
mul r0.w, r2.y, cb0[46].x
mad r1.x, -r2.x, l(0.0000781249983), l(1.000000)
mul r1.z, r0.w, l(0.0000781249983)
mul r1.w, r1.x, cb0[46].y
add o2.zw, r1.zzzw, cb0[46].zzzw
mov o1.xyz, r0.xyzx
ret
// Approximately 92 instruction slots used

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

I tried to fix some parts of it (I replaced uint by uint2 for v1&v2) but how do I fix the cb0[] calls ?
I have the error:
78f0abe82da377f1-vs_replace.txt(96,27-29): error X3004: undeclared identifier 'cb0'

Posted 06/18/2017 03:39 PM   
[quote="lefuneste"]how do I fix the cb0[] calls ? [/quote] Copy it from another shader if it's available. If not, try copying this above "void main": [code] cbuffer cb0 : register(b0) { float4 cb0[121]; } [/code] If 121 is a too high value, try 96 or something, but it has to be at least one number higher than the highest cb0 use in the shader (IIRC). I think you won't have this problem in ASM anyway, unless you absolutely need/want to use the HLSL code.
lefuneste said:how do I fix the cb0[] calls ?


Copy it from another shader if it's available. If not, try copying this above "void main":

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


If 121 is a too high value, try 96 or something, but it has to be at least one number higher than the highest cb0 use in the shader (IIRC).


I think you won't have this problem in ASM anyway, unless you absolutely need/want to use the HLSL code.

CPU: Intel Core i7 7700K @ 4.9GHz
Motherboard: Gigabyte Aorus GA-Z270X-Gaming 5
RAM: GSKILL Ripjaws Z 16GB 3866MHz CL18
GPU: MSI GeForce RTX 2080Ti Gaming X Trio
Monitor: Asus PG278QR
Speakers: Logitech Z506
Donations account: masterotakusuko@gmail.com

Posted 06/18/2017 05:52 PM   
  91 / 143    
Scroll To Top