Skip to content

Commit 9352952

Browse files
committed
Minor fix-ups
1 parent 2922b09 commit 9352952

File tree

7 files changed

+14
-26
lines changed

7 files changed

+14
-26
lines changed

src/engine/renderer/GeometryCache.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3333
*/
3434
// GeometryCache.cpp
3535

36+
#include "common/Common.h"
37+
3638
#include "GeometryCache.h"
3739

3840
#include "tr_local.h"
@@ -59,9 +61,6 @@ void GeometryCache::FreeGLBuffers() {
5961
VAO.DelVAO();
6062
}
6163

62-
void GeometryCache::Free() {
63-
}
64-
6564
void GeometryCache::AllocBuffers() {
6665
VBO.BufferData( mapVerticesNumber * 8, nullptr, GL_STATIC_DRAW );
6766

@@ -89,7 +88,7 @@ void GeometryCache::AddMapGeometry( const uint32_t verticesNumber, const uint32_
8988
for ( const vertexAttributeSpec_t* spec = attrBegin; spec < attrEnd; spec++ ) {
9089
vboAttributeLayout_t& attr = VAO.attrs[spec->attrIndex];
9190

92-
CopyVertexAttribute( attr, *spec, mapVerticesNumber, ( byte* ) VBOVerts );
91+
R_CopyVertexAttribute( attr, *spec, mapVerticesNumber, ( byte* ) VBOVerts );
9392
}
9493
VBO.UnmapBuffer();
9594

src/engine/renderer/GeometryCache.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ class GeometryCache {
4646
void InitGLBuffers();
4747
void FreeGLBuffers();
4848

49-
void Free();
50-
5149
void AllocBuffers();
5250
void AddMapGeometry( const uint32_t verticesNumber, const uint32_t indicesNumber,
5351
const vertexAttributeSpec_t* attrBegin,

src/engine/renderer/gl_shader.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,6 @@ class GLVAO {
15521552
for ( const vertexAttributeSpec_t* spec = attrBegin; spec < attrEnd; spec++ ) {
15531553
vboAttributeLayout_t& attr = attrs[spec->attrIndex];
15541554
ASSERT_NQ( spec->numComponents, 0U );
1555-
// vbo->attribBits |= 1 << spec->attrIndex;
15561555
attr.componentType = spec->componentStorageType;
15571556
if ( attr.componentType == GL_HALF_FLOAT && !glConfig2.halfFloatVertexAvailable ) {
15581557
attr.componentType = GL_FLOAT;
@@ -1561,7 +1560,7 @@ class GLVAO {
15611560
attr.normalize = spec->attrOptions & ATTR_OPTION_NORMALIZE ? GL_TRUE : GL_FALSE;
15621561

15631562
attr.ofs = ofs;
1564-
ofs += attr.numComponents * ComponentSize( attr.componentType );
1563+
ofs += attr.numComponents * R_ComponentSize( attr.componentType );
15651564
ofs = ( ofs + 3 ) & ~3; // 4 is minimum alignment for any vertex attribute
15661565

15671566
enabledAttrs |= 1 << spec->attrIndex;

src/engine/renderer/tr_init.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
101101
Cvar::Cvar<bool> r_gpuFrustumCulling( "r_gpuFrustumCulling", "Use frustum culling on the GPU for the Material System", Cvar::NONE, true );
102102
Cvar::Cvar<bool> r_gpuOcclusionCulling( "r_gpuOcclusionCulling", "Use occlusion culling on the GPU for the Material System", Cvar::NONE, false );
103103
Cvar::Cvar<bool> r_materialSystemSkip( "r_materialSystemSkip", "Temporarily skip Material System rendering, using only core renderer instead", Cvar::NONE, false );
104-
Cvar::Cvar<bool> r_geometryCache( "r_geometryCache", "Use Geometry Cache", Cvar::NONE, true );
105104
cvar_t *r_lightStyles;
106105
cvar_t *r_exportTextures;
107106
cvar_t *r_heatHaze;
@@ -1244,7 +1243,6 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
12441243
Cvar::Latch( r_realtimeLightLayers );
12451244
Cvar::Latch( r_preferBindlessTextures );
12461245
Cvar::Latch( r_materialSystem );
1247-
Cvar::Latch( r_geometryCache );
12481246

12491247
r_drawworld = Cvar_Get( "r_drawworld", "1", CVAR_CHEAT );
12501248
r_max_portal_levels = Cvar_Get( "r_max_portal_levels", "5", 0 );
@@ -1573,10 +1571,6 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
15731571
materialSystem.Free();
15741572
}
15751573

1576-
if ( glConfig2.usingGeometryCache ) {
1577-
geometryCache.Free();
1578-
}
1579-
15801574
// shut down platform specific OpenGL stuff
15811575
if ( destroyWindow )
15821576
{

src/engine/renderer/tr_local.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2963,7 +2963,6 @@ enum class shaderProfilerRenderSubGroupsMode {
29632963
extern Cvar::Cvar<bool> r_gpuFrustumCulling;
29642964
extern Cvar::Cvar<bool> r_gpuOcclusionCulling;
29652965
extern Cvar::Cvar<bool> r_materialSystemSkip;
2966-
extern Cvar::Cvar<bool> r_geometryCache;
29672966
extern cvar_t *r_lightStyles;
29682967
extern cvar_t *r_exportTextures;
29692968
extern cvar_t *r_heatHaze;
@@ -3709,8 +3708,8 @@ inline bool checkGLErrors()
37093708
37103709
============================================================
37113710
*/
3712-
uint32_t ComponentSize( GLenum type );
3713-
void CopyVertexAttribute( const vboAttributeLayout_t& attrib, const vertexAttributeSpec_t& spec,
3711+
uint32_t R_ComponentSize( GLenum type );
3712+
void R_CopyVertexAttribute( const vboAttributeLayout_t& attrib, const vertexAttributeSpec_t& spec,
37143713
uint32_t count, byte* interleavedData );
37153714

37163715
VBO_t *R_CreateStaticVBO(

src/engine/renderer/tr_shade.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ static void EnableAvailableFeatures()
177177
glConfig2.usingMaterialSystem = r_materialSystem.Get() && glConfig2.materialSystemAvailable;
178178
glConfig2.usingBindlessTextures = glConfig2.usingMaterialSystem ||
179179
( r_preferBindlessTextures.Get() && glConfig2.bindlessTexturesAvailable );
180-
glConfig2.usingGeometryCache = glConfig2.usingMaterialSystem
181-
|| ( r_geometryCache.Get() && glConfig2.geometryCacheAvailable );
180+
glConfig2.usingGeometryCache = glConfig2.usingMaterialSystem && glConfig2.geometryCacheAvailable;
182181
}
183182

184183
// For shaders that require map data for compile-time values

src/engine/renderer/tr_vbo.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void R_SetVBOAttributeLayouts( VBO_t *vbo )
7575
}
7676
}
7777

78-
uint32_t ComponentSize( GLenum type )
78+
uint32_t R_ComponentSize( GLenum type )
7979
{
8080
switch ( type )
8181
{
@@ -91,7 +91,7 @@ uint32_t ComponentSize( GLenum type )
9191
return 4;
9292
}
9393

94-
Sys::Error( "VBO ComponentSize: unknown type %d", type );
94+
Sys::Error( "VBO R_ComponentSize: unknown type %d", type );
9595
}
9696

9797
/*
@@ -199,7 +199,7 @@ VBO_t *R_CreateDynamicVBO( const char *name, int numVertexes, uint32_t stateBits
199199
return vbo;
200200
}
201201

202-
void CopyVertexAttribute(
202+
void R_CopyVertexAttribute(
203203
const vboAttributeLayout_t &attrib, const vertexAttributeSpec_t &spec,
204204
uint32_t count, byte *interleavedData )
205205
{
@@ -216,7 +216,7 @@ void CopyVertexAttribute(
216216

217217
if ( attrib.componentType == spec.componentInputType )
218218
{
219-
uint32_t size = attrib.numComponents * ComponentSize( attrib.componentType );
219+
uint32_t size = attrib.numComponents * R_ComponentSize( attrib.componentType );
220220

221221
for ( uint32_t v = count; ; )
222222
{
@@ -323,7 +323,7 @@ VBO_t *R_CreateStaticVBO(
323323

324324
uint32_t &ofs = spec->attrOptions & ATTR_OPTION_HAS_FRAMES ? ofsFrameful : ofsFrameless;
325325
attrib.ofs = ofs;
326-
ofs += attrib.numComponents * ComponentSize( attrib.componentType );
326+
ofs += attrib.numComponents * R_ComponentSize( attrib.componentType );
327327
ofs = ( ofs + 3 ) & ~3; // 4 is minimum alignment for any vertex attribute
328328
}
329329

@@ -343,12 +343,12 @@ VBO_t *R_CreateStaticVBO(
343343
attrib.stride = ofsFrameful;
344344
attrib.frameOffset = numVerts * ofsFrameful;
345345
attrib.ofs += framelessSize;
346-
CopyVertexAttribute( attrib, *spec, numVerts * numFrames, interleavedData );
346+
R_CopyVertexAttribute( attrib, *spec, numVerts * numFrames, interleavedData );
347347
}
348348
else
349349
{
350350
attrib.stride = ofsFrameless;
351-
CopyVertexAttribute( attrib, *spec, numVerts, interleavedData );
351+
R_CopyVertexAttribute( attrib, *spec, numVerts, interleavedData );
352352
}
353353
}
354354

0 commit comments

Comments
 (0)