Hello!
I'm seeing some strange behavior after compiling with clang-cl,
while with msvc, things work as expected.
Skia latest
clang-cl version 14.0.5
Snippet 1:
auto grGl = GrGLMakeNativeInterface();
auto grCtx = GrDirectContext::MakeGL(grGl);
SkASSERT(grCtx); // fail because grCtx is null
Snippet 2:
auto grCtx = GrDirectContext::MakeGL();
SkASSERT(grCtx); // no fail even though it should be the same as snippet 1
...
auto surface = SkSurface::MakeFromBackendRenderTarget(...); // never returns
...
auto surface2 = SkSurface::MakeRenderTarget(...);
Breaking the program shows that it is endlessly looping in SkOnce.h at
SK_POTENTIALLY_BLOCKING_REGION_BEGIN;
while (fState.load(std::memory_order_acquire) != Done) { /*spin*/ }
SK_POTENTIALLY_BLOCKING_REGION_END;
Now, if i remove SkASSERT(grCtx) and run, it does return a valid surface,
but crashes when creating surface2.
> myapp.exe!sk_sp<GrContextThreadSafeProxy>::operator->() Line 304
> myapp.exe!GrContext_Base::caps() Line 35
> myapp.exe!GrBaseContextPriv::caps() Line 28
>
myapp.exe!SkSurface::MakeRenderTarget(GrRecordingContext * rContext, skgpu::Budgeted budgeted, const SkImageInfo & info, int sampleCount, GrSurfaceOrigin origin, const SkSurfaceProps * props, bool shouldCreateWithMips) Line 528
Any ideas?