Skip to content
Permalink
Browse files

fixed null pointer exceptions in render features

  • Loading branch information
tebjan authored and xen2 committed Sep 4, 2019
1 parent 1ca201f commit e3c698465e6d4c1fd1d6b80fcb5131a877c7b7a5
@@ -62,7 +62,7 @@ public override unsafe void Prepare(RenderDrawContext context)

foreach (var renderNode in ((RootEffectRenderFeature)RootRenderFeature).RenderNodes)
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
continue;

@@ -83,7 +83,7 @@ public override void ProcessPipelineState(RenderContext context, RenderNodeRefer
base.ProcessPipelineState(context, renderNodeReference, ref renderNode, renderObject, pipelineState);

// Check if this is a highlight rendering
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
return;

@@ -60,7 +60,7 @@ public unsafe override void Prepare(RenderDrawContext context)

foreach (var renderNode in ((RootEffectRenderFeature)RootRenderFeature).RenderNodes)
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
continue;

@@ -62,7 +62,7 @@ public override unsafe void Prepare(RenderDrawContext context)

foreach (var renderNode in ((RootEffectRenderFeature)RootRenderFeature).RenderNodes)
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
continue;

@@ -81,7 +81,7 @@ public override void ProcessPipelineState(RenderContext context, RenderNodeRefer
base.ProcessPipelineState(context, renderNodeReference, ref renderNode, renderObject, pipelineState);

// Check if this is a wireframe rendering
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
return;

@@ -185,7 +185,7 @@ public override void Prepare(RenderDrawContext context)
//Dispatcher.ForEach(((RootEffectRenderFeature)RootRenderFeature).RenderNodes, (ref RenderNode renderNode) => // TODO: PERFORMANCE: Use this instead?
foreach (RenderNode renderNode in ((RootEffectRenderFeature)RootRenderFeature).RenderNodes)
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
{
continue;
@@ -413,7 +413,7 @@ public override void Prepare(RenderDrawContext context)
if (renderNode.RenderEffect.State != RenderEffectState.Normal)
return;

var drawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var drawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (drawLayout == null)
return;

@@ -149,7 +149,7 @@ public override unsafe void Prepare(RenderDrawContext context)
// Update cbuffer for previous WVP matrix
Dispatcher.ForEach(((RootEffectRenderFeature)RootRenderFeature).RenderNodes, (ref RenderNode renderNode) =>
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
return;

@@ -114,7 +114,7 @@ public override unsafe void Prepare(RenderDrawContext context)

Dispatcher.ForEach(((RootEffectRenderFeature)RootRenderFeature).RenderNodes, (ref RenderNode renderNode) =>
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
return;

@@ -157,7 +157,7 @@ public override unsafe void Prepare(RenderDrawContext context)
// TODO: Have a PerObject cbuffer?
Dispatcher.ForEach(((RootEffectRenderFeature)RootRenderFeature).RenderNodes, (ref RenderNode renderNode) =>
{
var perDrawLayout = renderNode.RenderEffect.Reflection.PerDrawLayout;
var perDrawLayout = renderNode.RenderEffect.Reflection?.PerDrawLayout;
if (perDrawLayout == null)
return;

0 comments on commit e3c6984

Please sign in to comment.
You can’t perform that action at this time.