On 05/12/2017 01:16 AM, Matteo Bruni wrote:
2017-05-11 23:57 GMT+02:00 Paul Gofman gofmanp@gmail.com:
I would suggest doing the following:
- prepare a separate blob for the instructions testing not to mess up with
a copy of a big one which suits for different tests; 2. comment the fields directly related to the preshader being changed right in the effect blob; 3. leave the code modifying the blob online but add comments for setting fields.
Otherwise I can prepare the single blob with everything buildin, mark
preshader code in comments pointing where manual changes are, and leave test function just to set parameters. I could possibly do the same in the very beginning when was adding this test, somehow this was not discussed that time. But actually I was previously sure that having all that binary blobs in tests is an ugly but unavoidable measure, and generating what we need to test based on some patterns or readable data is preferred if possible, as makes those tests easier verifiable and easier producible.
This "otherwise" sounds like what I last proposed. Yeah, ideally we'd always generate the relevant preshaders instructions from source but as you noticed that isn't always doable. That means resorting to some kind of hack and, as far as hacks go, manually modifying the bytecode offline while adding comments looks like the least ugly option to me at the moment.
Should I make a single blob or separate for each instruction? Single blob will require an update on each instruction added, while separate (rather small) blobs for each will be the same apart from a few bytes related to the operation being tested. Separate blobs look slightly preferable to me, as don't require using and enumerating numerous unrelated states in test function, and it is easier to find something in the blob which has just one state and one preshader. If to go with separate blobs, could you please advise how to best send it taking into account existing test? As a single patch replacing the test with all the blobs at once, or a few ones leaving existing test and removing it in the last one?