Minor improvements
This commit is contained in:
BIN
Content/Shaders/GlobalSurfaceAtlas.flax
(Stored with Git LFS)
BIN
Content/Shaders/GlobalSurfaceAtlas.flax
(Stored with Git LFS)
Binary file not shown.
@@ -26,6 +26,9 @@ API_CLASS() class FLAXENGINE_API RenderBuffers : public ScriptingObject
|
|||||||
{
|
{
|
||||||
DECLARE_SCRIPTING_TYPE(RenderBuffers);
|
DECLARE_SCRIPTING_TYPE(RenderBuffers);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The custom rendering state.
|
||||||
|
/// </summary>
|
||||||
class CustomBuffer : public Object
|
class CustomBuffer : public Object
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -289,7 +289,8 @@ void SceneRenderTask::OnCollectDrawCalls(RenderContext& renderContext)
|
|||||||
{
|
{
|
||||||
if (_customActorsScene == nullptr)
|
if (_customActorsScene == nullptr)
|
||||||
_customActorsScene = New<SceneRendering>();
|
_customActorsScene = New<SceneRendering>();
|
||||||
_customActorsScene->Clear();
|
else
|
||||||
|
_customActorsScene->Clear();
|
||||||
for (Actor* a : CustomActors)
|
for (Actor* a : CustomActors)
|
||||||
AddActorToSceneRendering(_customActorsScene, a);
|
AddActorToSceneRendering(_customActorsScene, a);
|
||||||
_customActorsScene->Draw(renderContext);
|
_customActorsScene->Draw(renderContext);
|
||||||
@@ -414,7 +415,7 @@ void SceneRenderTask::OnEnd(GPUContext* context)
|
|||||||
// Swap matrices
|
// Swap matrices
|
||||||
View.PrevView = View.View;
|
View.PrevView = View.View;
|
||||||
View.PrevProjection = View.Projection;
|
View.PrevProjection = View.Projection;
|
||||||
Matrix::Multiply(View.PrevView, View.PrevProjection, View.PrevViewProjection);
|
View.PrevViewProjection = View.ViewProjection();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SceneRenderTask::Resize(int32 width, int32 height)
|
bool SceneRenderTask::Resize(int32 width, int32 height)
|
||||||
|
|||||||
@@ -25,10 +25,7 @@ void SceneRendering::Draw(RenderContext& renderContext)
|
|||||||
if (view.RenderLayersMask.Mask & e.LayerMask && (e.NoCulling || frustum.Intersects(e.Bounds)) && e.Actor->GetStaticFlags() & view.StaticFlagsMask)
|
if (view.RenderLayersMask.Mask & e.LayerMask && (e.NoCulling || frustum.Intersects(e.Bounds)) && e.Actor->GetStaticFlags() & view.StaticFlagsMask)
|
||||||
{
|
{
|
||||||
#if SCENE_RENDERING_USE_PROFILER
|
#if SCENE_RENDERING_USE_PROFILER
|
||||||
PROFILE_CPU();
|
PROFILE_CPU_ACTOR(e.Actor);
|
||||||
#if TRACY_ENABLE
|
|
||||||
___tracy_scoped_zone.Name(*e.Actor->GetName(), e.Actor->GetName().Length());
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
e.Actor->Draw(renderContext);
|
e.Actor->Draw(renderContext);
|
||||||
}
|
}
|
||||||
@@ -42,10 +39,7 @@ void SceneRendering::Draw(RenderContext& renderContext)
|
|||||||
if (view.RenderLayersMask.Mask & e.LayerMask && (e.NoCulling || frustum.Intersects(e.Bounds)))
|
if (view.RenderLayersMask.Mask & e.LayerMask && (e.NoCulling || frustum.Intersects(e.Bounds)))
|
||||||
{
|
{
|
||||||
#if SCENE_RENDERING_USE_PROFILER
|
#if SCENE_RENDERING_USE_PROFILER
|
||||||
PROFILE_CPU();
|
PROFILE_CPU_ACTOR(e.Actor);
|
||||||
#if TRACY_ENABLE
|
|
||||||
___tracy_scoped_zone.Name(*e.Actor->GetName(), e.Actor->GetName().Length());
|
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
e.Actor->Draw(renderContext);
|
e.Actor->Draw(renderContext);
|
||||||
}
|
}
|
||||||
@@ -88,6 +82,7 @@ void SceneRendering::Clear()
|
|||||||
int32 SceneRendering::AddActor(Actor* a)
|
int32 SceneRendering::AddActor(Actor* a)
|
||||||
{
|
{
|
||||||
int32 key = 0;
|
int32 key = 0;
|
||||||
|
// TODO: track removedCount and skip searching for free entry if there is none
|
||||||
for (; key < Actors.Count(); key++)
|
for (; key < Actors.Count(); key++)
|
||||||
{
|
{
|
||||||
if (Actors[key].Actor == nullptr)
|
if (Actors[key].Actor == nullptr)
|
||||||
|
|||||||
@@ -403,9 +403,11 @@ struct TIsPODType<ProfilerCPU::Event>
|
|||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
#define PROFILE_CPU_SRC_LOC(srcLoc) tracy::ScopedZone ___tracy_scoped_zone( (tracy::SourceLocationData*)&(srcLoc) ); ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
#define PROFILE_CPU_SRC_LOC(srcLoc) tracy::ScopedZone ___tracy_scoped_zone( (tracy::SourceLocationData*)&(srcLoc) ); ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
||||||
#define PROFILE_CPU_ASSET(asset) ZoneScoped; const StringView __tracy_asset_name((asset)->GetPath()); ZoneName(*__tracy_asset_name, __tracy_asset_name.Length())
|
#define PROFILE_CPU_ASSET(asset) ZoneScoped; const StringView __tracy_asset_name((asset)->GetPath()); ZoneName(*__tracy_asset_name, __tracy_asset_name.Length())
|
||||||
|
#define PROFILE_CPU_ACTOR(actor) ZoneScoped; const StringView __tracy_actor_name((actor)->GetName()); ZoneName(*__tracy_actor_name, __tracy_actor_name.Length())
|
||||||
#else
|
#else
|
||||||
#define PROFILE_CPU_SRC_LOC(srcLoc) ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
#define PROFILE_CPU_SRC_LOC(srcLoc) ScopeProfileBlockCPU ProfileBlockCPU((srcLoc).name)
|
||||||
#define PROFILE_CPU_ASSET(asset)
|
#define PROFILE_CPU_ASSET(asset)
|
||||||
|
#define PROFILE_CPU_ACTOR(actor)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -415,5 +417,6 @@ struct TIsPODType<ProfilerCPU::Event>
|
|||||||
#define PROFILE_CPU_NAMED(name)
|
#define PROFILE_CPU_NAMED(name)
|
||||||
#define PROFILE_CPU_SRC_LOC(srcLoc)
|
#define PROFILE_CPU_SRC_LOC(srcLoc)
|
||||||
#define PROFILE_CPU_ASSET(asset)
|
#define PROFILE_CPU_ASSET(asset)
|
||||||
|
#define PROFILE_CPU_ACTOR(actor)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user