Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions renderers/vulkan/tr_animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,6 @@ void RB_MDRSurfaceAnim( mdrSurface_t *surface )
tempVert[1] += w->boneWeight * ( DotProduct( bone->matrix[1], w->offset ) + bone->matrix[1][3] );
tempVert[2] += w->boneWeight * ( DotProduct( bone->matrix[2], w->offset ) + bone->matrix[2][3] );

#ifdef USE_TESS_NEEDS_NORMAL
if ( tess.needsNormal )
#endif
{
tempNormal[0] += w->boneWeight * DotProduct( bone->matrix[0], v->normal );
tempNormal[1] += w->boneWeight * DotProduct( bone->matrix[1], v->normal );
Expand All @@ -425,9 +422,6 @@ void RB_MDRSurfaceAnim( mdrSurface_t *surface )
tess.xyz[baseVertex + j][1] = tempVert[1];
tess.xyz[baseVertex + j][2] = tempVert[2];

#ifdef USE_TESS_NEEDS_NORMAL
if ( tess.needsNormal )
#endif
{
tess.normal[baseVertex + j][0] = tempNormal[0];
tess.normal[baseVertex + j][1] = tempNormal[1];
Expand Down
35 changes: 5 additions & 30 deletions renderers/vulkan/tr_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define TR_LOCAL_H

#define USE_VK_PBR
#ifdef USE_VK_PBR
#define VK_PBR_BRDFLUT // for inspecting codebase, does not toggle brdflut.
#define VK_CUBEMAP

#ifdef VK_CUBEMAP
#define REF_CUBEMAP_IRRADIANCE_SIZE 64
#define REF_CUBEMAP_SIZE 256
#endif
#endif
#define VK_PBR_BRDFLUT // for inspecting codebase, does not toggle brdflut.
#define VK_CUBEMAP
#define REF_CUBEMAP_IRRADIANCE_SIZE 64
#define REF_CUBEMAP_SIZE 256

#define USE_VBO // store static world geometry in VBO
#define USE_FOG_COLLAPSE // not compatible with legacy dlights
Expand All @@ -42,13 +37,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

#define MAX_TEXTURE_SIZE 32768

#ifdef USE_VBO
#define USE_VBO_GRID /* put SF_GRID to VBO */
#endif

//#define USE_TESS_NEEDS_NORMAL
//#define USE_TESS_NEEDS_ST2

#define SH_COEFF_COUNT 9

#include "../../qcommon/q_shared.h"
Expand Down Expand Up @@ -867,11 +855,7 @@ typedef struct srfGridMesh_s {
srfVert_t verts[1]; // variable sized
} srfGridMesh_t;

#ifdef USE_VK_PBR
#define VERTEXSIZE 11
#else
#define VERTEXSIZE 8
#endif
#define VERTEXSIZE 11
typedef struct {
surfaceType_t surfaceType;
cplane_t plane;
Expand Down Expand Up @@ -2086,9 +2070,7 @@ image_t *vk_create_pbr_albedo_srgb( const char *albedoMapName, imgFlags_t flags
//
// tr_surface.c
//
#ifdef USE_VBO_GRID
void RB_SurfaceGridEstimate( srfGridMesh_t *cv, int *numVertexes, int *numIndexes );
#endif

/*
====================================================================
Expand Down Expand Up @@ -2156,13 +2138,6 @@ typedef struct shaderCommands_s
#endif

// info extracted from current shader
#ifdef USE_TESS_NEEDS_NORMAL
int needsNormal;
#endif
#ifdef USE_TESS_NEEDS_ST2
int needsST2;
#endif

int numPasses;
shaderStage_t **xstages;

Expand Down
3 changes: 0 additions & 3 deletions renderers/vulkan/tr_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,9 +1082,6 @@ static qboolean SurfIsOffscreen( const drawSurf_t *drawSurf, qboolean *isMirror
RB_BeginSurface( shader, fogNum );
#ifdef USE_VBO
tess.allowVBO = qfalse;
#endif
#ifdef USE_TESS_NEEDS_NORMAL
tess.needsNormal = qtrue;
#endif
rb_surfaceTable[ *drawSurf->surface ]( drawSurf->surface );

Expand Down
8 changes: 0 additions & 8 deletions renderers/vulkan/tr_material_paint.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,7 @@ static void MP_WriteFaceColor( srfSurfaceFace_t *face, int vertIndex, const byte
if ( !face || vertIndex < 0 || vertIndex >= face->numPoints ) {
return;
}
#ifdef USE_VK_PBR
dst = (byte *)&face->points[vertIndex][10];
#else
dst = (byte *)&face->points[vertIndex][7];
#endif
dst[0] = rgba[0];
dst[1] = rgba[1];
dst[2] = rgba[2];
Expand All @@ -83,11 +79,7 @@ static void MP_ReadFaceColor( const srfSurfaceFace_t *face, int vertIndex, byte
rgba[0] = rgba[1] = rgba[2] = rgba[3] = 0;
return;
}
#ifdef USE_VK_PBR
src = (const byte *)&face->points[vertIndex][10];
#else
src = (const byte *)&face->points[vertIndex][7];
#endif
rgba[0] = src[0];
rgba[1] = src[1];
rgba[2] = src[2];
Expand Down
12 changes: 0 additions & 12 deletions renderers/vulkan/tr_shade.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,18 +395,6 @@ void RB_BeginSurface( shader_t *shader, int fogNum ) {
tess.dlightUpdateParams = qtrue;
}

#ifdef USE_TESS_NEEDS_NORMAL
tess.needsNormal = state->needsNormal || tess.dlightPass || r_shownormals->integer ||
( backEnd.currentEntity == &tr.worldEntity &&
( ( r_shDebugView && r_shDebugView->integer ) ||
( r_shWorldLighting && r_shWorldLighting->integer && r_shLighting && r_shLighting->integer &&
!R_ClassicLightingActive() ) ) );
#endif

#ifdef USE_TESS_NEEDS_ST2
tess.needsST2 = state->needsST2;
#endif

tess.numIndexes = 0;
tess.numVertexes = 0;
tess.sdfUiEdge = -1.0f;
Expand Down
Loading
Loading