Skip to content

Commit 635926f

Browse files
committed
Minor fix-ups
1 parent c2c8487 commit 635926f

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
@@ -103,7 +103,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
103103
Cvar::Cvar<bool> r_gpuFrustumCulling( "r_gpuFrustumCulling", "Use frustum culling on the GPU for the Material System", Cvar::NONE, true );
104104
Cvar::Cvar<bool> r_gpuOcclusionCulling( "r_gpuOcclusionCulling", "Use occlusion culling on the GPU for the Material System", Cvar::NONE, false );
105105
Cvar::Cvar<bool> r_materialSystemSkip( "r_materialSystemSkip", "Temporarily skip Material System rendering, using only core renderer instead", Cvar::NONE, false );
106-
Cvar::Cvar<bool> r_geometryCache( "r_geometryCache", "Use Geometry Cache", Cvar::NONE, true );
107106
cvar_t *r_lightStyles;
108107
cvar_t *r_exportTextures;
109108
cvar_t *r_heatHaze;
@@ -1240,7 +1239,6 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
12401239
Cvar::Latch( r_realtimeLightLayers );
12411240
Cvar::Latch( r_preferBindlessTextures );
12421241
Cvar::Latch( r_materialSystem );
1243-
Cvar::Latch( r_geometryCache );
12441242

12451243
r_drawworld = Cvar_Get( "r_drawworld", "1", CVAR_CHEAT );
12461244
r_max_portal_levels = Cvar_Get( "r_max_portal_levels", "5", 0 );
@@ -1570,10 +1568,6 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p
15701568
materialSystem.Free();
15711569
}
15721570

1573-
if ( glConfig2.usingGeometryCache ) {
1574-
geometryCache.Free();
1575-
}
1576-
15771571
// shut down platform specific OpenGL stuff
15781572
if ( destroyWindow )
15791573
{

src/engine/renderer/tr_local.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,6 @@ enum class shaderProfilerRenderSubGroupsMode {
29662966
extern Cvar::Cvar<bool> r_gpuFrustumCulling;
29672967
extern Cvar::Cvar<bool> r_gpuOcclusionCulling;
29682968
extern Cvar::Cvar<bool> r_materialSystemSkip;
2969-
extern Cvar::Cvar<bool> r_geometryCache;
29702969
extern cvar_t *r_lightStyles;
29712970
extern cvar_t *r_exportTextures;
29722971
extern cvar_t *r_heatHaze;
@@ -3716,8 +3715,8 @@ inline bool checkGLErrors()
37163715
37173716
============================================================
37183717
*/
3719-
uint32_t ComponentSize( GLenum type );
3720-
void CopyVertexAttribute( const vboAttributeLayout_t& attrib, const vertexAttributeSpec_t& spec,
3718+
uint32_t R_ComponentSize( GLenum type );
3719+
void R_CopyVertexAttribute( const vboAttributeLayout_t& attrib, const vertexAttributeSpec_t& spec,
37213720
uint32_t count, byte* interleavedData );
37223721

37233722
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
#if defined( GL_ARB_buffer_storage ) && defined( GL_ARB_sync )
@@ -209,7 +209,7 @@ VBO_t *R_CreateDynamicVBO( const char *name, int numVertexes, uint32_t stateBits
209209
return vbo;
210210
}
211211

212-
void CopyVertexAttribute(
212+
void R_CopyVertexAttribute(
213213
const vboAttributeLayout_t &attrib, const vertexAttributeSpec_t &spec,
214214
uint32_t count, byte *interleavedData )
215215
{
@@ -226,7 +226,7 @@ void CopyVertexAttribute(
226226

227227
if ( attrib.componentType == spec.componentInputType )
228228
{
229-
uint32_t size = attrib.numComponents * ComponentSize( attrib.componentType );
229+
uint32_t size = attrib.numComponents * R_ComponentSize( attrib.componentType );
230230

231231
for ( uint32_t v = count; ; )
232232
{
@@ -333,7 +333,7 @@ VBO_t *R_CreateStaticVBO(
333333

334334
uint32_t &ofs = spec->attrOptions & ATTR_OPTION_HAS_FRAMES ? ofsFrameful : ofsFrameless;
335335
attrib.ofs = ofs;
336-
ofs += attrib.numComponents * ComponentSize( attrib.componentType );
336+
ofs += attrib.numComponents * R_ComponentSize( attrib.componentType );
337337
ofs = ( ofs + 3 ) & ~3; // 4 is minimum alignment for any vertex attribute
338338
}
339339

@@ -353,12 +353,12 @@ VBO_t *R_CreateStaticVBO(
353353
attrib.stride = ofsFrameful;
354354
attrib.frameOffset = numVerts * ofsFrameful;
355355
attrib.ofs += framelessSize;
356-
CopyVertexAttribute( attrib, *spec, numVerts * numFrames, interleavedData );
356+
R_CopyVertexAttribute( attrib, *spec, numVerts * numFrames, interleavedData );
357357
}
358358
else
359359
{
360360
attrib.stride = ofsFrameless;
361-
CopyVertexAttribute( attrib, *spec, numVerts, interleavedData );
361+
R_CopyVertexAttribute( attrib, *spec, numVerts, interleavedData );
362362
}
363363
}
364364

0 commit comments

Comments
 (0)