Skip to content

Commit 957eaa1

Browse files
fix view aliasing
1 parent 377aa10 commit 957eaa1

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

examples_tests/22.RaytracedAO/dirty_source/ExtraCrap.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,13 @@ void Renderer::init(const SAssetBundle& meshes,
816816
auto resolveInfos = infos+descriptorExclScanSum[2];
817817
auto resolveWrites = writes+descriptorExclScanSum[2];
818818
createEmptyInteropBufferAndSetUpInfo(resolveInfos+0,m_intersectionBuffer,intersectionBufferSize);
819-
setImageInfo(resolveInfos+1,asset::EIL_GENERAL,core::smart_refctd_ptr(m_tonemapOutput));
819+
core::smart_refctd_ptr<IGPUImageView> tonemapOutputStorageView;
820+
{
821+
IGPUImageView::SCreationParams viewparams = m_tonemapOutput->getCreationParameters();
822+
viewparams.format = EF_R32_UINT;
823+
tonemapOutputStorageView = m_driver->createGPUImageView(std::move(viewparams));
824+
}
825+
setImageInfo(resolveInfos+1,asset::EIL_GENERAL,std::move(tonemapOutputStorageView));
820826

821827

822828
setDstSetAndDescTypesOnWrites(m_resolveDS.get(),resolveWrites,resolveInfos,{EDT_STORAGE_BUFFER,EDT_STORAGE_IMAGE});

examples_tests/22.RaytracedAO/raygen.comp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ void main()
353353
throughput /= float(staticViewData.samplesPerPixelPerDispatch);
354354

355355
rays[realOutputID].origin = irr_glsl_MC_WorldSpacePosition();/*+newray.direction*err?; TODO */
356-
rays[realOutputID].maxT = 0.0;
356+
rays[realOutputID].maxT = FLT_MAX;
357357
rays[realOutputID].direction = direction;
358358
rays[realOutputID].mask = -1;
359359
rays[realOutputID]._active = 1;

examples_tests/22.RaytracedAO/raytraceCommon.glsl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,16 @@ layout(set = 1, binding = 5, std430, row_major) restrict readonly buffer LightRa
107107
vec3 fetchAccumulation(in ivec2 coord)
108108
{
109109
const uvec2 data = imageLoad(accumulation,coord).rg;
110-
return irr_glsl_decodeRGB19E7(data);
110+
// for now until @Crisspl fixes rgb19e7 encode/decode
111+
//return irr_glsl_decodeRGB19E7(data);
112+
return vec3(unpackHalf2x16(data[0]),unpackHalf2x16(data[1])[0]);
111113
}
112114
void storeAccumulation(in vec3 color, in ivec2 coord)
113115
{
114-
imageStore(accumulation,coord,uvec4(irr_glsl_encodeRGB19E7(color),0u,0u));
116+
// for now until @Crisspl fixes rgb19e7 encode/decode
117+
//const uvec2 data = irr_glsl_encodeRGB19E7(color);
118+
const uvec2 data = uvec2(packHalf2x16(color.rg),packHalf2x16(vec2(color.b,1.0)));
119+
imageStore(accumulation,coord,uvec4(data,0u,0u));
115120
}
116121
#endif
117122

0 commit comments

Comments
 (0)