Skip to content

Commit

Permalink
Merge branch 'vkdoom3-merge'
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertBeckebans committed Sep 30, 2018
2 parents fd9d0bb + 7545d69 commit 735a925
Show file tree
Hide file tree
Showing 73 changed files with 4,047 additions and 3,906 deletions.
2 changes: 1 addition & 1 deletion neo/d3xp/menus/MenuScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms
#ifndef __MENUSCREEN_H__
#define __MENUSCREEN_H__

#include "../../renderer/tr_local.h"
#include "../../renderer/RenderCommon.h"

enum mainMenuTransition_t
{
Expand Down
2 changes: 1 addition & 1 deletion neo/d3xp/menus/MenuScreen_Shell_Resolution.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
#pragma hdrstop
#include "precompiled.h"
#include "../Game_local.h"
#include "../../renderer/tr_local.h"
#include "../../renderer/RenderCommon.h"

const static int NUM_SETTING_OPTIONS = 7;

Expand Down
11 changes: 0 additions & 11 deletions neo/framework/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -825,16 +825,6 @@ CONSOLE_COMMAND( reloadLanguage, "reload language dict", NULL )

#include "../renderer/Image.h"

/*
=================
Com_StartBuild_f
=================
*/
CONSOLE_COMMAND( startBuild, "prepares to make a build", NULL )
{
globalImages->StartBuild();
}

/*
=================
Com_FinishBuild_f
Expand All @@ -846,7 +836,6 @@ CONSOLE_COMMAND( finishBuild, "finishes the build process", NULL )
{
game->CacheDictionaryMedia( NULL );
}
globalImages->FinishBuild( ( args.Argc() > 1 ) );
}

/*
Expand Down
19 changes: 14 additions & 5 deletions neo/framework/common_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ If you have questions concerning this license or the applicable additional terms

#include "Common_local.h"
#include "../renderer/Image.h" // now I did it!
#include "../renderer/ImageOpts.h"

// RB begin
#if defined(USE_DOOMCLASSIC)
Expand Down Expand Up @@ -65,7 +64,7 @@ idCVar com_deltaTimeClamp( "com_deltaTimeClamp", "50", CVAR_INTEGER, "don't proc

idCVar com_fixedTic( "com_fixedTic", DEFAULT_FIXED_TIC, CVAR_BOOL, "run a single game frame per render frame" );
idCVar com_noSleep( "com_noSleep", DEFAULT_NO_SLEEP, CVAR_BOOL, "don't sleep if the game is running too fast" );
idCVar com_smp( "com_smp", "1", CVAR_BOOL | CVAR_SYSTEM | CVAR_NOCHEAT, "run the game and draw code in a separate thread" );
idCVar com_smp( "com_smp", "1", CVAR_INTEGER | CVAR_SYSTEM | CVAR_NOCHEAT, "run the game and draw code in a separate thread" );
idCVar com_aviDemoSamples( "com_aviDemoSamples", "16", CVAR_SYSTEM, "" );
idCVar com_aviDemoWidth( "com_aviDemoWidth", "256", CVAR_SYSTEM, "" );
idCVar com_aviDemoHeight( "com_aviDemoHeight", "256", CVAR_SYSTEM, "" );
Expand Down Expand Up @@ -195,7 +194,7 @@ gameReturn_t idGameThread::RunGameAndDraw( int numGameFrames_, idUserCmdMgr& use
numGameFrames = numGameFrames_;

// start the thread going
if( com_smp.GetBool() == false )
if( com_smp.GetInteger() <= 0 )
{
// run it in the main thread so PIX profiling catches everything
Run();
Expand Down Expand Up @@ -555,10 +554,15 @@ void idCommonLocal::Frame()
// This may block if the GPU isn't finished renderng the previous frame.
frameTiming.startSyncTime = Sys_Microseconds();
const emptyCommand_t* renderCommands = NULL;
if( com_smp.GetBool() )
if( com_smp.GetInteger() > 0 )
{
renderCommands = renderSystem->SwapCommandBuffers( &time_frontend, &time_backend, &time_shadows, &time_gpu );
}
else if( com_smp.GetInteger() < 0 )
{
// RB: this is the same as Doom 3 renderSystem->BeginFrame()
renderCommands = renderSystem->SwapCommandBuffers_FinishCommandBuffers();
}
else
{
// the GPU will stay idle through command generation for minimal
Expand Down Expand Up @@ -779,7 +783,12 @@ void idCommonLocal::Frame()
// start the game / draw command generation thread going in the background
gameReturn_t ret = gameThread.RunGameAndDraw( numGameFrames, userCmdMgr, IsClient(), gameFrame - numGameFrames );

if( !com_smp.GetBool() )
if( com_smp.GetInteger() < 0 )
{
// RB: this is the same as Doom 3 renderSystem->EndFrame()
renderSystem->SwapCommandBuffers_FinishRendering( &time_frontend, &time_backend, &time_shadows, &time_gpu );
}
else if( com_smp.GetInteger() == 0 )
{
// in non-smp mode, run the commands we just generated, instead of
// frame-delayed ones from a background thread
Expand Down
2 changes: 1 addition & 1 deletion neo/renderer/BinaryImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ If you have questions concerning this license or the applicable additional terms
================================================================================================
*/

#include "tr_local.h"
#include "RenderCommon.h"
#include "DXT/DXTCodec.h"
#include "Color/ColorSpace.h"

Expand Down
2 changes: 1 addition & 1 deletion neo/renderer/BufferObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ If you have questions concerning this license or the applicable additional terms
*/
#pragma hdrstop
#include "precompiled.h"
#include "tr_local.h"
#include "RenderCommon.h"

idCVar r_showBuffers( "r_showBuffers", "0", CVAR_INTEGER, "" );

Expand Down
2 changes: 1 addition & 1 deletion neo/renderer/Cinematic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern idCVar s_noSound;
#include <jpeglib.h>
//}

#include "tr_local.h"
#include "RenderCommon.h"

#define CIN_system 1
#define CIN_loop 2
Expand Down
22 changes: 11 additions & 11 deletions neo/renderer/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ If you have questions concerning this license or the applicable additional terms
#include "precompiled.h"
#pragma hdrstop

#include "tr_local.h"
#include "RenderCommon.h"
#include "Framebuffer.h"

idList<Framebuffer*> Framebuffer::framebuffers;
Expand Down Expand Up @@ -79,7 +79,7 @@ void Framebuffer::Init()
{
cmdSystem->AddCommand( "listFramebuffers", R_ListFramebuffers_f, CMD_FL_RENDERER, "lists framebuffers" );

backEnd.glState.currentFramebuffer = NULL;
tr.backend.currentFramebuffer = NULL;

// SHADOWMAPS

Expand All @@ -96,7 +96,7 @@ void Framebuffer::Init()
}

// HDR

int screenWidth = renderSystem->GetWidth();
int screenHeight = renderSystem->GetHeight();

Expand Down Expand Up @@ -207,7 +207,7 @@ void Framebuffer::CheckFramebuffers()
{
int screenWidth = renderSystem->GetWidth();
int screenHeight = renderSystem->GetHeight();

if( globalFramebuffers.hdrFBO->GetWidth() != screenWidth || globalFramebuffers.hdrFBO->GetHeight() != screenHeight )
{
Unbind();
Expand All @@ -224,7 +224,7 @@ void Framebuffer::CheckFramebuffers()
globalFramebuffers.hdrNonMSAAFBO->Bind();
globalFramebuffers.hdrNonMSAAFBO->AttachImage2D( GL_TEXTURE_2D, globalImages->currentRenderHDRImageNoMSAA, 0 );
globalFramebuffers.hdrNonMSAAFBO->Check();

globalFramebuffers.hdrNonMSAAFBO->width = screenWidth;
globalFramebuffers.hdrNonMSAAFBO->height = screenHeight;

Expand Down Expand Up @@ -340,33 +340,33 @@ void Framebuffer::Bind()
{
RENDERLOG_PRINTF( "Framebuffer::Bind( %s )\n", fboName.c_str() );

if( backEnd.glState.currentFramebuffer != this )
if( tr.backend.currentFramebuffer != this )
{
glBindFramebuffer( GL_FRAMEBUFFER, frameBuffer );
backEnd.glState.currentFramebuffer = this;
tr.backend.currentFramebuffer = this;
}
}

bool Framebuffer::IsBound()
{
return ( backEnd.glState.currentFramebuffer == this );
return ( tr.backend.currentFramebuffer == this );
}

void Framebuffer::Unbind()
{
RENDERLOG_PRINTF( "Framebuffer::Unbind()\n" );

//if(backEnd.glState.framebuffer != NULL)
//if(tr.backend.framebuffer != NULL)
{
glBindFramebuffer( GL_FRAMEBUFFER, 0 );
glBindRenderbuffer( GL_RENDERBUFFER, 0 );
backEnd.glState.currentFramebuffer = NULL;
tr.backend.currentFramebuffer = NULL;
}
}

bool Framebuffer::IsDefaultFramebufferActive()
{
return ( backEnd.glState.currentFramebuffer == NULL );
return ( tr.backend.currentFramebuffer == NULL );
}

void Framebuffer::AddColorBuffer( int format, int index, int multiSamples )
Expand Down
2 changes: 1 addition & 1 deletion neo/renderer/GLMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you have questions concerning this license or the applicable additional terms
#pragma hdrstop
#include "precompiled.h"

#include "tr_local.h"
#include "RenderCommon.h"

/*
==========================================================================================
Expand Down
15 changes: 14 additions & 1 deletion neo/renderer/GLState.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Doom 3 BFG Edition GPL Source Code
Copyright (C) 1993-2012 id Software LLC, a ZeniMax Media company.
Copyright (C) 2016-2017 Dustin Land
This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code").
Expand Down Expand Up @@ -70,6 +71,12 @@ static const uint64 GLS_DEPTHFUNC_GREATER = 2 << 13;
static const uint64 GLS_DEPTHFUNC_EQUAL = 3 << 13;
static const uint64 GLS_DEPTHFUNC_BITS = 3 << 13;

static const uint64 GLS_CULL_FRONTSIDED = 0 << 15;
static const uint64 GLS_CULL_BACKSIDED = 1 << 15;
static const uint64 GLS_CULL_TWOSIDED = 2 << 15;
static const uint64 GLS_CULL_BITS = 2 << 15;
static const uint64 GLS_CULL_MASK = GLS_CULL_FRONTSIDED | GLS_CULL_BACKSIDED | GLS_CULL_TWOSIDED;

static const uint64 GLS_BLENDOP_ADD = 0 << 18;
static const uint64 GLS_BLENDOP_SUB = 1 << 18;
static const uint64 GLS_BLENDOP_MIN = 2 << 18;
Expand Down Expand Up @@ -138,9 +145,15 @@ static const uint64 GLS_ALPHATEST_FUNC_BITS = 3ull << 56;

static const uint64 GLS_STENCIL_OP_BITS = GLS_STENCIL_OP_FAIL_BITS | GLS_STENCIL_OP_ZFAIL_BITS | GLS_STENCIL_OP_PASS_BITS;

static const uint64 GLS_DEPTH_TEST_MASK = 1ull << 58;
static const uint64 GLS_CLOCKWISE = 1ull << 59;
static const uint64 GLS_SEPARATE_STENCIL = 1ull << 60;
static const uint64 GLS_MIRROR_VIEW = 1ull << 61;

static const uint64 GLS_OVERRIDE = 1ull << 63; // override the render prog state

static const uint64 GLS_DEFAULT = 0;
static const uint64 GLS_KEEP = GLS_DEPTH_TEST_MASK;
static const uint64 GLS_DEFAULT = 0;

#define STENCIL_SHADOW_TEST_VALUE 128
#define STENCIL_SHADOW_MASK_VALUE 255
Expand Down

0 comments on commit 735a925

Please sign in to comment.