diff --git a/source/EveryRay_Core/Common.h b/source/EveryRay_Core/Common.h index 220e5830..a8547020 100644 --- a/source/EveryRay_Core/Common.h +++ b/source/EveryRay_Core/Common.h @@ -85,6 +85,8 @@ using namespace DirectX; #define ER_GPU_BUFFER_ALIGNMENT 256 #endif +#define ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT ER_PLATFORM_WIN64_DX11 + #define NUM_SHADOW_CASCADES 3 #define MAX_LOD 3 #define MAX_MESH_COUNT 32 // should match with IndirectCulling.hlsli diff --git a/source/EveryRay_Core/ER_FoliageManager.cpp b/source/EveryRay_Core/ER_FoliageManager.cpp index 4ffccdef..ea200a74 100644 --- a/source/EveryRay_Core/ER_FoliageManager.cpp +++ b/source/EveryRay_Core/ER_FoliageManager.cpp @@ -323,7 +323,7 @@ namespace EveryRay_Core mOutputPositionsOnTerrainBuffer->CreateGPUBufferResource(rhi, mCurrentPositions, mPatchesCount, sizeof(XMFLOAT4), false, ER_BIND_NONE, 0x10000L | 0x20000L /*legacy from DX11*/, ER_RESOURCE_MISC_BUFFER_STRUCTURED); //should be STAGING terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, mCurrentPositions, mPatchesCount, (TerrainSplatChannels)mTerrainSplatChannel, nullptr, 0, mPlacementHeightDelta); -#ifndef ER_PLATFORM_WIN64_DX11 +#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT std::string eventName = "On-terrain placement callback - initialization of foliage: " + mName; terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, [&](ER_Terrain* aTerrain) { @@ -582,7 +582,7 @@ namespace EveryRay_Core mOutputPositionsOnTerrainBuffer->CreateGPUBufferResource(rhi, mCurrentPositions, mPatchesCount, sizeof(XMFLOAT4), false, ER_BIND_NONE, 0x10000L | 0x20000L /*legacy from DX11*/, ER_RESOURCE_MISC_BUFFER_STRUCTURED); //should be STAGING terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, mCurrentPositions, mPatchesCount, currentChannel, nullptr, 0, mPlacementHeightDelta); -#ifndef ER_PLATFORM_WIN64_DX11 +#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT std::string eventName = "On-terrain placement callback - update of foliage: " + mName; terrain->ReadbackPlacedPositionsOnUpdateEvent->AddListener(eventName, [&](ER_Terrain* aTerrain) { diff --git a/source/EveryRay_Core/ER_LightProbesManager.cpp b/source/EveryRay_Core/ER_LightProbesManager.cpp index 3407d7c3..b9b38a71 100644 --- a/source/EveryRay_Core/ER_LightProbesManager.cpp +++ b/source/EveryRay_Core/ER_LightProbesManager.cpp @@ -900,7 +900,7 @@ namespace EveryRay_Core ER_RHI_GPUBuffer* finalGPUBuffer = (aType == DIFFUSE_PROBE) ? mDiffuseProbesPositionsGPUBuffer : mSpecularProbesPositionsGPUBuffer; -#ifndef ER_PLATFORM_WIN64_DX11 +#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT const std::string probeTypeName = (aType == DIFFUSE_PROBE) ? "diffuse" : "specular"; const std::string eventName = "On-terrain placement callback - placement of probes: " + probeTypeName; terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, diff --git a/source/EveryRay_Core/ER_LightProbesManager.h b/source/EveryRay_Core/ER_LightProbesManager.h index 0749a827..06295845 100644 --- a/source/EveryRay_Core/ER_LightProbesManager.h +++ b/source/EveryRay_Core/ER_LightProbesManager.h @@ -73,7 +73,7 @@ namespace EveryRay_Core ER_RHI_GPUBuffer* GetSpecularProbesPositionsBuffer() const { return mSpecularProbesPositionsGPUBuffer; } float GetDistanceBetweenSpecularProbes() { return mDistanceBetweenSpecularProbes; } - ER_RHI_GPUTexture* GetIntegrationMap() { return mIntegrationMapTextureSRV; } + ER_RHI_GPUTexture* GetIntegrationMap() const { return mIntegrationMapTextureSRV; } XMFLOAT4 GetProbesCellsCount(ER_ProbeType aType); const XMFLOAT3& GetSceneProbesVolumeMin() { return mSceneProbesMinBounds; } diff --git a/source/EveryRay_Core/ER_RenderingObject.cpp b/source/EveryRay_Core/ER_RenderingObject.cpp index 648d401e..bae40629 100644 --- a/source/EveryRay_Core/ER_RenderingObject.cpp +++ b/source/EveryRay_Core/ER_RenderingObject.cpp @@ -802,7 +802,7 @@ namespace EveryRay_Core terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, ¤tPos, 1, (TerrainSplatChannels)mTerrainProceduralPlacementSplatChannel, nullptr, 0, abs(mTerrainProceduralPlacementHeightDelta) < std::numeric_limits::epsilon() ? FLT_MAX : mTerrainProceduralPlacementHeightDelta); -#ifndef ER_PLATFORM_WIN64_DX11 +#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT std::string eventName = "On-terrain placement callback - initialization of ER_RenderingObject: " + mName; terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, [&](ER_Terrain* aTerrain) { @@ -848,7 +848,7 @@ namespace EveryRay_Core terrain->PlaceOnTerrain(mOutputPositionsOnTerrainBuffer, mInputPositionsOnTerrainBuffer, mTempInstancesPositions, mInstanceCount, (TerrainSplatChannels)mTerrainProceduralPlacementSplatChannel, nullptr, 0, abs(mTerrainProceduralPlacementHeightDelta) < std::numeric_limits::epsilon() ? FLT_MAX : mTerrainProceduralPlacementHeightDelta); -#ifndef ER_PLATFORM_WIN64_DX11 +#if !ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT std::string eventName = "On-terrain placement callback - initialization of ER_RenderingObject: " + mName; terrain->ReadbackPlacedPositionsOnInitEvent->AddListener(eventName, [&](ER_Terrain* aTerrain) { diff --git a/source/EveryRay_Core/ER_Terrain.cpp b/source/EveryRay_Core/ER_Terrain.cpp index 5579c2c9..eb9c91ba 100644 --- a/source/EveryRay_Core/ER_Terrain.cpp +++ b/source/EveryRay_Core/ER_Terrain.cpp @@ -1119,11 +1119,10 @@ namespace EveryRay_Core rhi->EndEventTag(); -#ifdef ER_PLATFORM_WIN64_DX11 +#if ER_PLATFORM_SUPPORTS_IMMEDIATE_CONTEXT if (needsCPUReadback) ReadbackPlacedPositions(outputBuffer, inputBuffer, positions, positionsCount); //direct readback in the dx11 immediate context #endif - } // Read-back (GPU to CPU) new positions from placement compute pass diff --git a/source/EveryRay_Core/ER_Utility.h b/source/EveryRay_Core/ER_Utility.h index c253feb5..d62a134b 100644 --- a/source/EveryRay_Core/ER_Utility.h +++ b/source/EveryRay_Core/ER_Utility.h @@ -11,7 +11,7 @@ static float clearColorBlack[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; static float clearColorWhite[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; static float clearColorRed[4] = { 1.0f, 0.0f, 0.0f, 1.0f }; -static std::string engineVersionString = "v1.1"; +static std::string engineVersionString = "v1.1.1"; namespace EveryRay_Core {