Skip to content

Commit 01d1ee4

Browse files
committed
Fix lightMapData naming
Also make it in line with other usages of `lightMap`.
1 parent b1d7d2e commit 01d1ee4

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/engine/renderer/Material.cpp

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

4040
GLUBO materialsUBO( "materials", 6, GL_MAP_WRITE_BIT, GL_MAP_INVALIDATE_RANGE_BIT );
4141
GLBuffer texDataBuffer( "texData", 7, GL_MAP_WRITE_BIT, GL_MAP_FLUSH_EXPLICIT_BIT );
42-
GLUBO lightmapDataUBO( "texData", 8, GL_MAP_WRITE_BIT, GL_MAP_FLUSH_EXPLICIT_BIT );
42+
GLUBO lightMapDataUBO( "lightMapData", 8, GL_MAP_WRITE_BIT, GL_MAP_FLUSH_EXPLICIT_BIT );
4343

4444
GLSSBO surfaceDescriptorsSSBO( "surfaceDescriptors", 1, GL_MAP_WRITE_BIT, GL_MAP_INVALIDATE_RANGE_BIT );
4545
GLSSBO surfaceCommandsSSBO( "surfaceCommands", 2, GL_MAP_WRITE_BIT, GL_MAP_FLUSH_EXPLICIT_BIT );
@@ -595,10 +595,10 @@ void MaterialSystem::GenerateWorldCommandBuffer() {
595595
texDataBuffer.UnmapBuffer();
596596
texDataBuffer.UnBindBuffer( texDataBufferType );
597597

598-
lightmapDataUBO.BindBuffer();
599-
lightmapDataUBO.BufferStorage( MAX_LIGHTMAPS * LIGHTMAP_SIZE, 1, nullptr );
600-
lightmapDataUBO.MapAll();
601-
uint64_t* lightmapData = ( uint64_t* ) lightmapDataUBO.GetData();
598+
lightMapDataUBO.BindBuffer();
599+
lightMapDataUBO.BufferStorage( MAX_LIGHTMAPS * LIGHTMAP_SIZE, 1, nullptr );
600+
lightMapDataUBO.MapAll();
601+
uint64_t* lightmapData = ( uint64_t* ) lightMapDataUBO.GetData();
602602
memset( lightmapData, 0, MAX_LIGHTMAPS * LIGHTMAP_SIZE * sizeof( uint32_t ) );
603603

604604
for ( uint32_t i = 0; i < tr.lightmaps.size(); i++ ) {
@@ -633,9 +633,9 @@ void MaterialSystem::GenerateWorldCommandBuffer() {
633633
lightmapData[255 * 2 + 1] = tr.blackImage->texture->bindlessTextureHandle;
634634
}
635635

636-
lightmapDataUBO.FlushAll();
637-
lightmapDataUBO.UnmapBuffer();
638-
lightmapDataUBO.UnBindBuffer();
636+
lightMapDataUBO.FlushAll();
637+
lightMapDataUBO.UnmapBuffer();
638+
lightMapDataUBO.UnBindBuffer();
639639

640640
surfaceCommandsCount = totalBatchCount * SURFACE_COMMANDS_PER_BATCH;
641641

@@ -1897,7 +1897,7 @@ void MaterialSystem::Free() {
18971897
culledCommandsBuffer.UnmapBuffer();
18981898
atomicCommandCountersBuffer.UnmapBuffer();
18991899
texDataBuffer.UnmapBuffer();
1900-
lightmapDataUBO.UnmapBuffer();
1900+
lightMapDataUBO.UnmapBuffer();
19011901

19021902
if ( totalPortals > 0 ) {
19031903
portalSurfacesSSBO.UnmapBuffer();
@@ -2202,7 +2202,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
22022202
atomicCommandCountersBuffer.BindBuffer( GL_PARAMETER_BUFFER_ARB );
22032203

22042204
texDataBuffer.BindBufferBase( texDataBufferType );
2205-
lightmapDataUBO.BindBufferBase();
2205+
lightMapDataUBO.BindBufferBase();
22062206

22072207
if ( r_showGlobalMaterials.Get() && material.sort != 0
22082208
&& ( material.shaderBinder == BindShaderLightMapping || material.shaderBinder == BindShaderGeneric3D ) ) {
@@ -2319,7 +2319,7 @@ void MaterialSystem::RenderMaterial( Material& material, const uint32_t viewID )
23192319
atomicCommandCountersBuffer.UnBindBuffer( GL_PARAMETER_BUFFER_ARB );
23202320

23212321
texDataBuffer.UnBindBufferBase( texDataBufferType );
2322-
lightmapDataUBO.UnBindBufferBase();
2322+
lightMapDataUBO.UnBindBufferBase();
23232323

23242324
if ( material.usePolygonOffset ) {
23252325
glDisable( GL_POLYGON_OFFSET_FILL );

src/engine/renderer/Material.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class MaterialSystem {
403403

404404
extern GLUBO materialsUBO; // Global
405405
extern GLBuffer texDataBuffer; // Global
406-
extern GLUBO lightmapDataUBO; // Global
406+
extern GLUBO lightMapDataUBO; // Global
407407

408408
extern GLSSBO surfaceDescriptorsSSBO; // Global
409409
extern GLSSBO surfaceCommandsSSBO; // Per viewframe, GPU updated

src/engine/renderer/gl_shader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1393,11 +1393,11 @@ std::string GLShaderManager::ShaderPostProcess( GLShader *shader, const std::str
13931393
" uvec2 u_LightMap;\n"
13941394
" uvec2 u_DeluxeMap;\n"
13951395
"};\n\n"
1396-
"layout(std140, binding = 8) uniform lightmapDataUBO {\n"
1397-
" LightMapData lightmapData[256];\n"
1396+
"layout(std140, binding = 8) uniform lightMapDataUBO {\n"
1397+
" LightMapData lightMapData[256];\n"
13981398
"};\n\n"
1399-
"#define u_LightMap_initial lightmapData[( baseInstance >> 24 ) & 0xFF].u_LightMap\n"
1400-
"#define u_DeluxeMap_initial lightmapData[( baseInstance >> 24 ) & 0xFF].u_DeluxeMap\n\n";
1399+
"#define u_LightMap_initial lightMapData[( baseInstance >> 24 ) & 0xFF].u_LightMap\n"
1400+
"#define u_DeluxeMap_initial lightMapData[( baseInstance >> 24 ) & 0xFF].u_DeluxeMap\n\n";
14011401
std::string materialDefines;
14021402

14031403
/* Generate the struct and defines in the form of:

src/engine/renderer/tr_vbo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ static void R_InitMaterialBuffers() {
731731
if( glConfig2.usingMaterialSystem ) {
732732
materialsUBO.GenBuffer();
733733
texDataBuffer.GenBuffer();
734-
lightmapDataUBO.GenBuffer();
734+
lightMapDataUBO.GenBuffer();
735735

736736
surfaceDescriptorsSSBO.GenBuffer();
737737
surfaceCommandsSSBO.GenBuffer();
@@ -863,7 +863,7 @@ void R_ShutdownVBOs()
863863
if ( glConfig2.usingMaterialSystem ) {
864864
materialsUBO.DelBuffer();
865865
texDataBuffer.DelBuffer();
866-
lightmapDataUBO.DelBuffer();
866+
lightMapDataUBO.DelBuffer();
867867

868868
surfaceDescriptorsSSBO.DelBuffer();
869869
surfaceCommandsSSBO.DelBuffer();

0 commit comments

Comments
 (0)