public static unsafe bool SubmitTransientAlloc(RendererBGFXInstance *sys, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, bgfx.VertexLayout *layout) { if (!bgfx.alloc_transient_buffers(tvb, layout, (uint)nvertices, tib, (uint)nindices)) { #if DEBUG // TODO: throw or ignore draw? throw new InvalidOperationException("Out of transient bgfx memory!"); #else RenderDebug.LogFormat("Warning: Out of transient bgfx memory! Skipping draw call."); return(false); #endif } return(true); }
public static unsafe void EncodeLitTransient(RendererBGFXInstance *sys, bgfx.Encoder *encoder, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, ushort viewId, ref float4x4 tx, ref LitMaterialBGFX mat, ref LightingBGFX lighting, ref float4x4 viewTx, byte flipCulling, ref LightingViewSpaceBGFX viewSpaceLightCache, uint depth) { EncodeLitTransientBuffers(sys, encoder, tib, tvb, nvertices, nindices); EncodeLit(sys, encoder, ref sys->m_litShader, viewId, ref tx, ref mat, ref lighting, ref viewTx, flipCulling, ref viewSpaceLightCache, depth); }
public static unsafe void EncodeSimpleTransient(RendererBGFXInstance *sys, bgfx.Encoder *encoder, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, ushort viewId, ref float4x4 tx, ref SimpleMaterialBGFX mat, byte flipCulling, uint depth) { EncodeSimpleTransientBuffers(sys, encoder, tib, tvb, nvertices, nindices); EncodeSimple(sys, encoder, viewId, ref tx, ref mat, flipCulling, depth); }
public static unsafe void SubmitSimpleTransientDirect(RendererBGFXInstance *sys, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, ushort viewId, ref float4x4 tx, ref SimpleMaterialBGFX mat, byte flipCulling, uint depth) { bgfx.Encoder *encoder = bgfx.encoder_begin(false); EncodeSimpleTransient(sys, encoder, tib, tvb, nvertices, nindices, viewId, ref tx, ref mat, flipCulling, depth); bgfx.encoder_end(encoder); }
public static unsafe void EncodeTransientBuffers(RendererBGFXInstance *sys, bgfx.Encoder *encoder, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, bgfx.VertexLayoutHandle layoutHandle) { bgfx.encoder_set_transient_index_buffer(encoder, tib, 0, (uint)nindices); bgfx.encoder_set_transient_vertex_buffer(encoder, 0, tvb, 0, (uint)nvertices, layoutHandle); }
public static unsafe void EncodeLitTransientBuffers(RendererBGFXInstance *sys, bgfx.Encoder *encoder, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices) { EncodeTransientBuffers(sys, encoder, tib, tvb, nvertices, nindices, sys->m_litVertexBufferDeclHandle); }
public static unsafe bool SubmitLitTransientAlloc(RendererBGFXInstance *sys, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices) { return(SubmitTransientAlloc(sys, tib, tvb, nvertices, nindices, &sys->m_litVertexBufferDecl)); }
public static unsafe void EncodeLitZOnlyTransient(RendererBGFXInstance *sys, bgfx.Encoder *encoder, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, ushort viewId, ref float4x4 tx, byte flipCulling) { EncodeLitTransientBuffers(sys, encoder, tib, tvb, nvertices, nindices); EncodeZOnly(sys, encoder, viewId, ref tx, flipCulling); }
public static unsafe void EncodeShadowMapTransient(RendererBGFXInstance *sys, bgfx.Encoder *encoder, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, ushort viewId, ref float4x4 tx, byte flipCulling, float4 bias) { EncodeLitTransientBuffers(sys, encoder, tib, tvb, nvertices, nindices); EncodeShadowMap(sys, encoder, ref sys->m_shadowMapShader, viewId, ref tx, flipCulling, bias #if DEBUG , new float4(1) #endif ); }
public static unsafe void SubmitSimpleShadowMapTransientDirect(RendererBGFXInstance *sys, bgfx.TransientIndexBuffer *tib, bgfx.TransientVertexBuffer *tvb, int nvertices, int nindices, ushort viewId, ref float4x4 tx, byte flipCulling, float4 bias) { bgfx.Encoder *encoder = bgfx.encoder_begin(false); EncodeSimpleShadowMapTransient(sys, encoder, tib, tvb, nvertices, nindices, viewId, ref tx, flipCulling, bias); bgfx.encoder_end(encoder); }