Bo3b's School For Shaderhackers
  24 / 88    
Yes!!! Shaders are now cyclic-able! Great suggestion for logging inputs. The ini was set to: Num 1 etc. My keyboard's num keys are set to: NUM 1 etc. Case sensitive. Have to endure a day of playing toys and dolls with the family. Can't wait to isolate and kill that shader! SoM's Nemesis system right? >:D Cheers mate! :)
Yes!!! Shaders are now cyclic-able!

Great suggestion for logging inputs.

The ini was set to: Num 1 etc.
My keyboard's num keys are set to: NUM 1 etc.
Case sensitive.

Have to endure a day of playing toys and dolls with the family. Can't wait to isolate and kill that shader! SoM's Nemesis system right? >:D

Cheers mate! :)

Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.-------------------Vitals: Windows 10 64bit, Ryzen 5 2600x, GTX 1070, 16GB, 3D Vision, CV1
Handy Driver DiscussionHelix Mod - community fixes Bo3b's Shaderhacker School - How to fix 3D in games3dsolutionsgaming.com - videos, reviews and 3D fixes

Posted 12/26/2014 09:51 AM   
[snip] EDIT All done! :) 3Dmigoto is a lot quicker to use than helix! I love how it only cycles through active shaders! :)
[snip]

EDIT
All done! :)

3Dmigoto is a lot quicker to use than helix! I love how it only cycles through active shaders! :)

Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.-------------------Vitals: Windows 10 64bit, Ryzen 5 2600x, GTX 1070, 16GB, 3D Vision, CV1
Handy Driver DiscussionHelix Mod - community fixes Bo3b's Shaderhacker School - How to fix 3D in games3dsolutionsgaming.com - videos, reviews and 3D fixes

Posted 12/26/2014 03:18 PM   
[quote="andysonofbob"][snip] EDIT All done! :) 3Dmigoto is a lot quicker to use than helix! I love how it only cycles through active shaders! :)[/quote] Hey, awesome! Is this your first fix?
andysonofbob said:[snip]

EDIT
All done! :)

3Dmigoto is a lot quicker to use than helix! I love how it only cycles through active shaders! :)

Hey, awesome! Is this your first fix?

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 12/27/2014 03:39 AM   
Thanks mate! But you and Mike fixed it, I just removed a rogue effect you dudes missed; it's not exactly a game breaking one! But yeah, for 3DMigoto, first tweak. I enjoyed it. 3Dmigoto is far less time consuming than the Helix I remember (before bo3b's School Lesson 1 let me know of the lovely UseRenderedShaders=true anyway). For any absolute beginner wanting to have a go disabling shaders in DX11 games using 3Dmigoto, it is really simple. Watch (only need to watch) bo3b's Lesson 1 to see how to hunt and mark (or save) the two types of shaders, then look at the two files I have attached to see how to do what's needed in 3Dmigoto; THEN look at Bo3b's ten step guide previous page to see how to do it. '[i]Worked Example Shader 6ebdae5f6cbd2a5f-vs_replace.txt[/i]' is a worked example. '[i]cbcd0f37340122de-ps_replace.txt[/i]' is the referenced disabled shader for you to look at and compare. I didn't mention how to install 3Dmigoto because I think the game I used is a weird one. [u][b]Problem solving (from one noob to the next):[/b][/u] If the numberpad keys don't work. Check the [b]d3dx.ini[/b]. Look for [b]next_pixelshader=Num 2[/b] etc. I had to change: [b]next_pixelshader=Num 2[/b] etc. to [b]next_pixelshader=NUM 2[/b] etc. case sensitive. In the [b]d3dx.ini[/b] change [b]marking_mode=skip[/b] to [b]marking_mode=mono[/b] This help spot shaders that have pairs of identical pixel and vertex shaders.
Thanks mate!

But you and Mike fixed it, I just removed a rogue effect you dudes missed; it's not exactly a game breaking one! But yeah, for 3DMigoto, first tweak.

I enjoyed it. 3Dmigoto is far less time consuming than the Helix I remember (before bo3b's School Lesson 1 let me know of the lovely UseRenderedShaders=true anyway).

For any absolute beginner wanting to have a go disabling shaders in DX11 games using 3Dmigoto, it is really simple. Watch (only need to watch) bo3b's Lesson 1 to see how to hunt and mark (or save) the two types of shaders, then look at the two files I have attached to see how to do what's needed in 3Dmigoto; THEN look at Bo3b's ten step guide previous page to see how to do it.

'Worked Example Shader 6ebdae5f6cbd2a5f-vs_replace.txt' is a worked example.
'cbcd0f37340122de-ps_replace.txt' is the referenced disabled shader for you to look at and compare.

I didn't mention how to install 3Dmigoto because I think the game I used is a weird one.


Problem solving (from one noob to the next):
If the numberpad keys don't work. Check the d3dx.ini. Look for next_pixelshader=Num 2 etc.
I had to change: next_pixelshader=Num 2 etc. to next_pixelshader=NUM 2 etc. case sensitive.

In the d3dx.ini change marking_mode=skip to marking_mode=mono
This help spot shaders that have pairs of identical pixel and vertex shaders.

Lord, grant me the serenity to accept the things I cannot change, the courage to change the things I can, and the wisdom to know the difference.-------------------Vitals: Windows 10 64bit, Ryzen 5 2600x, GTX 1070, 16GB, 3D Vision, CV1
Handy Driver DiscussionHelix Mod - community fixes Bo3b's Shaderhacker School - How to fix 3D in games3dsolutionsgaming.com - videos, reviews and 3D fixes

Posted 12/27/2014 01:13 PM   
Bo3b/others, can you guys throw some light on the VS & PS instructions as well? I understand that this is not a must for fixing games, but a basic understanding of some of these operations will help. I've looked at http://msdn.microsoft.com/en-us/library/windows/desktop/bb219854(v=vs.85).aspx but some things aren't clear. For example, in some of the shaders for "The Ball" I see 4 operands for a cmp operation. How does this work? [code] cmp r0, c0, r1, r2 [/code]
Bo3b/others, can you guys throw some light on the VS & PS instructions as well? I understand that this is not a must for fixing games, but a basic understanding of some of these operations will help. I've looked at http://msdn.microsoft.com/en-us/library/windows/desktop/bb219854(v=vs.85).aspx but some things aren't clear. For example, in some of the shaders for "The Ball" I see 4 operands for a cmp operation. How does this work?
cmp r0, c0, r1, r2

Posted 12/30/2014 04:49 AM   
You're on the right track with the documentation, I take it you found the page on the cmp instruction? http://msdn.microsoft.com/en-us/library/windows/desktop/bb204832(v=vs.85).aspx What that says is if c0 is greater than or equal to 0, r1 will be copied to r0, otherwise it will get r2 instead. This is done on a per channel basis, so it's possible for some channels or r0 to be taken from r1 and others from r2, like this example: [code] Inputs: r1=1,2,3,4 r2=5,6,7,8 c0=1,1,-1,-1 Output: r0=1,2,7,8 [/code] It's usually just used as an optimisation of the relatively slow if_eq family of instructions - GPUs suck at branching so when devs need to optimise their games they will replace branches in their shaders with these type of conditionals.
You're on the right track with the documentation, I take it you found the page on the cmp instruction? http://msdn.microsoft.com/en-us/library/windows/desktop/bb204832(v=vs.85).aspx

What that says is if c0 is greater than or equal to 0, r1 will be copied to r0, otherwise it will get r2 instead. This is done on a per channel basis, so it's possible for some channels or r0 to be taken from r1 and others from r2, like this example:
Inputs:
r1=1,2,3,4
r2=5,6,7,8
c0=1,1,-1,-1

Output:
r0=1,2,7,8


It's usually just used as an optimisation of the relatively slow if_eq family of instructions - GPUs suck at branching so when devs need to optimise their games they will replace branches in their shaders with these type of conditionals.

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 12/30/2014 05:16 AM   
Thanks DarkStarSword. That was really helpful.
Thanks DarkStarSword. That was really helpful.

Posted 12/30/2014 05:30 AM   
I've played through to the last level of "The Ball" demo (where the worm is trying to kill you), but try as I might, I haven't been able to find the shader for the broken water effect or the black corruption around the gun when looking at water. Has anyone else had any luck with these shaders?
I've played through to the last level of "The Ball" demo (where the worm is trying to kill you), but try as I might, I haven't been able to find the shader for the broken water effect or the black corruption around the gun when looking at water. Has anyone else had any luck with these shaders?

Posted 12/30/2014 06:41 AM   
[quote="eroc_remag"]I've played through to the last level of "The Ball" demo (where the worm is trying to kill you), but try as I might, I haven't been able to find the shader for the broken water effect or the black corruption around the gun when looking at water. Has anyone else had any luck with these shaders?[/quote] Yep, sorry about that. I kinda sandbagged you guys there because that one does not seem to show up when hunting. This brings up the alternate technique though of searching through the dumps folder to find related shaders. Read the thread from here: [url]https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4314304/#4314304[/url] And you'll find that 4everawake found the shader by going offline into the dumps folder.
eroc_remag said:I've played through to the last level of "The Ball" demo (where the worm is trying to kill you), but try as I might, I haven't been able to find the shader for the broken water effect or the black corruption around the gun when looking at water. Has anyone else had any luck with these shaders?

Yep, sorry about that. I kinda sandbagged you guys there because that one does not seem to show up when hunting.

This brings up the alternate technique though of searching through the dumps folder to find related shaders.

Read the thread from here:
https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4314304/#4314304

And you'll find that 4everawake found the shader by going offline into the dumps folder.

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 12/30/2014 08:07 AM   
B03b, I've gone through Lesson 6 today & tried the fix myself. I've made the changes that you suggest & also defined the DefPSSampler=14 in DX9Settings.ini. Surprisingly the fix did not work. Here's my code: [code] def c200, 0, 1, 0.0625, 0 ... dcl_2d s14 //Helix sampler ... abs r0.w, c200.y if_ne r0.w, -r0.w texld r1, c200.z, s14 add r1.y, -r1.y, v1.w mad r1.x, r1.x, r1.y, v1.x mov r1.yz, v1.xyww else mov r1.xyz, c18.z endif [/code] What could be going wrong here?
B03b, I've gone through Lesson 6 today & tried the fix myself. I've made the changes that you suggest & also defined the DefPSSampler=14 in DX9Settings.ini. Surprisingly the fix did not work.

Here's my code:
def c200, 0, 1, 0.0625, 0
...
dcl_2d s14 //Helix sampler
...
abs r0.w, c200.y
if_ne r0.w, -r0.w
texld r1, c200.z, s14
add r1.y, -r1.y, v1.w
mad r1.x, r1.x, r1.y, v1.x
mov r1.yz, v1.xyww
else
mov r1.xyz, c18.z
endif


What could be going wrong here?

Posted 01/02/2015 10:15 AM   
Just a thought, in your DX9Settings.ini did you add a comment on the same line like you did in the above code, if so that can cause issues. Pretty sure it's fine in the Shader code just not in the [url=https://forums.geforce.com/default/topic/766890/3d-vision/bo3bs-school-for-shaderhackers/post/4387638/#4387638]ini[/url].
Just a thought, in your DX9Settings.ini did you add a comment on the same line like you did in the above code, if so that can cause issues. Pretty sure it's fine in the Shader code just not in the ini.
Posted 01/02/2015 04:08 PM   
[quote="eroc_remag"]B03b, I've gone through Lesson 6 today & tried the fix myself. I've made the changes that you suggest & also defined the DefPSSampler=14 in DX9Settings.ini. Surprisingly the fix did not work. Here's my code: [code] def c200, 0, 1, 0.0625, 0 ... dcl_2d s14 //Helix sampler ... abs r0.w, c200.y if_ne r0.w, -r0.w texld r1, c200.z, s14 add r1.y, -r1.y, v1.w mad r1.x, r1.x, r1.y, v1.x mov r1.yz, v1.xyww else mov r1.xyz, c18.z endif [/code] What could be going wrong here? [/quote] I don't see anything immediately wrong with your sequence. When stuck with something like this, you'll need to do experiments. Go back to simpler code and sequences to make sure it's assembling for example, then build back up to the full fix. It's not possible to do code-inspection fixes because there are game mysteries that we cannot ever see. Best to adopt the mindset that it's all super fragile and won't necessarily work the way it's supposed to. For this one, I'd start by making sure the code is still executing by putting a mov r1, c200.w instruction to set it all to zero and make sure it's still being assembled and running. With F10 reloads, it easy to incrementally try things.
eroc_remag said:B03b, I've gone through Lesson 6 today & tried the fix myself. I've made the changes that you suggest & also defined the DefPSSampler=14 in DX9Settings.ini. Surprisingly the fix did not work.

Here's my code:
def c200, 0, 1, 0.0625, 0
...
dcl_2d s14 //Helix sampler
...
abs r0.w, c200.y
if_ne r0.w, -r0.w
texld r1, c200.z, s14
add r1.y, -r1.y, v1.w
mad r1.x, r1.x, r1.y, v1.x
mov r1.yz, v1.xyww
else
mov r1.xyz, c18.z
endif


What could be going wrong here?

I don't see anything immediately wrong with your sequence.

When stuck with something like this, you'll need to do experiments. Go back to simpler code and sequences to make sure it's assembling for example, then build back up to the full fix. It's not possible to do code-inspection fixes because there are game mysteries that we cannot ever see. Best to adopt the mindset that it's all super fragile and won't necessarily work the way it's supposed to.

For this one, I'd start by making sure the code is still executing by putting a mov r1, c200.w instruction to set it all to zero and make sure it's still being assembled and running. With F10 reloads, it easy to incrementally try things.

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 01/03/2015 11:41 AM   
Hello bo3b, I stumbled last week over your tutorials (had not much time the last months for 3D-Vision-gaming) and finished the lessons. Pretty good work. :) For me as a noob, It was hard to find out, what the different registers are (c, s, o, r). Now I tried to make a shiftable HUD for AlanWake-AmericanNightmare and stumbled over a few problems. I painfully recognised after a lot trying that the output registers can't be overwritten. So a "mov r3, o0" and later "mov o0, r3" is useless for manipulating the o0 .Maybe a typical beginner-mistake. Next thing was the allready used samplers in the game, so s0 was not useable. Had to set "DefVSSampler = 258". Confusing that 258 is s1 and not s258. The next beginner mistake. This led me to a question: [b][i][color="orange"]Is there a full list with all commands and defaults of the dx9settings.ini ?[/color] [/i][/b] Next problem is, with shifting the HUD it distracts with the menu-background. Simple thing was to shift the VS of the background the same way as the HUD. But now I tried to make an offset to the HUD so the HUD hovers over the background. I tried something like this: [code]// "DefVSConst1 = 250" "Const2 = 0x3e4ccccd" in dx9settings.ini def c220, 0.2, 0, 0.0625, 0 //c220.x menu-offset ... texldl r1, c220.z, s1 add r30.x, c250.y, c220.x //Depth-Offset from Menu //MultiplyAdd(mad) Xnew(r3.x) = Xold(r3.x) + Separation(r1.x) * ((W)HUD-Depth c250.y)) mad r3.x, r1.x, r30.x, r3.x mov o0, r3 [/code] But the "add r30.x, c250.y, c220.x" distorts the VS and zooms the upper left corner of the background. As a first workaround I set "Const3 = 0x3dcccccd" and doing "add r30.x, c250.y, c250.z". That works fine. [b][i][color="orange"]So why can't I add the VSConst (c250.y) with a constant register(c220.x)?[/color] [/i][/b]
Hello bo3b,
I stumbled last week over your tutorials (had not much time the last months for 3D-Vision-gaming) and finished the lessons. Pretty good work. :)
For me as a noob, It was hard to find out, what the different registers are (c, s, o, r).

Now I tried to make a shiftable HUD for AlanWake-AmericanNightmare and stumbled over a few problems.
I painfully recognised after a lot trying that the output registers can't be overwritten. So a "mov r3, o0" and later "mov o0, r3" is useless for manipulating the o0 .Maybe a typical beginner-mistake.

Next thing was the allready used samplers in the game, so s0 was not useable. Had to set "DefVSSampler = 258". Confusing that 258 is s1 and not s258. The next beginner mistake.

This led me to a question:
Is there a full list with all commands and defaults of the dx9settings.ini ?


Next problem is, with shifting the HUD it distracts with the menu-background. Simple thing was to shift the VS of the background the same way as the HUD.
But now I tried to make an offset to the HUD so the HUD hovers over the background.
I tried something like this:
// "DefVSConst1 = 250" "Const2 = 0x3e4ccccd" in dx9settings.ini
def c220, 0.2, 0, 0.0625, 0 //c220.x menu-offset
...
texldl r1, c220.z, s1
add r30.x, c250.y, c220.x //Depth-Offset from Menu

//MultiplyAdd(mad) Xnew(r3.x) = Xold(r3.x) + Separation(r1.x) * ((W)HUD-Depth c250.y))
mad r3.x, r1.x, r30.x, r3.x
mov o0, r3


But the "add r30.x, c250.y, c220.x" distorts the VS and zooms the upper left corner of the background.
As a first workaround I set "Const3 = 0x3dcccccd" and doing "add r30.x, c250.y, c250.z". That works fine.

So why can't I add the VSConst (c250.y) with a constant register(c220.x)?

Desktop-PC

i7 870 @ 4.0GHz + MSI GTX1070 Gaming X + 16GB RAM + Win10 64Bit Home + AW2310+3D-Vision

Posted 01/04/2015 08:32 PM   
Welcome Flint :) [quote="Flint Eastwood"]For me as a noob, It was hard to find out, what the different registers are (c, s, o, r).[/quote] c = Constant floating point input, may be defined locally or passed from the game or Helix Mod s = Sampler input, used to read textures and the stereo parameters o = Output register, declaration defines what type (and which number if multiple of the same type) r = General purpose temporary register The best place to find this type of information is the MSDN references: http://msdn.microsoft.com/en-us/library/windows/desktop/bb172963(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/windows/desktop/bb172920(v=vs.85).aspx [quote]I painfully recognised after a lot trying that the output registers can't be overwritten. So a "mov r3, o0" and later "mov o0, r3" is useless for manipulating the o0 .Maybe a typical beginner-mistake.[/quote]It's not that output registers can't be overwritten, it's that they can't be read. Generally if you want to do this type of thing you will replace them with an unused temporary register and add a mov at the end of the shader to copy the temporary register to the output register. That way you can do any reads & writes you need to the temporary register instead. [quote]Next thing was the allready used samplers in the game, so s0 was not useable. Had to set "DefVSSampler = 258". Confusing that 258 is s1 and not s258. The next beginner mistake.[/quote]Yes, that's an odd one - you need to add 257 to sampler register numbers for vertex shaders, but not pixel shaders. Not sure why this is, but I've hit this quirk as well and have documented it on the features page (see next point) under DefVSSampler. [quote]This led me to a question: [b][i][color="orange"]Is there a full list with all commands and defaults of the dx9settings.ini ?[/color][/i][/b][/quote]Why, yes there is: [i][b][url]http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List[/url][/b][/i] I've been expanding that page whenever I discover anything new in Helix Mod, and if you find any other weird gotchas or work out how to use any of the unknown features please feel free to expand it as well :-) [quote]But the "add r30.x, c250.y, c220.x" distorts the VS and zooms the upper left corner of the background. As a first workaround I set "Const3 = 0x3dcccccd" and doing "add r30.x, c250.y, c250.z". That works fine. [b][i][color="orange"]So why can't I add the VSConst (c250.y) with a constant register(c220.x)?[/color] [/i][/b][/quote]This is another asm language gotcha - constant registers only have 1 read port, meaning you can only use one of them per instruction (you can use the same one several times however). If you need to do an operation that requires two of them you will need to first copy one of them into a temporary register. I must say - I've personally hit each and every one of these gotchas as well as I've been learning. We have added a gotchas section to the features page as a way to try to document these (and please feel free to expand it), but I'm not sure if the asm languages gotchas belong there... bo3b, what do you think - we could move it to a separate page, or add asm language gotchas there as well?
Welcome Flint :)

Flint Eastwood said:For me as a noob, It was hard to find out, what the different registers are (c, s, o, r).

c = Constant floating point input, may be defined locally or passed from the game or Helix Mod
s = Sampler input, used to read textures and the stereo parameters
o = Output register, declaration defines what type (and which number if multiple of the same type)
r = General purpose temporary register

The best place to find this type of information is the MSDN references:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172963(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/bb172920(v=vs.85).aspx

I painfully recognised after a lot trying that the output registers can't be overwritten. So a "mov r3, o0" and later "mov o0, r3" is useless for manipulating the o0 .Maybe a typical beginner-mistake.
It's not that output registers can't be overwritten, it's that they can't be read. Generally if you want to do this type of thing you will replace them with an unused temporary register and add a mov at the end of the shader to copy the temporary register to the output register. That way you can do any reads & writes you need to the temporary register instead.

Next thing was the allready used samplers in the game, so s0 was not useable. Had to set "DefVSSampler = 258". Confusing that 258 is s1 and not s258. The next beginner mistake.
Yes, that's an odd one - you need to add 257 to sampler register numbers for vertex shaders, but not pixel shaders. Not sure why this is, but I've hit this quirk as well and have documented it on the features page (see next point) under DefVSSampler.

This led me to a question:
Is there a full list with all commands and defaults of the dx9settings.ini ?
Why, yes there is:

http://wiki.bo3b.net/index.php?title=HelixMod_Feature_List

I've been expanding that page whenever I discover anything new in Helix Mod, and if you find any other weird gotchas or work out how to use any of the unknown features please feel free to expand it as well :-)

But the "add r30.x, c250.y, c220.x" distorts the VS and zooms the upper left corner of the background.
As a first workaround I set "Const3 = 0x3dcccccd" and doing "add r30.x, c250.y, c250.z". That works fine.

So why can't I add the VSConst (c250.y) with a constant register(c220.x)?
This is another asm language gotcha - constant registers only have 1 read port, meaning you can only use one of them per instruction (you can use the same one several times however). If you need to do an operation that requires two of them you will need to first copy one of them into a temporary register.


I must say - I've personally hit each and every one of these gotchas as well as I've been learning. We have added a gotchas section to the features page as a way to try to document these (and please feel free to expand it), but I'm not sure if the asm languages gotchas belong there... bo3b, what do you think - we could move it to a separate page, or add asm language gotchas there as well?

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 01/05/2015 01:34 AM   
@Flint Eastwood: Great to see you taking a look. Yep, I also got nailed by those exact same gotchas. The double constant problem took me 5 hours to figure out. Super annoying that the assembler does not flag those as an error. It should know they are invalid. Having an ASM gotchas seems like a great idea. I added a subsection to the Gotchas section for these. I think having them there will be easier to find than on a separate page. Please feel free to add more.
@Flint Eastwood: Great to see you taking a look.

Yep, I also got nailed by those exact same gotchas. The double constant problem took me 5 hours to figure out. Super annoying that the assembler does not flag those as an error. It should know they are invalid.


Having an ASM gotchas seems like a great idea. I added a subsection to the Gotchas section for these. I think having them there will be easier to find than on a separate page. Please feel free to add more.

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 01/05/2015 02:47 AM   
  24 / 88    
Scroll To Top