Skip to content

Commit 56b3134

Browse files
fix more shader compilation issues
1 parent 0cf5f33 commit 56b3134

File tree

8 files changed

+14
-26
lines changed

8 files changed

+14
-26
lines changed

examples_tests/22.RaytracedAO/raygen.comp

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

355-
rays[realOutputID].origin = nbl_glsl_MC_WorldSpacePosition();/*+newray.direction*err?; TODO */
355+
rays[realOutputID].origin = nbl_glsl_MC_getWorldSpacePosition();/*+newray.direction*err?; TODO */
356356
rays[realOutputID].maxT = FLT_MAX;
357357
rays[realOutputID].direction = direction;
358358
rays[realOutputID].mask = -1;

examples_tests/22.RaytracedAO/raytraceCommon.glsl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,14 @@ 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-
// for now until @Crisspl fixes rgb19e7 encode/decode
141-
//return irr_glsl_decodeRGB19E7(data);
142-
return vec3(unpackHalf2x16(data[0]),unpackHalf2x16(data[1])[0]);}
140+
return nbl_glsl_decodeRGB19E7(data);
141+
}
142+
143143
void storeAccumulation(in vec3 color, in ivec2 coord)
144144
{
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));}
145+
const uvec2 data = nbl_glsl_encodeRGB19E7(color);
146+
imageStore(accumulation,coord,uvec4(data,0u,0u));
147+
}
149148
#endif
150149

151150

examples_tests/45.BRDFEvalTest/shader.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
#version 430 core
12
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
23
// This file is part of the "Nabla Engine".
34
// For conditions of distribution and use, see copyright notice in nabla.h
45

5-
#version 430 core
66

77
layout (location = 0) in vec3 Normal;
88
layout (location = 1) in vec3 Pos;
@@ -34,7 +34,7 @@ void main()
3434
vec3 N = normalize(Normal);
3535
if (dot(N,Lnorm)>0.0)
3636
{
37-
nbl_glsl_IsotropicViewSurfaceInteraction inter_ = nbl_glsl_calcFragmentShaderSurfaceInteraction(pc.campos, Pos, N);
37+
nbl_glsl_IsotropicViewSurfaceInteraction inter_ = nbl_glsl_calcSurfaceInteraction(pc.campos, Pos, N, mat2x3(dFdx(Pos),dFdy(Pos)));
3838
nbl_glsl_AnisotropicViewSurfaceInteraction inter = nbl_glsl_calcAnisotropicInteraction(inter_);
3939

4040
nbl_glsl_LightSample _sample = nbl_glsl_createLightSample(Lnorm,inter);

examples_tests/46.SamplingValidation/fullscreen.frag

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void main()
3434
const float ay = pc.a.y;
3535
const mat2x3 ior = mat2x3(vec3(1.02,1.3,1.02), vec3(1.0,2.0,1.0));
3636
vec3 u = vec3(gl_FragCoord.xy/screenSz,0.0); // random sapling would be useful
37-
nbl_glsl_IsotropicViewSurfaceInteraction inter_ = nbl_glsl_calcFragmentShaderSurfaceInteraction(vec3(1.0), vec3(0.0), vec3(0.0,0.0,1.0));
37+
nbl_glsl_IsotropicViewSurfaceInteraction inter_ = nbl_glsl_calcSurfaceInteraction(vec3(1.0), vec3(0.0), vec3(0.0,0.0,1.0), mat2x3(0.0));
3838
nbl_glsl_AnisotropicViewSurfaceInteraction inter = nbl_glsl_calcAnisotropicInteraction(inter_, vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0));
3939
nbl_glsl_LightSample s;
4040
float pdf = 0.0;

include/nbl/builtin/glsl/bxdf/common.glsl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,6 @@ nbl_glsl_IsotropicViewSurfaceInteraction nbl_glsl_calcSurfaceInteraction(in vec3
155155
return nbl_glsl_calcSurfaceInteractionFromViewVector(V, _SurfacePos, _Normal, dpd_);
156156
}
157157

158-
// only in the fragment shader we have access to implicit derivatives
159-
nbl_glsl_IsotropicViewSurfaceInteraction nbl_glsl_calcFragmentShaderSurfaceInteractionFromViewVector(in vec3 _View, in vec3 _SurfacePos, in vec3 _Normal)
160-
{
161-
mat2x3 dpd = mat2x3(dFdx(_SurfacePos), dFdy(_SurfacePos));
162-
return nbl_glsl_calcSurfaceInteractionFromViewVector(_View, _SurfacePos, _Normal, dpd);
163-
}
164-
nbl_glsl_IsotropicViewSurfaceInteraction nbl_glsl_calcFragmentShaderSurfaceInteraction(in vec3 _CamPos, in vec3 _SurfacePos, in vec3 _Normal)
165-
{
166-
vec3 V = _CamPos - _SurfacePos;
167-
return nbl_glsl_calcFragmentShaderSurfaceInteractionFromViewVector(V, _SurfacePos, _Normal);
168-
}
169158
nbl_glsl_AnisotropicViewSurfaceInteraction nbl_glsl_calcAnisotropicInteraction(in nbl_glsl_IsotropicViewSurfaceInteraction isotropic, in vec3 T, in vec3 B)
170159
{
171160
nbl_glsl_AnisotropicViewSurfaceInteraction inter;

include/nbl/builtin/glsl/ext/RadeonRays/ray.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
#ifndef __NBL_EXT_RADEON_RAYS_RAY_INCLUDED__
2-
#define __NBL_EXT_RADEON_RAYS_RAY_INCLUDED__
1+
#ifndef _NBL_GLSL_EXT_RADEON_RAYS_RAY_INCLUDED_
2+
#define _NBL_GLSL_EXT_RADEON_RAYS_RAY_INCLUDED_
33

44
struct nbl_glsl_ext_RadeonRays_ray
55
{

include/nbl/builtin/shaders/loaders/mtl/fragment_impl.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Spectrum nbl_bsdf_cos_eval(in nbl_glsl_LightSample _sample, in nbl_glsl_Isotropi
159159

160160
vec3 nbl_computeLighting(out nbl_glsl_IsotropicViewSurfaceInteraction out_interaction, in mat2 dUV)
161161
{
162-
nbl_glsl_IsotropicViewSurfaceInteraction interaction = nbl_glsl_calcFragmentShaderSurfaceInteraction(vec3(0.0), ViewPos, Normal);
162+
nbl_glsl_IsotropicViewSurfaceInteraction interaction = nbl_glsl_calcSurfaceInteraction(vec3(0.0), ViewPos, Normal, mat2x3(dFdx(ViewPos),dFdy(ViewPos)));
163163

164164
#ifndef _NO_UV
165165
if ((PC.params.extra&map_bump_MASK) == map_bump_MASK)

src/nbl/ext/MitsubaLoader/CMitsubaLoader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ vec3 nbl_computeLighting(inout nbl_glsl_IsotropicViewSurfaceInteraction out_inte
283283
284284
//nbl_glsl_BSDFIsotropicParams params;
285285
//params.L = campos-WorldPos;
286-
out_interaction = nbl_glsl_calcFragmentShaderSurfaceInteraction(campos, WorldPos, normalize(Normal));
286+
out_interaction = nbl_glsl_calcSurfaceInteraction(campos, WorldPos, normalize(Normal), mat2x3(dFdx(WorldPos),dFdy(WorldPos)));
287287
288288
return nbl_bsdf_cos_eval(precomp, precomp.V, out_interaction, dUV)/dot(params.L,params.L) + emissive;
289289
}

0 commit comments

Comments
 (0)