Skip to content

Commit

Permalink
testGI: fix envi_probe_specular texture used as SRV and RT at same time
Browse files Browse the repository at this point in the history
  • Loading branch information
NicSavichev committed Jan 9, 2024
1 parent 9e246d5 commit 36b55ac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion samples/testGI/prog/test_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ typedef BaseStreamingSceneHolder scene_type_t;
VAR(downsampled_far_depth_tex) \
VAR(prev_downsampled_far_depth_tex) \
VAR(from_sun_direction) \
VAR(downsample_depth_type)
VAR(downsample_depth_type) \
VAR(envi_probe_specular)

#define VAR(a) static int a##VarId = -1;
GLOBAL_VARS_LIST
Expand Down Expand Up @@ -1599,6 +1600,9 @@ class DemoGameScene : public DagorGameScene, public IRenderDynamicCubeFace2, pub
{
return initEnviProbe();
}
// skies render can use envi probe for ground-skies interaction on some of skies configs,
// causing RW conflict (SRV vs RT usages) workaround this by removing texture from shader var
ShaderGlobal::set_texture(envi_probe_specularVarId, BAD_TEXTUREID);
SCOPE_RENDER_TARGET;
SCOPE_VIEW_PROJ_MATRIX;
float zn = 0.1, zf = 1000;
Expand All @@ -1615,6 +1619,7 @@ class DemoGameScene : public DagorGameScene, public IRenderDynamicCubeFace2, pub
renderLightProbeEnvi();
}
enviProbe.getCubeTex()->generateMips();
ShaderGlobal::set_texture(envi_probe_specularVarId, enviProbe);
}

void reloadCube(bool first = false)
Expand Down

0 comments on commit 36b55ac

Please sign in to comment.