Merge branch 'master' into vkdoom3-merge

This commit is contained in:
Robert Beckebans 2017-09-02 14:40:39 +02:00
commit 72091f73ca
12 changed files with 47 additions and 27 deletions

View file

@ -41,6 +41,7 @@ If you have questions concerning this license or the applicable additional terms
#define UNROLL4(Y) { int _IX, _NM = count&0xfffffffc; for (_IX=0;_IX<_NM;_IX+=4){Y(_IX+0);Y(_IX+1);Y(_IX+2);Y(_IX+3);}for(;_IX<count;_IX++){Y(_IX);}} #define UNROLL4(Y) { int _IX, _NM = count&0xfffffffc; for (_IX=0;_IX<_NM;_IX+=4){Y(_IX+0);Y(_IX+1);Y(_IX+2);Y(_IX+3);}for(;_IX<count;_IX++){Y(_IX);}}
#define UNROLL8(Y) { int _IX, _NM = count&0xfffffff8; for (_IX=0;_IX<_NM;_IX+=8){Y(_IX+0);Y(_IX+1);Y(_IX+2);Y(_IX+3);Y(_IX+4);Y(_IX+5);Y(_IX+6);Y(_IX+7);} _NM = count&0xfffffffe; for(;_IX<_NM;_IX+=2){Y(_IX); Y(_IX+1);} if (_IX < count) {Y(_IX);} } #define UNROLL8(Y) { int _IX, _NM = count&0xfffffff8; for (_IX=0;_IX<_NM;_IX+=8){Y(_IX+0);Y(_IX+1);Y(_IX+2);Y(_IX+3);Y(_IX+4);Y(_IX+5);Y(_IX+6);Y(_IX+7);} _NM = count&0xfffffffe; for(;_IX<_NM;_IX+=2){Y(_IX); Y(_IX+1);} if (_IX < count) {Y(_IX);} }
#undef NODEFAULT
#ifdef _DEBUG #ifdef _DEBUG
#define NODEFAULT default: assert( 0 ) #define NODEFAULT default: assert( 0 )
#else #else

View file

@ -215,6 +215,8 @@ bulk of the codebase, so it is the best place for analyze pragmas.
// win32 needs this, but 360 doesn't // win32 needs this, but 360 doesn't
#pragma warning( disable: 6540 ) // warning C6540: The use of attribute annotations on this function will invalidate all of its existing __declspec annotations [D:\tech5\engine\engine-10.vcxproj] #pragma warning( disable: 6540 ) // warning C6540: The use of attribute annotations on this function will invalidate all of its existing __declspec annotations [D:\tech5\engine\engine-10.vcxproj]
#pragma warning( disable: 4467 ) // .. Include\CodeAnalysis\SourceAnnotations.h(68): warning C4467: usage of ATL attributes is deprecated
#if !defined(VERIFY_FORMAT_STRING) #if !defined(VERIFY_FORMAT_STRING)
// checking format strings catches a LOT of errors // checking format strings catches a LOT of errors
#include <CodeAnalysis\SourceAnnotations.h> #include <CodeAnalysis\SourceAnnotations.h>

View file

@ -104,10 +104,10 @@ void Framebuffer::Init()
globalFramebuffers.hdrFBO->Bind(); globalFramebuffers.hdrFBO->Bind();
#if defined(USE_HDR_MSAA) #if defined(USE_HDR_MSAA)
if( r_multiSamples.GetBool() ) if( glConfig.multisamples )
{ {
globalFramebuffers.hdrFBO->AddColorBuffer( GL_RGBA16F, 0, r_multiSamples.GetInteger() ); globalFramebuffers.hdrFBO->AddColorBuffer( GL_RGBA16F, 0, glConfig.multisamples );
globalFramebuffers.hdrFBO->AddDepthBuffer( GL_DEPTH24_STENCIL8, r_multiSamples.GetInteger() ); globalFramebuffers.hdrFBO->AddDepthBuffer( GL_DEPTH24_STENCIL8, glConfig.multisamples );
globalFramebuffers.hdrFBO->AttachImage2D( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentRenderHDRImage, 0 ); globalFramebuffers.hdrFBO->AttachImage2D( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentRenderHDRImage, 0 );
globalFramebuffers.hdrFBO->AttachImageDepth( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentDepthImage ); globalFramebuffers.hdrFBO->AttachImageDepth( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentDepthImage );
@ -217,17 +217,21 @@ void Framebuffer::CheckFramebuffers()
globalImages->currentDepthImage->Resize( screenWidth, screenHeight ); globalImages->currentDepthImage->Resize( screenWidth, screenHeight );
#if defined(USE_HDR_MSAA) #if defined(USE_HDR_MSAA)
if( r_multiSamples.GetBool() ) if( glConfig.multisamples )
{ {
globalImages->currentRenderHDRImageNoMSAA->Resize( screenWidth, screenHeight ); globalImages->currentRenderHDRImageNoMSAA->Resize( screenWidth, screenHeight );
globalFramebuffers.hdrNonMSAAFBO->Bind();
globalFramebuffers.hdrNonMSAAFBO->AttachImage2D( GL_TEXTURE_2D, globalImages->currentRenderHDRImageNoMSAA, 0 );
globalFramebuffers.hdrNonMSAAFBO->Check();
globalFramebuffers.hdrNonMSAAFBO->width = screenWidth;
globalFramebuffers.hdrNonMSAAFBO->height = screenHeight;
globalFramebuffers.hdrFBO->Bind(); globalFramebuffers.hdrFBO->Bind();
globalFramebuffers.hdrFBO->AttachImage2D( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentRenderHDRImage, 0 ); globalFramebuffers.hdrFBO->AttachImage2D( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentRenderHDRImage, 0 );
globalFramebuffers.hdrFBO->AttachImageDepth( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentDepthImage ); globalFramebuffers.hdrFBO->AttachImageDepth( GL_TEXTURE_2D_MULTISAMPLE, globalImages->currentDepthImage );
globalFramebuffers.hdrFBO->Check(); globalFramebuffers.hdrFBO->Check();
globalFramebuffers.hdrNonMSAAFBO->width = screenWidth;
globalFramebuffers.hdrNonMSAAFBO->height = screenHeight;
} }
else else
#endif #endif

View file

@ -164,7 +164,7 @@ static void R_DepthImage( idImage* image )
{ {
// RB: NULL data and MSAA support // RB: NULL data and MSAA support
#if defined(USE_HDR_MSAA) #if defined(USE_HDR_MSAA)
int msaaSamples = r_multiSamples.GetInteger(); int msaaSamples = glConfig.multisamples;
#else #else
int msaaSamples = 0; int msaaSamples = 0;
#endif #endif
@ -176,7 +176,7 @@ static void R_DepthImage( idImage* image )
static void R_HDR_RGBA16FImage_ResNative( idImage* image ) static void R_HDR_RGBA16FImage_ResNative( idImage* image )
{ {
#if defined(USE_HDR_MSAA) #if defined(USE_HDR_MSAA)
int msaaSamples = r_multiSamples.GetInteger(); int msaaSamples = glConfig.multisamples;
#else #else
int msaaSamples = 0; int msaaSamples = 0;
#endif #endif

View file

@ -201,6 +201,9 @@ void idRenderProgManager::Init()
LoadGLSLProgram( i, i, i ); LoadGLSLProgram( i, i, i );
} }
r_useHalfLambertLighting.ClearModified();
r_useHDR.ClearModified();
// special case handling for fastZ shaders // special case handling for fastZ shaders
/* /*
switch( glConfig.driverType ) switch( glConfig.driverType )

View file

@ -315,6 +315,14 @@ static void R_CheckCvars()
} }
} }
if (r_useHDR.IsModified() || r_useHalfLambertLighting.IsModified() )
{
r_useHDR.ClearModified();
r_useHalfLambertLighting.ClearModified();
renderProgManager.KillAllShaders();
renderProgManager.LoadAllShaders();
}
// RB: turn off shadow mapping for OpenGL drivers that are too slow // RB: turn off shadow mapping for OpenGL drivers that are too slow
switch( glConfig.driverType ) switch( glConfig.driverType )
{ {

View file

@ -390,7 +390,9 @@ static void R_CheckPortableExtensions()
} }
// RB: Mesa support // RB: Mesa support
if( idStr::Icmpn( glConfig.renderer_string, "Mesa", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "X.org", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "Gallium", 7 ) == 0 ) if( idStr::Icmpn( glConfig.renderer_string, "Mesa", 4 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "X.org", 5 ) == 0 || idStr::Icmpn( glConfig.renderer_string, "Gallium", 7 ) == 0 ||
strcmp( glConfig.vendor_string, "X.Org" ) == 0 ||
idStr::Icmpn( glConfig.renderer_string, "llvmpipe", 8 ) == 0 )
{ {
if( glConfig.driverType == GLDRV_OPENGL32_CORE_PROFILE ) if( glConfig.driverType == GLDRV_OPENGL32_CORE_PROFILE )
{ {

View file

@ -4406,7 +4406,7 @@ static void RB_Tonemap( const viewDef_t* viewDef )
GL_SelectTexture( 0 ); GL_SelectTexture( 0 );
#if defined(USE_HDR_MSAA) #if defined(USE_HDR_MSAA)
if( r_multiSamples.GetInteger() > 0 ) if( glConfig.multisamples > 0 )
{ {
globalImages->currentRenderHDRImageNoMSAA->Bind(); globalImages->currentRenderHDRImageNoMSAA->Bind();
} }
@ -5436,7 +5436,7 @@ void RB_DrawViewInternal( const viewDef_t* viewDef, const int stereoEye )
*/ */
#if defined(USE_HDR_MSAA) #if defined(USE_HDR_MSAA)
if( r_multiSamples.GetInteger() > 0 ) if( glConfig.multisamples > 0 )
{ {
glBindFramebuffer( GL_READ_FRAMEBUFFER, globalFramebuffers.hdrFBO->GetFramebuffer() ); glBindFramebuffer( GL_READ_FRAMEBUFFER, globalFramebuffers.hdrFBO->GetFramebuffer() );
glBindFramebuffer( GL_DRAW_FRAMEBUFFER, globalFramebuffers.hdrNonMSAAFBO->GetFramebuffer() ); glBindFramebuffer( GL_DRAW_FRAMEBUFFER, globalFramebuffers.hdrNonMSAAFBO->GetFramebuffer() );

View file

@ -44,7 +44,7 @@ If you have questions concerning this license or the applicable additional terms
DisplayRealTimeString DisplayRealTimeString
============ ============
*/ */
void DisplayRealTimeString( char* string, ... ) void DisplayRealTimeString( const char* string, ... )
{ {
va_list argPtr; va_list argPtr;
char buf[MAX_STRING_CHARS]; char buf[MAX_STRING_CHARS];

View file

@ -46,7 +46,7 @@ If you have questions concerning this license or the applicable additional terms
class idBrush; class idBrush;
class idBrushList; class idBrushList;
void DisplayRealTimeString( char* string, ... ) ID_STATIC_ATTRIBUTE_PRINTF( 1, 2 ); void DisplayRealTimeString( const char* string, ... ) ID_STATIC_ATTRIBUTE_PRINTF( 1, 2 );
//=============================================================== //===============================================================