Skip to content

Commit 0aff49b

Browse files
Merge remote-tracking branch 'origin/shader_pipeline_irrlichtbaw'
# Conflicts: # examples_tests/22.RaytracedAO/raygen.comp # examples_tests/22.RaytracedAO/raytraceCommon.glsl
2 parents 838e368 + 957eaa1 commit 0aff49b

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#version 430 core
22
#include "raytraceCommon.glsl"
33

4+
// for per pixel inputs
45
#include <nbl/builtin/glsl/utils/normal_decode.glsl>
56
#include <nbl/builtin/glsl/random/xoroshiro.glsl>
67

@@ -352,7 +353,7 @@ void main()
352353
throughput /= float(staticViewData.samplesPerPixelPerDispatch);
353354

354355
rays[realOutputID].origin = nbl_glsl_MC_WorldSpacePosition();/*+newray.direction*err?; TODO */
355-
rays[realOutputID].maxT = 0.0;
356+
rays[realOutputID].maxT = FLT_MAX;
356357
rays[realOutputID].direction = direction;
357358
rays[realOutputID].mask = -1;
358359
rays[realOutputID]._active = 1;

examples_tests/22.RaytracedAO/raytraceCommon.glsl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,15 @@ layout(set = 1, binding = 5, std430, row_major) restrict readonly buffer LightRa
137137
vec3 fetchAccumulation(in ivec2 coord)
138138
{
139139
const uvec2 data = imageLoad(accumulation,coord).rg;
140-
return nbl_glsl_decodeRGB19E7(data);
141-
}
140+
// for now until @Crisspl fixes rgb19e7 encode/decode
141+
//return irr_glsl_decodeRGB19E7(data);
142+
return vec3(unpackHalf2x16(data[0]),unpackHalf2x16(data[1])[0]);}
142143
void storeAccumulation(in vec3 color, in ivec2 coord)
143144
{
144-
imageStore(accumulation,coord,uvec4(nbl_glsl_encodeRGB19E7(color),0u,0u));
145-
}
145+
// for now until @Crisspl fixes rgb19e7 encode/decode
146+
//const uvec2 data = irr_glsl_encodeRGB19E7(color);
147+
const uvec2 data = uvec2(packHalf2x16(color.rg),packHalf2x16(vec2(color.b,1.0)));
148+
imageStore(accumulation,coord,uvec4(data,0u,0u));}
146149
#endif
147150

148151

0 commit comments

Comments
 (0)