2017-05-11 22:00 GMT+02:00 Paul Gofman gofmanp@gmail.com:
On 05/11/2017 10:17 PM, Matteo Bruni wrote:
As I said in my first reply, I'm okay with accepting the original patch. I'm not particularly happy with it and I hoped you would give at least a half-hearted try to the alternative but I'm not vetoing it.
I will look at "bytecode writer" to see how long it might be to generate something. But to generate a single preshader at full I will probably need to generate "PRSI" section which we are not even parsing now, also there are "unknown DWORDS" skipped but it is subject to testing if native d3dx will go well without them filled right
That's an opportunity for more tests, which is good :)
Of course there is still an option to craft preshaders from a ready effect blob fixing opcodes, pretty much the same way they are generated now inside the test but putting a ready blob into the test file. If you are sure that it is a better approach I can do that, adding an array of blobs instead of array of ops + parameters.
What do you mean exactly? I'd be okay with creating the effect blob by writing a "skeleton" effect, compiling it with fxc and then manually adding / replacing some preshader instructions in the bytecode with those you want to test, fixing up the affected offsets / sizes / counts to account for the changed stuff. With a suitable skeleton the changes should be pretty localized and you could document them in comments inside the blob array (and still document the original effect's source). In the end it would be pretty similar to the current test except that 1. you do the changes offline and not at runtime 2. the changes have comments right in the bytecode 3. you don't need to hack a huge effect with a lot of unrelated stuff.
It could also be multiple effects for different instruction tests but it seems simpler to put everything into one.