Skip to content

Commit 1e4e67d

Browse files
raytracing glsl compiles
1 parent c36a4da commit 1e4e67d

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

examples_tests/22.RaytracedAO/dirty_source/ExtraCrap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ void Renderer::init(const SAssetBundle& meshes,
657657
core::smart_refctd_ptr(m_raygenDSLayout),
658658
nullptr
659659
);
660-
(std::ofstream("material_declarations.glsl") << initData.globalMeta->materialCompilerGLSL_declarations).close();
660+
(std::ofstream("material_declarations.glsl") << "#define _NBL_EXT_MITSUBA_LOADER_VT_STORAGE_VIEW_COUNT " << initData.globalMeta->getVTStorageViewCount() << "\n" << initData.globalMeta->materialCompilerGLSL_declarations).close();
661661
m_raygenPipeline = m_driver->createGPUComputePipeline(nullptr, core::smart_refctd_ptr(m_raygenPipelineLayout),gpuSpecializedShaderFromFile(m_assetManager,m_driver,"../raygen.comp"));
662662

663663
m_raygenDS = m_driver->createGPUDescriptorSet(core::smart_refctd_ptr(m_raygenDSLayout));

examples_tests/22.RaytracedAO/raygen.comp

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ layout(set = 2, binding = 5) uniform sampler2D uvCoords;
1717

1818

1919
#include "bin/material_declarations.glsl"
20+
21+
/*
22+
// something to get our GLSL intellisense to "shut up"
23+
#ifndef _NBL_EXT_MITSUBA_LOADER_VT_STORAGE_VIEW_COUNT
24+
#define _NBL_EXT_MITSUBA_LOADER_VT_STORAGE_VIEW_COUNT 4
25+
#include <nbl/builtin/glsl/virtual_texturing/impl_functions.glsl>
26+
#endif
27+
*/
28+
#include <nbl/builtin/glsl/ext/MitsubaLoader/material_compiler_compatibility_impl.glsl>
29+
2030
vec3 normalizedV;
2131
vec3 nbl_glsl_MC_getNormalizedWorldSpaceV()
2232
{
@@ -37,19 +47,6 @@ mat2x3 nbl_glsl_MC_getdPos(in vec3 p)
3747
{
3848
return dPosdScreen;
3949
}
40-
41-
nbl_glsl_instr_t nbl_glsl_MC_fetchInstr(in uint ix)
42-
{
43-
return instr_buf.data[ix];
44-
}
45-
nbl_glsl_prefetch_instr_t nbl_glsl_MC_fetchPrefetchInstr(in uint ix)
46-
{
47-
return prefetch_instr_buf.data[ix];
48-
}
49-
nbl_glsl_bsdf_data_t nbl_glsl_MC_fetchBSDFData(in uint ix)
50-
{
51-
return bsdf_buf.data[ix];
52-
}
5350
#define _NBL_USER_PROVIDED_MATERIAL_COMPILER_GLSL_BACKEND_FUNCTIONS_
5451
#include <nbl/builtin/glsl/material_compiler/common.glsl>
5552

@@ -256,7 +253,7 @@ void main()
256253
}
257254

258255
//
259-
nbl_glsl_MC_precomputed_t precomputed = nbl_glsl_precomputeData(frontfacing);
256+
nbl_glsl_MC_precomputed_t precomputed = nbl_glsl_MC_precomputeData(frontfacing);
260257

261258
//
262259
const vec3 emissive = vec3(0.0,1.0,0.0);

examples_tests/22.RaytracedAO/raytraceCommon.glsl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,9 @@ void storeAccumulation(in vec3 color, in ivec2 coord)
153153
const uvec2 data = nbl_glsl_encodeRGB19E7(color);
154154
imageStore(accumulation,coord,uvec4(data,0u,0u));
155155
}
156-
#endif
157156

157+
//#include <nbl/builtin/glsl/ext/MitsubaLoader/material_compiler_compatibility.glsl/>
158+
159+
#endif
158160

159161
#endif

0 commit comments

Comments
 (0)