Share Shading Context when optimizing/jitting a shader…
… vs. grabbing an additi onal context.
Description
No need for a 2nd set of heaps/buffers when the existing context can be reused. Reduces memory footprint which increases cache efficiency, especially for threaded usage.
We can just swap the TexturePerThread info out for a null pointer and restore the previous one afterwards For completeness we also process the errors in the context.
Tests
Existing tests exercise the changes.
Checklist:
- [x] I have read the contribution guidelines.
- [x] I have updated the documentation, if applicable.
- [x] I have ensured that the change is tested somewhere in the testsuite (adding new test cases if necessary).
- [x] My code follows the prevailing code style of this project. If I haven't already run clang-format v17 before submitting, I definitely will look at the CI test that runs clang-format and fix anything that it highlights as being nonconforming.
Hold up on this, going to update so that such that the work to "borrow" a shading context for opt/jit is internal to ShadingContext and not burden on its user to understand the implementation details.
#1953 fixes the broken CI, which is not the fault of this PR. I merged it, so if you rebase on the current main, you should get a passing CI.
Ok Larry, this is ready for review