On 8/7/19 12:48 AM, Henri Verbeet wrote:
What is a concern though is d3d_execute_buffer_execute_pick() diverging from d3d_execute_buffer_execute() when changes are made to one or the other.
Ah I see, I felt inclined not to modify the d3d_execute_buffer_execute() function to try and keep my changes as clear as possible, however an alternative could be adding my triangle click test to d3d_execute_buffer_execute() with an extra parameter that determines whether it runs in "pick mode" (click test, no render) or not.
I'm not sure what other alternatives there could be without looping through the execute buffer (which is essentially the current solution). Perhaps if I could reliably determine where triangle vertices are written to during the execute (without having to read the execute buffer again) I could run the click test on those (keeping d3d_execute_buffer_execute() unmodified), but I'm not sure how practical that would be.
Having tests is important, both in order to be sure the implementation is correct as well as to prevent future changes from breaking it.
I can see about writing a test, assuming at this point that I'll be modifying the patch anyway to address the first issue.