再現手順は確立していません。なんらかシェーダーを破棄するタイミングで発生するように見えます。
下記のcheckマクロの意図、発生の原因(流れ)…等、何らか情報があると、非常に助かります。
クラッシュレポートを見ると、以下の個所のアサートマクロ(check)でクラッシュしている。
- checkマクロなので、Development版でのみチェックが実行される。Shipping等で問題が起きた場合は、グラフィックがおかしくなる・リソースがリークする・クラッシュする…等の問題が起きる可能性がある
- シェーダーに関する描画リソースの破棄の際、UE4の想定する参照数ではないため、以下の個所のcheckマクロがクラッシュさせている。(参照数は常に2以上、参照数が2であれば破棄を実行)
- Development版では、変数情報が最適化されているため、細かい情報は手に入らなかった。
void ReleaseShader(int32 ShaderIndex) { const int32 LockIndex = ShaderIndex % NumShaderLocks; FRWScopeLock Locker(ShaderLocks[LockIndex], SLT_Write); FRHIShader* Shader = RHIShaders[ShaderIndex]; if(Shader) { // The library instance is holding one ref // External caller of this method must be holding a ref as well, so there must be at least 2 refs // If those are the only 2 refs, we release the ref held by the library instance, to allow the shader to be destroyed once caller releases its ref const uint32 NumRefs = Shader->GetRefCount(); check(NumRefs > 1u); if(NumRefs == 2u) { RHIShaders[ShaderIndex].SafeRelease(); } } }