Skip to content

Commit c2e029c

Browse files
committed
cvar-test
1 parent a89f545 commit c2e029c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/engine/renderer/tr_surface.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ use the shader system.
4343

4444
static transform_t bones[ MAX_BONES ];
4545

46-
// Do not multithread loops not calling R_TBNtoQtangents().
47-
#define NO_MT_IF_NO_TBNTOQ 1
46+
// Test cvar.
47+
Cvar::Cvar<bool> r_parallelNotbntoq( "r_parallelNotbntoq", "r_parallelNotbntoq", Cvar::NONE, true );
4848

4949
template <typename T> void surfaceTasker( const T& task, const size_t& amount )
5050
{
@@ -1082,7 +1082,7 @@ static void Tess_SurfaceMD5( md5Surface_t *srf )
10821082
// Deform the vertices by the lerped bones.
10831083
if ( tess.skipTangents )
10841084
{
1085-
#if NO_MT_IF_NO_TBNTOQ
1085+
if ( !r_parallelNotbntoq.Get() ) {
10861086
for ( ; tessVertex < lastVertex; tessVertex++,
10871087
surfaceVertex++ )
10881088
{
@@ -1106,7 +1106,7 @@ static void Tess_SurfaceMD5( md5Surface_t *srf )
11061106

11071107
Vector2Copy( surfaceVertex->texCoords, tessVertex->texCoords );
11081108
}
1109-
#else
1109+
} else {
11101110
auto task = [&]( size_t chunk_index ) -> void
11111111
{
11121112
size_t chunk_offset = chunk_index * chunk_size;
@@ -1147,7 +1147,7 @@ static void Tess_SurfaceMD5( md5Surface_t *srf )
11471147
};
11481148

11491149
surfaceTasker( task, num_chunks );
1150-
#endif
1150+
}
11511151
}
11521152
else
11531153
{
@@ -1342,7 +1342,7 @@ void Tess_SurfaceIQM( srfIQModel_t *surf ) {
13421342
byte *modelBlendIndex = model->blendIndexes + 4 * firstVertex;
13431343
byte *modelBlendWeight = model->blendWeights + 4 * firstVertex;
13441344

1345-
#if NO_MT_IF_NO_TBNTOQ
1345+
if ( !r_parallelNotbntoq.Get() ) {
13461346
for ( ; tessVertex < lastVertex; tessVertex++,
13471347
modelPosition += 3, modelNormal += 3,
13481348
modelTangent += 3, modelBitangent += 3,
@@ -1371,7 +1371,7 @@ void Tess_SurfaceIQM( srfIQModel_t *surf ) {
13711371

13721372
Vector2Copy( modelTexcoord, tessVertex->texCoords );
13731373
}
1374-
#else
1374+
} else {
13751375
auto task = [&]( const size_t& chunk_index ) -> void
13761376
{
13771377
size_t chunk_offset = chunk_index * chunk_size;
@@ -1423,7 +1423,7 @@ void Tess_SurfaceIQM( srfIQModel_t *surf ) {
14231423
};
14241424

14251425
surfaceTasker( task, num_chunks );
1426-
#endif
1426+
}
14271427
}
14281428
else
14291429
{

0 commit comments

Comments
 (0)