Skip to content

Commit d945f38

Browse files
author
devsh
committed
mother of all typos and premature optimizations
1 parent ef000ef commit d945f38

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

22.RaytracedAO/Renderer.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ void Renderer::initScreenSizedResources(
13781378
if (static_cast<COpenGLDriver*>(m_driver)->runningInRenderdoc()) // makes Renderdoc capture the modifications done by OpenCL
13791379
{
13801380
interopBuffer.buffer = m_driver->createUpStreamingGPUBufferOnDedMem(size);
1381-
//interopBuffer.buffer->getBoundMemory()->mapMemoryRange(IDriverMemoryAllocation::EMCAF_WRITE,{0u,size})
1381+
// interopBuffer.buffer->getBoundMemory()->mapMemoryRange(IDriverMemoryAllocation::EMCAF_READ_AND_WRITE,{0u,size});
13821382
}
13831383
else
13841384
interopBuffer.buffer = m_driver->createDeviceLocalGPUBufferOnDedMem(size);
@@ -2136,7 +2136,17 @@ bool Renderer::traceBounce(uint32_t& raycount)
21362136
std::cout << "[ERROR] RadeonRays Timed Out" << std::endl;
21372137
return false;
21382138
}
2139+
2140+
if (static_cast<COpenGLDriver*>(m_driver)->runningInRenderdoc())
2141+
{
2142+
auto touchAllBytes = [](IGPUBuffer* buf)->void
2143+
{
2144+
auto ptr = reinterpret_cast<uint8_t*>(buf->getBoundMemory()->getMappedPointer());
2145+
};
2146+
touchAllBytes(m_intersectionBuffer[descSetIx].buffer.get());
2147+
}
21392148
}
2149+
21402150

21412151
// compute bounce (accumulate contributions and optionally generate rays)
21422152
{

22.RaytracedAO/raygen.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ void main()
173173
{
174174
const vec3 prev = fetchAccumulation(coord);
175175
const vec3 delta = (contrib.color-prev)*pc.cummon.rcpFramesDispatched;
176-
if (any(greaterThan(delta,vec3(exp2(-19.f)))))
176+
if (any(greaterThan(abs(delta),vec3(exp2(-19.f)))))
177177
storeAccumulation(prev+delta,coord);
178178
}
179179
addAlbedo(contrib.albedo,coord,pc.cummon.rcpFramesDispatched);

22.RaytracedAO/raytraceCommon.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void storeAccumulation(in vec3 color, in uvec3 coord)
9191
}
9292
void addAccumulation(in vec3 delta, in uvec3 coord)
9393
{
94-
if (any(greaterThan(delta,vec3(exp2(-19.f)))))
94+
if (any(greaterThan(abs(delta),vec3(exp2(-19.f)))))
9595
{
9696
const vec3 prev = fetchAccumulation(coord);
9797
const vec3 newVal = prev+delta;
@@ -117,7 +117,7 @@ void nextSampleAccumulationCascade(in vec3 weightedDelta, uvec3 coord, in uint s
117117
}
118118
void addAccumulationCascade(in vec3 weightedDelta, uvec3 coord, in uint samplesPerPixelPerDispatch, in uint cascadeIndex)
119119
{
120-
if (any(greaterThan(weightedDelta,vec3(exp2(-19.f)))))
120+
if (any(greaterThan(abs(weightedDelta),vec3(exp2(-19.f)))))
121121
{
122122
// but leave first index in the array for the ray accumulation metadata, hence the +1
123123
coord.z += (cascadeIndex+1u)*samplesPerPixelPerDispatch;

0 commit comments

Comments
 (0)