I haven't looked at the v3 patches yet, but in the meantime:
2017-03-29 2:09 GMT+02:00 Paul Gofman gofmanp@gmail.com:
Oh, its a bug actually now, we should not mind absolute offset here if
relative addressing is on, we know if it is out of bound or not when we add index register value only, which can be negative. Yes, it looks the only tables where we need to do this update table size are temporary register table (for which we don't have any size known in advance) and output tables. I would check that and if I am not missing something now would leave just update table size where required.
Yeah and temporaries are supposed to be written before being read so in theory you can entirely skip the update_table_size() calls for source arguments.
Otherwise, if to leave the way it is done now, if relative addressing is
used update_table_size should be called on index register table/offset instead of main register. Regarding absolute offset check, if the absolute offset (without relative addressing) is out of bound fxc does not allow to compile that. If to test what happens to native implementation in this case I need to update the blob manually. So do you suggest to check if the absolute offset to input table is in bound and print a FIXME/fail preshader creation in this case?
Failing with a WARN is probably the best option. I don't think we necessarily need a Wine test for that, once you tested what happens with native. If you want you can add a test with a small effect manually hacked to contain an invalid argument.
Immediate const count is not necessarily the multiple of 4 (it is not the case in the present tests). If we set PRES_REGTAB_IMMED count to 4 it breaks new out of bounds index tests (due to incorrect size to wrap to).
Hmm, I've never seen any effect with a number of immediates not multiple of 4. Can you point me to one?