Skip to content

Commit ac986c1

Browse files
committed
depthTextureInitial -> u_DepthMap
Needed for `PushBuffer`.
1 parent 28210b6 commit ac986c1

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/engine/renderer/gl_shader.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3029,11 +3029,12 @@ GLShader_depthReduction::GLShader_depthReduction() :
30293029
false, "depthReduction" ),
30303030
u_ViewWidth( this ),
30313031
u_ViewHeight( this ),
3032+
u_DepthMap( this ),
30323033
u_InitialDepthLevel( this ) {
30333034
}
30343035

30353036
void GLShader_depthReduction::SetShaderProgramUniforms( ShaderProgramDescriptor* shaderProgram ) {
3036-
glUniform1i( glGetUniformLocation( shaderProgram->id, "depthTextureInitial" ), 0 );
3037+
glUniform1i( glGetUniformLocation( shaderProgram->id, "u_DepthMap" ), 0 );
30373038
}
30383039

30393040
GLShader_clearSurfaces::GLShader_clearSurfaces() :

src/engine/renderer/gl_shader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3761,6 +3761,7 @@ class GLShader_depthReduction :
37613761
public GLShader,
37623762
public u_ViewWidth,
37633763
public u_ViewHeight,
3764+
public u_DepthMap,
37643765
public u_InitialDepthLevel {
37653766
public:
37663767
GLShader_depthReduction();

src/engine/renderer/glsl_source/depthReduction_cp.glsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3939
// Keep this to 8x8 because we don't want extra shared mem etc. to be allocated, and to minimize wasted lanes
4040
layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in;
4141

42-
layout(binding = 0) uniform sampler2D depthTextureInitial;
42+
layout(binding = 0) uniform sampler2D u_DepthMap;
4343
layout(r32f, binding = 1) uniform readonly image2D depthImageIn;
4444
layout(r32f, binding = 2) uniform writeonly image2D depthImageOut;
4545

@@ -57,7 +57,7 @@ void main() {
5757

5858
// Depth buffer uses a packed D24S8 format, so we have to copy it over to an r32f image first
5959
if( u_InitialDepthLevel ) {
60-
vec4 depthOut = texelFetch( depthTextureInitial, position, 0 );
60+
vec4 depthOut = texelFetch( u_DepthMap, position, 0 );
6161
imageStore( depthImageOut, position, depthOut );
6262
} else {
6363
float depth[4];

0 commit comments

Comments
 (0)