Skip to content

Commit 0e110a6

Browse files
committed
added ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT define
1 parent 2384385 commit 0e110a6

File tree

7 files changed

+10
-9
lines changed

7 files changed

+10
-9
lines changed

source/EveryRay_Core/Common.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ using namespace DirectX;
8585
#define ER_GPU_BUFFER_ALIGNMENT 256
8686
#endif
8787

88+
#define ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT ER_PLATFORM_WIN64_DX11
89+
8890
#define NUM_SHADOW_CASCADES 3
8991
#define MAX_LOD 3
9092
#define MAX_MESH_COUNT 32 // should match with IndirectCulling.hlsli

source/EveryRay_Core/ER_FoliageManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ namespace EveryRay_Core
323323
mOutputPositionsOnTerrainBuffer->CreateGPUBufferResource(rhi, mCurrentPositions, mPatchesCount, sizeof(XMFLOAT4), false, ER_BIND_NONE, 0x10000L | 0x20000L /*legacy from DX11*/, ER_RESOURCE_MISC_BUFFER_STRUCTURED); //should be STAGING
324324

325325
terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, mCurrentPositions, mPatchesCount, (TerrainSplatChannels)mTerrainSplatChannel, nullptr, 0, mPlacementHeightDelta);
326-
#ifndef ER_PLATFORM_WIN64_DX11
326+
#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT
327327
std::string eventName = "On-terrain placement callback - initialization of foliage: " + mName;
328328
terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, [&](ER_Terrain* aTerrain)
329329
{
@@ -582,7 +582,7 @@ namespace EveryRay_Core
582582
mOutputPositionsOnTerrainBuffer->CreateGPUBufferResource(rhi, mCurrentPositions, mPatchesCount, sizeof(XMFLOAT4), false, ER_BIND_NONE, 0x10000L | 0x20000L /*legacy from DX11*/, ER_RESOURCE_MISC_BUFFER_STRUCTURED); //should be STAGING
583583

584584
terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, mCurrentPositions, mPatchesCount, currentChannel, nullptr, 0, mPlacementHeightDelta);
585-
#ifndef ER_PLATFORM_WIN64_DX11
585+
#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT
586586
std::string eventName = "On-terrain placement callback - update of foliage: " + mName;
587587
terrain->ReadbackPlacedPositionsOnUpdateEvent->AddListener(eventName, [&](ER_Terrain* aTerrain)
588588
{

source/EveryRay_Core/ER_LightProbesManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ namespace EveryRay_Core
900900

901901
ER_RHI_GPUBuffer* finalGPUBuffer = (aType == DIFFUSE_PROBE) ? mDiffuseProbesPositionsGPUBuffer : mSpecularProbesPositionsGPUBuffer;
902902

903-
#ifndef ER_PLATFORM_WIN64_DX11
903+
#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT
904904
const std::string probeTypeName = (aType == DIFFUSE_PROBE) ? "diffuse" : "specular";
905905
const std::string eventName = "On-terrain placement callback - placement of probes: " + probeTypeName;
906906
terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName,

source/EveryRay_Core/ER_LightProbesManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace EveryRay_Core
7373
ER_RHI_GPUBuffer* GetSpecularProbesPositionsBuffer() const { return mSpecularProbesPositionsGPUBuffer; }
7474
float GetDistanceBetweenSpecularProbes() { return mDistanceBetweenSpecularProbes; }
7575

76-
ER_RHI_GPUTexture* GetIntegrationMap() { return mIntegrationMapTextureSRV; }
76+
ER_RHI_GPUTexture* GetIntegrationMap() const { return mIntegrationMapTextureSRV; }
7777

7878
XMFLOAT4 GetProbesCellsCount(ER_ProbeType aType);
7979
const XMFLOAT3& GetSceneProbesVolumeMin() { return mSceneProbesMinBounds; }

source/EveryRay_Core/ER_RenderingObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,7 @@ namespace EveryRay_Core
802802
terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, &currentPos, 1, (TerrainSplatChannels)mTerrainProceduralPlacementSplatChannel,
803803
nullptr, 0, abs(mTerrainProceduralPlacementHeightDelta) < std::numeric_limits<float>::epsilon() ? FLT_MAX : mTerrainProceduralPlacementHeightDelta);
804804

805-
#ifndef ER_PLATFORM_WIN64_DX11
805+
#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT
806806
std::string eventName = "On-terrain placement callback - initialization of ER_RenderingObject: " + mName;
807807
terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, [&](ER_Terrain* aTerrain)
808808
{
@@ -848,7 +848,7 @@ namespace EveryRay_Core
848848
terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, mTempInstancesPositions, mInstanceCount, (TerrainSplatChannels)mTerrainProceduralPlacementSplatChannel,
849849
nullptr, 0, abs(mTerrainProceduralPlacementHeightDelta) < std::numeric_limits<float>::epsilon() ? FLT_MAX : mTerrainProceduralPlacementHeightDelta);
850850

851-
#ifndef ER_PLATFORM_WIN64_DX11
851+
#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT
852852
std::string eventName = "On-terrain placement callback - initialization of ER_RenderingObject: " + mName;
853853
terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, [&](ER_Terrain* aTerrain)
854854
{

source/EveryRay_Core/ER_Terrain.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1119,11 +1119,10 @@ namespace EveryRay_Core
11191119

11201120
rhi->EndEventTag();
11211121

1122-
#ifdef ER_PLATFORM_WIN64_DX11
1122+
#if ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT
11231123
if (needsCPUReadback)
11241124
ReadbackPlacedPositions(outputBuffer, inputBuffer, positions, positionsCount); //direct readback in the dx11 immediate context
11251125
#endif
1126-
11271126
}
11281127

11291128
// Read-back (GPU to CPU) new positions from placement compute pass

source/EveryRay_Core/ER_Utility.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static float clearColorBlack[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
1111
static float clearColorWhite[4] = { 1.0f, 1.0f, 1.0f, 1.0f };
1212
static float clearColorRed[4] = { 1.0f, 0.0f, 0.0f, 1.0f };
1313

14-
static std::string engineVersionString = "v1.1";
14+
static std::string engineVersionString = "v1.1.1";
1515

1616
namespace EveryRay_Core
1717
{

0 commit comments

Comments
 (0)