mirror of
https://github.com/OldUnreal/XOpenGLDrv.git
synced 2026-07-15 17:09:11 -07:00
Updated to latest 227 repo version
This commit is contained in:
+25
-4
@@ -119,7 +119,7 @@
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(KHRONOS_STATIC)
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
@@ -153,6 +153,20 @@ typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
@@ -235,14 +249,21 @@ typedef unsigned short int khronos_uint16_t;
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
#ifdef KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -287,7 +287,7 @@ void UXOpenGLRenderDevice::InitShaders()
|
||||
//Global texture handles for bindless.
|
||||
if (UsingBindlessTextures)
|
||||
{
|
||||
GetUniformBlockIndex(DrawSimpleProg, GlobalUniformTextureHandlesIndex, GlobalTextureHandlesBindingIndex, "TextureHandles", TEXT("DrawSimpleProg"));
|
||||
//GetUniformBlockIndex(DrawSimpleProg, GlobalUniformTextureHandlesIndex, GlobalTextureHandlesBindingIndex, "TextureHandles", TEXT("DrawSimpleProg")); //not needed for DrawSimple
|
||||
GetUniformBlockIndex(DrawTileProg, GlobalUniformTextureHandlesIndex, GlobalTextureHandlesBindingIndex, "TextureHandles", TEXT("DrawTileProg"));
|
||||
GetUniformBlockIndex(DrawComplexProg, GlobalUniformTextureHandlesIndex, GlobalTextureHandlesBindingIndex, "TextureHandles", TEXT("DrawComplexProg"));
|
||||
GetUniformBlockIndex(DrawGouraudProg, GlobalUniformTextureHandlesIndex, GlobalTextureHandlesBindingIndex, "TextureHandles", TEXT("DrawGouraudProg"));
|
||||
|
||||
+3
-4
@@ -9,7 +9,7 @@
|
||||
=============================================================================*/
|
||||
|
||||
// Enables CHECK_GL_ERROR(). Deprecated, should use UseOpenGLDebug=True instead, but still may be handy to track something specific down.
|
||||
//#define DEBUGGL 1
|
||||
// #define DEBUGGL 1
|
||||
|
||||
// Maybe for future release. Not in use yet.
|
||||
// #define QTBUILD 1
|
||||
@@ -524,7 +524,6 @@ class UXOpenGLRenderDevice : public URenderDevice
|
||||
INT DetailMax;
|
||||
FLOAT GammaMultiplier;
|
||||
FLOAT GammaMultiplierUED;
|
||||
INT MaxTextureImageUnits;
|
||||
|
||||
// Config
|
||||
BITFIELD NoFiltering;
|
||||
@@ -533,6 +532,7 @@ class UXOpenGLRenderDevice : public URenderDevice
|
||||
BITFIELD UsePrecache;
|
||||
BITFIELD UseTrilinear;
|
||||
BITFIELD UseAA;
|
||||
BITFIELD UseAASmoothing;
|
||||
BITFIELD GammaCorrectScreenshots;
|
||||
BITFIELD MacroTextures;
|
||||
BITFIELD BumpMaps;
|
||||
@@ -573,6 +573,7 @@ class UXOpenGLRenderDevice : public URenderDevice
|
||||
bool NVIDIAMemoryInfo;
|
||||
bool SwapControlExt;
|
||||
bool SwapControlTearExt;
|
||||
bool Compression_s3tcExt;
|
||||
|
||||
INT MaxBindlessTextures;
|
||||
|
||||
@@ -619,9 +620,7 @@ class UXOpenGLRenderDevice : public URenderDevice
|
||||
FLOAT UPan;
|
||||
FLOAT VPan;
|
||||
INT TexNum;
|
||||
#if UNREAL_TOURNAMENT_OLDUNREAL
|
||||
INT RealTimeChangeCount{};
|
||||
#endif
|
||||
FTexInfo()
|
||||
:CurrentCacheID(0),
|
||||
CurrentCacheSlot(0),
|
||||
|
||||
Regular → Executable
Regular → Executable
+200
-14440
File diff suppressed because one or more lines are too long
Regular → Executable
+18952
-1478
File diff suppressed because one or more lines are too long
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
+54
-53
@@ -21,13 +21,13 @@ const uint IDX_Y_AXIS = 11u;
|
||||
const uint IDX_Z_AXIS = 12u;
|
||||
const uint IDX_DRAWCOLOR = 13u;
|
||||
const uint IDX_DISTANCE_FOG_COLOR = 14u;
|
||||
const uint IDX_DISTANCE_FOG_INFO = 15u;
|
||||
|
||||
#if BINDLESSTEXTURES
|
||||
layout(std140) uniform TextureHandles
|
||||
{
|
||||
sampler2D Textures[NUMTEXTURES];
|
||||
};
|
||||
const uint IDX_DISTANCE_FOG_INFO = 15u;
|
||||
|
||||
#if BINDLESSTEXTURES
|
||||
layout(std140) uniform TextureHandles
|
||||
{
|
||||
layout(bindless_sampler) sampler2D Textures[NUMTEXTURES];
|
||||
};
|
||||
#endif
|
||||
|
||||
uniform sampler2D Texture0; //Base Texture
|
||||
@@ -566,23 +566,23 @@ void main (void)
|
||||
// DetailTextures
|
||||
#if DETAILTEXTURES
|
||||
if (((vDrawFlags & DF_DetailTexture) == DF_DetailTexture))
|
||||
{
|
||||
float NearZ = vCoords.z/512.0;
|
||||
float DetailScale = 1.0;
|
||||
{
|
||||
float NearZ = vCoords.z/512.0;
|
||||
float DetailScale = 1.0;
|
||||
float bNear;
|
||||
vec4 DetailTexColor;
|
||||
vec3 hsvDetailTex;
|
||||
|
||||
for(int i=0; i < DetailMax; ++i)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
NearZ *= 4.223f;
|
||||
DetailScale *= 4.223f;
|
||||
}
|
||||
bNear = clamp(0.65-NearZ,0.0,1.0);
|
||||
|
||||
if (bNear > 0.0)
|
||||
vec4 DetailTexColor;
|
||||
vec3 hsvDetailTex;
|
||||
|
||||
for(int i=0; i < DetailMax; ++i)
|
||||
{
|
||||
if (i > 0)
|
||||
{
|
||||
NearZ *= 4.223f;
|
||||
DetailScale *= 4.223f;
|
||||
}
|
||||
bNear = clamp(0.65-NearZ,0.0,1.0);
|
||||
|
||||
if (bNear > 0.0)
|
||||
{
|
||||
# if BINDLESSTEXTURES
|
||||
if (vDetailTexNum > 0u)
|
||||
@@ -598,8 +598,8 @@ void main (void)
|
||||
DetailTexColor=vec4(hsvDetailTex,0.0);
|
||||
DetailTexColor = mix(vec4(1.0,1.0,1.0,1.0), DetailTexColor, bNear); //fading out.
|
||||
|
||||
TotalColor.rgb*=DetailTexColor.rgb;
|
||||
}
|
||||
TotalColor.rgb*=DetailTexColor.rgb;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -656,9 +656,9 @@ void main (void)
|
||||
vec3 CurrentLightColor = vec3(LightData1[i].x,LightData1[i].y,LightData1[i].z);
|
||||
|
||||
float NormalLightRadius = LightData5[i].x;
|
||||
bool bZoneNormalLight = bool(LightData5[i].y);
|
||||
float LightBrightness = LightData5[i].z/255.0; // use LightBrightness to adjust specular reflection.
|
||||
|
||||
bool bZoneNormalLight = bool(LightData5[i].y);
|
||||
float LightBrightness = LightData5[i].z/255.0; // use LightBrightness to adjust specular reflection.
|
||||
|
||||
if (NormalLightRadius == 0.0)
|
||||
NormalLightRadius = LightData2[i].w * 64.0;
|
||||
|
||||
@@ -745,13 +745,14 @@ void main (void)
|
||||
// Add DistanceFog
|
||||
#if ENGINE_VERSION==227
|
||||
// stijn: Very slow! Went from 135 to 155FPS on CTF-BT-CallousV3 by just disabling this branch even tho 469 doesn't do distance fog
|
||||
if (vDistanceFogInfo.w >= 0.0)
|
||||
int FogMode = int(vDistanceFogInfo.w);
|
||||
if (FogMode >= 0)
|
||||
{
|
||||
FogParameters DistanceFogParams;
|
||||
DistanceFogParams.FogStart = vDistanceFogInfo.x;
|
||||
DistanceFogParams.FogEnd = vDistanceFogInfo.y;
|
||||
DistanceFogParams.FogDensity = vDistanceFogInfo.z;
|
||||
DistanceFogParams.FogMode = int(vDistanceFogInfo.w);
|
||||
DistanceFogParams.FogMode = FogMode;
|
||||
|
||||
if ( (vPolyFlags&PF_Modulated) == PF_Modulated )
|
||||
DistanceFogParams.FogColor = vec4(0.5,0.5,0.5,0.0);
|
||||
@@ -765,20 +766,20 @@ void main (void)
|
||||
#endif
|
||||
|
||||
if((vPolyFlags & PF_Modulated)!=PF_Modulated)
|
||||
{
|
||||
#if EDITOR
|
||||
// Gamma
|
||||
float InGamma = vGamma*GammaMultiplierUED;
|
||||
TotalColor.r=pow(TotalColor.r,1.0/InGamma);
|
||||
TotalColor.g=pow(TotalColor.g,1.0/InGamma);
|
||||
TotalColor.b=pow(TotalColor.b,1.0/InGamma);
|
||||
#else
|
||||
// Gamma
|
||||
float InGamma = vGamma*GammaMultiplier; // vGamma is a value from 0.1 to 1.0
|
||||
TotalColor.r=pow(TotalColor.r,1.0/InGamma);
|
||||
TotalColor.g=pow(TotalColor.g,1.0/InGamma);
|
||||
TotalColor.b=pow(TotalColor.b,1.0/InGamma);
|
||||
#endif
|
||||
{
|
||||
#if EDITOR
|
||||
// Gamma
|
||||
float InGamma = vGamma*GammaMultiplierUED;
|
||||
TotalColor.r=pow(TotalColor.r,1.0/InGamma);
|
||||
TotalColor.g=pow(TotalColor.g,1.0/InGamma);
|
||||
TotalColor.b=pow(TotalColor.b,1.0/InGamma);
|
||||
#else
|
||||
// Gamma
|
||||
float InGamma = vGamma*GammaMultiplier; // vGamma is a value from 0.1 to 1.0
|
||||
TotalColor.r=pow(TotalColor.r,1.0/InGamma);
|
||||
TotalColor.g=pow(TotalColor.g,1.0/InGamma);
|
||||
TotalColor.b=pow(TotalColor.b,1.0/InGamma);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if EDITOR
|
||||
@@ -826,15 +827,15 @@ void main (void)
|
||||
#endif
|
||||
|
||||
# if SIMULATEMULTIPASS
|
||||
if((vPolyFlags & PF_Modulated) == PF_Modulated)
|
||||
{
|
||||
FragColor = TotalColor;
|
||||
FragColor1 = (vec4(1.0,1.0,1.0,1.0)-TotalColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor = TotalColor;
|
||||
FragColor1 = (vec4(1.0,1.0,1.0,1.0)-TotalColor)*LightColor;
|
||||
if((vPolyFlags & PF_Modulated) == PF_Modulated)
|
||||
{
|
||||
FragColor = TotalColor;
|
||||
FragColor1 = (vec4(1.0,1.0,1.0,1.0)-TotalColor);
|
||||
}
|
||||
else
|
||||
{
|
||||
FragColor = TotalColor;
|
||||
FragColor1 = (vec4(1.0,1.0,1.0,1.0)-TotalColor)*LightColor;
|
||||
}
|
||||
#else
|
||||
FragColor = TotalColor;
|
||||
|
||||
Regular → Executable
Regular → Executable
+3
-3
@@ -217,15 +217,15 @@ void main(void)
|
||||
# if BINDLESSTEXTURES
|
||||
if (gDetailTexNum > 0u)
|
||||
DetailTexColor = texture(Textures[gDetailTexNum], gDetailTexCoords * DetailScale);
|
||||
else DetailTexColor = texture(Texture3, gDetailTexCoords * DetailScale);
|
||||
else DetailTexColor = texture(Texture1, gDetailTexCoords * DetailScale);
|
||||
# else
|
||||
DetailTexColor = texture(Texture3, gDetailTexCoords * DetailScale);
|
||||
DetailTexColor = texture(Texture1, gDetailTexCoords * DetailScale);
|
||||
# endif
|
||||
|
||||
vec3 hsvDetailTex = rgb2hsv(DetailTexColor.rgb); // cool idea Han :)
|
||||
hsvDetailTex.b += (DetailTexColor.r - 0.1);
|
||||
hsvDetailTex = hsv2rgb(hsvDetailTex);
|
||||
DetailTexColor=vec4(hsvDetailTex,0.0);
|
||||
DetailTexColor = vec4(hsvDetailTex,0.0);
|
||||
DetailTexColor = mix(vec4(1.0,1.0,1.0,1.0), DetailTexColor, bNear); //fading out.
|
||||
|
||||
TotalColor.rgb*=DetailTexColor.rgb;
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
+8
-9
@@ -33,19 +33,18 @@ void main(void)
|
||||
{
|
||||
vec4 TotalColor = DrawColor;
|
||||
|
||||
if (bHitTesting)
|
||||
TotalColor = DrawColor; // Use (still) DrawColor. Maybe needed later. Nonsense now.
|
||||
|
||||
if ( (LineFlags&LINE_Transparent)==LINE_Transparent )
|
||||
{
|
||||
}
|
||||
#if EDITOR
|
||||
TotalColor.rgb=clamp(TotalColor.rgb*1.2,0.0,0.8);
|
||||
// Gamma
|
||||
float InGamma = Gamma*GammaMultiplierUED;
|
||||
TotalColor.r=pow(TotalColor.r,1.0/InGamma);
|
||||
TotalColor.g=pow(TotalColor.g,1.0/InGamma);
|
||||
TotalColor.b=pow(TotalColor.b,1.0/InGamma);
|
||||
if (!bHitTesting)
|
||||
{
|
||||
// Gamma
|
||||
float InGamma = Gamma*GammaMultiplierUED;
|
||||
TotalColor.r=pow(TotalColor.r,1.0/InGamma);
|
||||
TotalColor.g=pow(TotalColor.g,1.0/InGamma);
|
||||
TotalColor.b=pow(TotalColor.b,1.0/InGamma);
|
||||
}
|
||||
#else
|
||||
// Gamma
|
||||
float InGamma = Gamma*GammaMultiplier;
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user