Page 1 of 1

[Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.7]

Posted: Sat Mar 05, 2022 5:39 am
by Losti
The last weeks I was working on a tool that automatically translate a asm dx11 shader code into a RegEx for 3D-Migoto doing the basic replacements and having the option for customization of the basic things, define section and rest groups as well as register and constant buffer grouping for later use in the replace string or your replace pattern for a fix.

RegEx Creation time is below 1 minute now! Of course special things needs to be added if needed, but the main work is done already after using the script.

NOTE: This tool is only useful for ShaderHackers, not for users of fixes!


There is a ReadMe.txt in the archive for you that explains how to use this tool and do the group marking in an input.

You can use a asm shader as base for input by placing it next to the script or put your asm code you want a RegEx for in the RegExInput.txt.

You have several options in dependency of the input code for customization. If some of this is not present in the input code it will be skipped from asking. So here are the general options you have for customization:

Image

Image

Image

Image

Image

Image

Image

In case of a shader as inoput, suitible options are displayed for the shader type:
Image

In case of RegExInput.txt as input, you have the full list:
Image


Here are some examples for the usage, more details in the ReadMe.txt

Example 1:
- You want only one Section for a asm shader code part like this:
Image

==> Just place it into the RegExInput.txt and start AutoBasicRegEx.cmd, answer the questions and end up with this Output in RegExOutput.txt:
Image


Example 2:
- You want more than one Section for a asm shader code part, than you need to mark the startling liny by adding a "ggg" above the first line that you want to have in a group, than add another "ggg" for the second ... and so on and END UP with an "xend" after the last line you want to group. NOTE: No spaces or tabs before the marks!
Image

==> Start AutoBasicRegEx.cmd, answer the questions and end up with this Output in RegExOutput.txt:
Image


Example 3:
- You want more than one Section for a asm shader code part, with a REST (ANYTHING) section, than you need to add rest before the line to mark the startup, it ends with the next "ggg" mark.
Image

==> Start AutoBasicRegEx.cmd, answer the questions and end up with this Output in RegExOutput.txt:
Image


Example 4:
- You want a group name for an input or constant buffer for later use, than add rr before registers, vv before inputs, oo before outputs and cc before CBs.
Image

==> Start AutoBasicRegEx.cmd, answer the questions and end up with this Output in RegExOutput.txt:
Image


Example 5:
- You want to use a asm shader file as input, than you NEED at last ONE ggg line, and an xend when it should end, if you want only one part of the shader as a group. The other things are the same as above, adding rest sections, groups for registersn cbs, and more than one section group. Here is an example of a RegEx Output code created in approx 60 seconds by the script:

Image


EVERYTHING can be proven with the given original input and RegEx101 output code from the RegExOutput.txt @ RegEx101.com

Image

Hope this will help you creating nongreedy RegEx and save your time while doing this and also escapes you from using too many wildcard expressions to shorten RegEx writing time. In any case of urgency, please contact me.

CHEERS, Losti.

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.02]

Posted: Mon Mar 07, 2022 1:03 pm
by Losti
An Update was released fixing the (?s) where available before ANY REST Section, this is now only before the first one, as it is intended of the usage. Download as attachment from the initial post.

THANK YOU "mo" for hints on this one here!!!

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.02]

Posted: Tue Mar 08, 2022 9:25 am
by Losti
Update: 2.2
- fixed an issue with integer digits in a l(X.X, X.X, X.X, X.X) manner having negative signs that leads to missing spaces after the ","
- added option for give your RegEx a name, instad of choosing generic random name by default

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.2]

Posted: Wed Apr 13, 2022 9:47 am
by Losti
Just added a little update to the main page download that extends the number of possible integer digits to 16 instead of 10 because I have found a shader that has 12 digits for integer numbers defined.

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.4]

Posted: Mon May 30, 2022 10:38 am
by Losti
Some issue with the _sat instructions was fixed. Update/download in the first post.

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.5]

Posted: Wed Jun 01, 2022 9:43 am
by Losti
Added a fix for some anchoring end lines that have faulty a space before the anchor. Script is was beeing updated in the first post attachement.

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.6]

Posted: Sat Jun 11, 2022 12:32 pm
by Losti
Added a fix for the SQRT instructions in a shader input that was wrong interpreted.

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.7]

Posted: Sun Jun 12, 2022 6:03 am
by Losti
An issue was fixed for false expressions of "lt" instructions, also fixed an issue not replacing the swizzles in an "abs" instruction.
Update attached to the inifial post.

Re: [Tool] Basic Autimatic 3D-Migoto DX11 Shader RegEx [V2.7]

Posted: Tue Mar 26, 2024 10:29 pm
by wyattdowell
Several anchoring end lines that had incorrect spaces before the anchor have been corrected. They were updating the script that was attached to the original post.
geometry dash lite