Skip to content

Commit

Permalink
Merge branch 'master' into for-0.55.0/sync
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Jun 1, 2024
2 parents e2b89c1 + f42c220 commit 6a87f2e
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 14 deletions.
4 changes: 4 additions & 0 deletions src/common/IPC/Primitives.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ enum NaClDescTypeTag {
NACL_DESC_NULL
};
#define NACL_DESC_TYPE_MAX (NACL_DESC_NULL + 1)

#if !defined(__native_client__)
static const int NACL_DESC_TYPE_END_TAG = (0xff);

struct NaClInternalRealHeader {
Expand All @@ -96,6 +98,8 @@ struct NaClInternalHeader {
};

static const uint32_t NACL_HANDLE_TRANSFER_PROTOCOL = 0xd3c0de01;
#endif

// End of imported definitions

namespace IPC {
Expand Down
5 changes: 5 additions & 0 deletions src/engine/renderer/gl_shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,11 @@ static std::string GenEngineConstants() {
AddDefine( str, "r_showParallelShadowSplits", 1 );
}

if ( r_highPrecisionRendering.Get() )
{
AddDefine( str, "r_highPrecisionRendering", 1 );
}

if ( glConfig2.dynamicLight )
{
AddDefine( str, "r_dynamicLight", 1 );
Expand Down
2 changes: 1 addition & 1 deletion src/engine/renderer/glsl_source/computeLight_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void computeDeluxeLight( vec3 lightDir, vec3 normal, vec3 viewDir, vec3 lightCol
#endif // !USE_PHYSICAL_MAPPING
}

#if defined(TEXTURE_INTEGER)
#if defined(TEXTURE_INTEGER) && defined(r_highPrecisionRendering)
const int lightsPerLayer = 16;
uniform usampler3D u_LightTiles;
#define idxs_t uvec4
Expand Down
2 changes: 1 addition & 1 deletion src/engine/renderer/glsl_source/lighttile_fp.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ uniform vec3 u_zFar;

const int numLayers = MAX_REF_LIGHTS / 256;

#if defined( TEXTURE_INTEGER )
#if defined(TEXTURE_INTEGER) && defined(r_highPrecisionRendering)
#define idxs_t uvec4
#define idx_initializer uvec4(3)
DECLARE_OUTPUT(uvec4)
Expand Down
28 changes: 16 additions & 12 deletions src/engine/renderer/tr_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2403,7 +2403,7 @@ static void R_CreateCurrentRenderImage()
imageParams_t imageParams = {};
imageParams.bits = IF_NOPICMIP;

if ( glConfig2.textureFloatAvailable && r_highPrecisionRendering.Get() )
if ( r_highPrecisionRendering.Get() )
{
imageParams.bits |= IF_RGBA16;
}
Expand All @@ -2424,6 +2424,8 @@ static void R_CreateCurrentRenderImage()

static void R_CreateDepthRenderImage()
{
ASSERT( glConfig2.textureFloatAvailable );

if ( !glConfig2.dynamicLight )
{
return;
Expand All @@ -2437,7 +2439,9 @@ static void R_CreateDepthRenderImage()
imageParams_t imageParams = {};
imageParams.filterType = filterType_t::FT_NEAREST;
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
imageParams.bits = IF_NOPICMIP | IF_RGBA32F;

imageParams.bits = IF_NOPICMIP;
imageParams.bits |= r_highPrecisionRendering.Get() ? IF_RGBA32F : IF_RGBA16F;

tr.dlightImage = R_CreateImage("_dlightImage", nullptr, w, h, 4, imageParams );
}
Expand Down Expand Up @@ -2466,10 +2470,12 @@ static void R_CreateDepthRenderImage()
int h = (height + TILE_SIZE_STEP1 - 1) >> TILE_SHIFT_STEP1;

imageParams_t imageParams = {};
imageParams.bits = IF_NOPICMIP | IF_RGBA32F;
imageParams.filterType = filterType_t::FT_NEAREST;
imageParams.wrapType = wrapTypeEnum_t::WT_ONE_CLAMP;

imageParams.bits = IF_NOPICMIP;
imageParams.bits |= r_highPrecisionRendering.Get() ? IF_RGBA32F : IF_RGBA16F;

tr.depthtile1RenderImage = R_CreateImage( "_depthtile1Render", nullptr, w, h, 1, imageParams );

w = (width + TILE_SIZE - 1) >> TILE_SHIFT;
Expand All @@ -2479,18 +2485,14 @@ static void R_CreateDepthRenderImage()

tr.depthtile2RenderImage = R_CreateImage( "_depthtile2Render", nullptr, w, h, 1, imageParams );

if ( glConfig2.textureIntegerAvailable )
{
imageParams.bits = IF_NOPICMIP | IF_RGBA32UI;
imageParams.bits = IF_NOPICMIP;

tr.lighttileRenderImage = R_Create3DImage( "_lighttileRender", nullptr, w, h, 4, imageParams );
}
else
if ( glConfig2.textureIntegerAvailable && r_highPrecisionRendering.Get() )
{
imageParams.bits = IF_NOPICMIP;

tr.lighttileRenderImage = R_Create3DImage( "_lighttileRender", nullptr, w, h, 4, imageParams );
imageParams.bits |= IF_RGBA32UI;
}

tr.lighttileRenderImage = R_Create3DImage( "_lighttileRender", nullptr, w, h, 4, imageParams );
}
}

Expand Down Expand Up @@ -2540,6 +2542,7 @@ static void R_CreateShadowMapFBOImage()
int numFactor = 1;
int format = IF_NOPICMIP;

// FIXME: We should test if those formats are supported.
switch( glConfig2.shadowingMode )
{
case shadowingMode_t::SHADOWING_ESM16:
Expand Down Expand Up @@ -2623,6 +2626,7 @@ static void R_CreateShadowCubeFBOImage()

int format = IF_NOPICMIP;

// FIXME: We should test if those formats are supported.
switch( glConfig2.shadowingMode )
{
case shadowingMode_t::SHADOWING_ESM16:
Expand Down

0 comments on commit 6a87f2e

Please sign in to comment.