On Fri, 9 Apr 2021 07:21:57 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:
>> This is the only place where we use MTLContext.invalidateCurrentContext() - >> which when processed in MTLRenderQueue - clears some native stuff and nulls >> out both mtlc and dstOps pointers maintained in MTLRenderQueue.m. I think, >> this will be important once we get rid of SET_SCRATCH_SURFACE under >> JDK-8263309. > > But why you need to invalidate context here? Why do you need "clears some > native stuff and nulls out both mtlc and dstOps pointers maintained in > MTLRenderQueue.m"? > > In OGL the getCGLConfigInfo() change the state of the OGL state due to > "makeCurrentContext", this is why we need to update the lava level state to > "invalid", otherwise we will get a mismatch between the state in the native > and java state. I see that MTLContext.invalidateCurrentContext() is not needed here. Also, as this is the only place it is used, we can remove the method altogether. ------------- PR: https://git.openjdk.java.net/jdk/pull/3357