Skip to content

Commit 17e9107

Browse files
committed
PushBuffer fixes
1 parent 4fc91f0 commit 17e9107

File tree

4 files changed

+15
-18
lines changed

4 files changed

+15
-18
lines changed

src/engine/renderer/GLMemory.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class GLBuffer {
5151
std::string name;
5252
const GLuint64 SYNC_TIMEOUT = 10000000000; // 10 seconds
5353

54-
GLuint id;
54+
GLuint id = 0;
5555

5656
GLBuffer( const char* newName, const GLuint newBindingPoint, const GLbitfield newFlags, const GLbitfield newMapFlags ) :
5757
name( newName ),
@@ -330,12 +330,6 @@ struct PushBuffer {
330330
uint32_t globalUBOSize;
331331
uint32_t* globalUBOData;
332332

333-
uint32_t pushStart = UINT32_MAX;
334-
uint32_t pushEnd = 0;
335-
336-
uint32_t sector = 0;
337-
const uint32_t MAX_SECTORS = 1024;
338-
339333
GLUBO globalUBO = GLUBO( "globalUniforms", BufferBind::GLOBAL_DATA, 0, 0 );
340334

341335
void InitGLBuffers();

src/engine/renderer/Material.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,8 +1669,9 @@ void MaterialSystem::DepthReduction() {
16691669
uint32_t globalWorkgroupX = ( width + 7 ) / 8;
16701670
uint32_t globalWorkgroupY = ( height + 7 ) / 8;
16711671

1672-
// FIXME: u_DepthMap object on the shader is not actually used
1673-
GL_Bind( tr.currentDepthImage );
1672+
gl_depthReductionShader->SetUniform_DepthMapBindless(
1673+
GL_BindToTMU( 0, tr.currentDepthImage )
1674+
);
16741675
glBindImageTexture( 2, depthImage->texnum, 0, GL_FALSE, 0, GL_WRITE_ONLY, GL_R32F );
16751676

16761677
gl_depthReductionShader->SetUniform_InitialDepthLevel( true );

src/engine/renderer/gl_shader_test.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3636

3737
namespace {
3838

39-
struct u_float_A : GLUniform1f { u_float_A(GLShader* s) : GLUniform1f(s, "u_float_A") {} };
40-
struct u_float_B : GLUniform1f { u_float_B(GLShader* s) : GLUniform1f(s, "u_float_B") {} };
41-
struct u_vec2_A : GLUniform2f { u_vec2_A(GLShader* s) : GLUniform2f(s, "u_vec2_A") {} };
42-
struct u_vec3_A : GLUniform3f { u_vec3_A(GLShader* s) : GLUniform3f(s, "u_vec3_A") {} };
43-
struct u_vec3_B : GLUniform3f { u_vec3_B(GLShader* s) : GLUniform3f(s, "u_vec3_B") {} };
44-
struct u_mat4_A: GLUniformMatrix4f { u_mat4_A(GLShader* s) : GLUniformMatrix4f(s, "u_mat4_A") {} };
45-
struct u_vec4Array6_A : GLUniform4fv { u_vec4Array6_A(GLShader* s) : GLUniform4fv( s, "u_Vec4Array6_A", 6 ) {} };
39+
struct u_float_A : GLUniform1f { u_float_A(GLShader* s) : GLUniform1f(s, "u_float_A", MATERIAL_OR_PUSH) {} };
40+
struct u_float_B : GLUniform1f { u_float_B(GLShader* s) : GLUniform1f(s, "u_float_B", MATERIAL_OR_PUSH) {} };
41+
struct u_vec2_A : GLUniform2f { u_vec2_A(GLShader* s) : GLUniform2f(s, "u_vec2_A", MATERIAL_OR_PUSH) {} };
42+
struct u_vec3_A : GLUniform3f { u_vec3_A(GLShader* s) : GLUniform3f(s, "u_vec3_A", MATERIAL_OR_PUSH) {} };
43+
struct u_vec3_B : GLUniform3f { u_vec3_B(GLShader* s) : GLUniform3f(s, "u_vec3_B", MATERIAL_OR_PUSH) {} };
44+
struct u_mat4_A: GLUniformMatrix4f { u_mat4_A(GLShader* s) : GLUniformMatrix4f(s, "u_mat4_A", MATERIAL_OR_PUSH) {} };
45+
struct u_vec4Array6_A : GLUniform4fv { u_vec4Array6_A(GLShader* s) : GLUniform4fv( s, "u_Vec4Array6_A", 6, MATERIAL_OR_PUSH ) {} };
4646

4747
class MaterialUniformPackingTestShaderBase : public GLShader
4848
{

src/engine/renderer/tr_bsp.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4659,9 +4659,11 @@ static void SetConstUniforms() {
46594659
globalUBOProxy->SetUniform_ColorMap3DBindless( GL_BindToTMU( 3, tr.colorGradeImage ) );
46604660
}
46614661

4662-
globalUBOProxy->SetUniform_DepthMapBindless( GL_BindToTMU( 1, tr.currentDepthImage ) );
4662+
globalUBOProxy->SetUniform_DepthMapBindless( GL_BindToTMU( 1, tr.depthSamplerImage ) );
46634663

4664-
globalUBOProxy->SetUniform_PortalMapBindless( GL_BindToTMU( 1, tr.portalRenderImage ) );
4664+
if ( r_liquidMapping->integer ) {
4665+
globalUBOProxy->SetUniform_PortalMapBindless( GL_BindToTMU( 1, tr.portalRenderImage ) );
4666+
}
46654667

46664668
if ( glConfig.realtimeLighting ) {
46674669
globalUBOProxy->SetUniform_DepthTile1Bindless(

0 commit comments

Comments
 (0)