Skip to content
Merged
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
12 changes: 12 additions & 0 deletions Dependencies/OpenGL/Gl46.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14444,6 +14444,14 @@ public static void glSpecializeShader(GLuint shader, string pEntryPoint, GLuint

#endif

public const GLenum GL_COMPLETION_STATUS_KHR = 0x91B1;

[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate void PFNGLMAXSHADERCOMPILERTHREADSKHRPROC(GLuint count);
private static PFNGLMAXSHADERCOMPILERTHREADSKHRPROC _glMaxShaderCompilerThreadsKHR;
public static bool glMaxShaderCompilerThreadsKHRLoaded => _glMaxShaderCompilerThreadsKHR != null;
public static void glMaxShaderCompilerThreadsKHR(GLuint count) => _glMaxShaderCompilerThreadsKHR(count);

/// <summary>
/// Loads OpenGL functions using the specified loader delegate.
/// </summary>
Expand Down Expand Up @@ -15144,6 +15152,10 @@ public unsafe static void Import(GetProcAddressHandler loader)
_glMultiDrawElementsIndirectCount = Marshal.GetDelegateForFunctionPointer<PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC>(loader.Invoke("glMultiDrawElementsIndirectCount"));
_glPolygonOffsetClamp = Marshal.GetDelegateForFunctionPointer<PFNGLPOLYGONOFFSETCLAMPPROC>(loader.Invoke("glPolygonOffsetClamp"));
#endif
IntPtr maxShaderCompilerThreads = loader.Invoke("glMaxShaderCompilerThreadsKHR");
if (maxShaderCompilerThreads == IntPtr.Zero)
maxShaderCompilerThreads = loader.Invoke("glMaxShaderCompilerThreadsARB");
_glMaxShaderCompilerThreadsKHR = maxShaderCompilerThreads != IntPtr.Zero ? Marshal.GetDelegateForFunctionPointer<PFNGLMAXSHADERCOMPILERTHREADSKHRPROC>(maxShaderCompilerThreads) : null!;
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion Game.Assets/sdn/shaders/bloomadd_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#version 460

in vec2 vs_BaseTexCoord;
layout(location = 0) in vec2 vs_BaseTexCoord;

layout(std140, binding = 3) uniform source_pixel_sharedUBO {
bool isAlphaTesting;
Expand Down
14 changes: 7 additions & 7 deletions Game.Assets/sdn/shaders/blurfilter_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#version 460

in vec2 vs_CoordTap0;
in vec2 vs_CoordTap1;
in vec2 vs_CoordTap2;
in vec2 vs_CoordTap3;
in vec2 vs_CoordTap1Neg;
in vec2 vs_CoordTap2Neg;
in vec2 vs_CoordTap3Neg;
layout(location = 0) in vec2 vs_CoordTap0;
layout(location = 1) in vec2 vs_CoordTap1;
layout(location = 2) in vec2 vs_CoordTap2;
layout(location = 3) in vec2 vs_CoordTap3;
layout(location = 4) in vec2 vs_CoordTap1Neg;
layout(location = 5) in vec2 vs_CoordTap2Neg;
layout(location = 6) in vec2 vs_CoordTap3Neg;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
14 changes: 7 additions & 7 deletions Game.Assets/sdn/shaders/blurfilter_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ layout(std140, binding = 5) uniform source_vs_constants {
#define vsTapOffs1 vs_const[49].xy
#define vsTapOffs2 vs_const[50].xy

out vec2 vs_CoordTap0;
out vec2 vs_CoordTap1;
out vec2 vs_CoordTap2;
out vec2 vs_CoordTap3;
out vec2 vs_CoordTap1Neg;
out vec2 vs_CoordTap2Neg;
out vec2 vs_CoordTap3Neg;
layout(location = 0) out vec2 vs_CoordTap0;
layout(location = 1) out vec2 vs_CoordTap1;
layout(location = 2) out vec2 vs_CoordTap2;
layout(location = 3) out vec2 vs_CoordTap3;
layout(location = 4) out vec2 vs_CoordTap1Neg;
layout(location = 5) out vec2 vs_CoordTap2Neg;
layout(location = 6) out vec2 vs_CoordTap3Neg;

vec2 FlipV(vec2 uv)
{
Expand Down
5 changes: 5 additions & 0 deletions Game.Assets/sdn/shaders/common_clipplanes_gl460.vs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#ifndef COMMON_CLIPPLANES_GL460_VS
#define COMMON_CLIPPLANES_GL460_VS

out gl_PerVertex {
vec4 gl_Position;
float gl_ClipDistance[2];
};

layout(std140, binding = 7) uniform source_clip_planes {
vec4 clipPlanes[2];
};
Expand Down
8 changes: 4 additions & 4 deletions Game.Assets/sdn/shaders/downsample_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ layout(std140, binding = 5) uniform source_vs_constants {
#define vsTapOffs2 vs_const[50].xy
#define vsTapOffs3 vs_const[51].xy

out vec2 vs_CoordTap0;
out vec2 vs_CoordTap1;
out vec2 vs_CoordTap2;
out vec2 vs_CoordTap3;
layout(location = 0) out vec2 vs_CoordTap0;
layout(location = 1) out vec2 vs_CoordTap1;
layout(location = 2) out vec2 vs_CoordTap2;
layout(location = 3) out vec2 vs_CoordTap3;

vec2 FlipV(vec2 uv)
{
Expand Down
8 changes: 4 additions & 4 deletions Game.Assets/sdn/shaders/downsample_nohdr_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#version 460
// STATIC: "CSTRIKE" "0..1"

in vec2 vs_CoordTap0;
in vec2 vs_CoordTap1;
in vec2 vs_CoordTap2;
in vec2 vs_CoordTap3;
layout(location = 0) in vec2 vs_CoordTap0;
layout(location = 1) in vec2 vs_CoordTap1;
layout(location = 2) in vec2 vs_CoordTap2;
layout(location = 3) in vec2 vs_CoordTap3;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
6 changes: 3 additions & 3 deletions Game.Assets/sdn/shaders/eyeglint_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#version 460

in vec2 vs_TexCoord;
in vec2 vs_GlintCenter;
in vec3 vs_GlintColor;
layout(location = 0) in vec2 vs_TexCoord;
layout(location = 1) in vec2 vs_GlintCenter;
layout(location = 2) in vec3 vs_GlintColor;

out vec4 fragColor;

Expand Down
6 changes: 3 additions & 3 deletions Game.Assets/sdn/shaders/eyeglint_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ layout(location = 10) in vec2 v_TexCoord0;
layout(location = 11) in vec2 v_TexCoord1;
layout(location = 12) in vec3 v_TexCoord2;

out vec2 vs_TexCoord;
out vec2 vs_GlintCenter;
out vec3 vs_GlintColor;
layout(location = 0) out vec2 vs_TexCoord;
layout(location = 1) out vec2 vs_GlintCenter;
layout(location = 2) out vec3 vs_GlintColor;

#include "common_clipplanes_gl460.vs"

Expand Down
10 changes: 5 additions & 5 deletions Game.Assets/sdn/shaders/eyes_gl460.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1"
// DYNAMIC: "PIXELFOGTYPE" "0..2"

in vec2 vs_BaseTexCoord;
in vec2 vs_IrisTexCoord;
in vec2 vs_GlintTexCoord;
in vec3 vs_Color;
in vec4 vs_WorldPos_ProjPosZ;
layout(location = 0) in vec2 vs_BaseTexCoord;
layout(location = 1) in vec2 vs_IrisTexCoord;
layout(location = 2) in vec2 vs_GlintTexCoord;
layout(location = 3) in vec3 vs_Color;
layout(location = 4) in vec4 vs_WorldPos_ProjPosZ;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
10 changes: 5 additions & 5 deletions Game.Assets/sdn/shaders/eyes_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ const bool g_bHalfLambert = HALFLAMBERT != 0;
#define modelOrigin const4.xyz
#endif

out vec2 vs_BaseTexCoord;
out vec2 vs_IrisTexCoord;
out vec2 vs_GlintTexCoord;
out vec3 vs_Color;
out vec4 vs_WorldPos_ProjPosZ;
layout(location = 0) out vec2 vs_BaseTexCoord;
layout(location = 1) out vec2 vs_IrisTexCoord;
layout(location = 2) out vec2 vs_GlintTexCoord;
layout(location = 3) out vec3 vs_Color;
layout(location = 4) out vec4 vs_WorldPos_ProjPosZ;

#include "common_clipplanes_gl460.vs"

Expand Down
2 changes: 1 addition & 1 deletion Game.Assets/sdn/shaders/introscreenspaceeffect_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#version 460
// DYNAMIC: "MODE" "0..9"

in vec2 vs_BaseTexCoord;
layout(location = 0) in vec2 vs_BaseTexCoord;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
20 changes: 10 additions & 10 deletions Game.Assets/sdn/shaders/lightmappedgeneric_gl460.fs
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
// DYNAMIC: "LIGHTING_PREVIEW" "0..1"

#if SEAMLESS
in vec3 vs_SeamlessTexCoord; // zy xz
in vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord; // envmap mask
layout(location = 0) in vec3 vs_SeamlessTexCoord; // zy xz
layout(location = 1) in vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord; // envmap mask
#else
in vec2 vs_BaseTexCoord;
layout(location = 2) in vec2 vs_BaseTexCoord;
// detail textures and bumpmaps are mutually exclusive so that we have enough texcoords.
in vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord;
layout(location = 1) in vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord;
#endif
centroid in vec4 vs_LightmapTexCoord1And2;
centroid in vec4 vs_LightmapTexCoord3;
in vec4 vs_WorldPos_ProjPosZ;
layout(location = 3) centroid in vec4 vs_LightmapTexCoord1And2;
layout(location = 4) centroid in vec4 vs_LightmapTexCoord3;
layout(location = 5) in vec4 vs_WorldPos_ProjPosZ;
#if CUBEMAP || (LIGHTING_PREVIEW)
in mat3 vs_TangentSpaceTranspose;
layout(location = 6) in mat3 vs_TangentSpaceTranspose;
#endif
in vec4 vs_Color;
in float vs_VertexBlendX;
layout(location = 9) in vec4 vs_Color;
layout(location = 10) in float vs_VertexBlendX;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
20 changes: 10 additions & 10 deletions Game.Assets/sdn/shaders/lightmappedgeneric_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,23 @@ const bool g_bVertexAlphaTexBlendFactor = VERTEXALPHATEXBLENDFACTOR != 0;
const bool g_BumpMask = BUMPMASK != 0;

#if SEAMLESS
out vec3 vs_SeamlessTexCoord; // x y z
out vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord; // envmap mask
layout(location = 0) out vec3 vs_SeamlessTexCoord; // x y z
layout(location = 1) out vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord; // envmap mask
#else
out vec2 vs_BaseTexCoord;
layout(location = 2) out vec2 vs_BaseTexCoord;
// detail textures and bumpmaps are mutually exclusive so that we have enough texcoords.
out vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord;
layout(location = 1) out vec4 vs_DetailOrBumpAndEnvmapMaskTexCoord;
#endif
centroid out vec4 vs_LightmapTexCoord1And2;
centroid out vec4 vs_LightmapTexCoord3; // and basetexcoord*mask_scale
out vec4 vs_WorldPos_ProjPosZ;
layout(location = 3) centroid out vec4 vs_LightmapTexCoord1And2;
layout(location = 4) centroid out vec4 vs_LightmapTexCoord3; // and basetexcoord*mask_scale
layout(location = 5) out vec4 vs_WorldPos_ProjPosZ;

#if TANGENTSPACE || (LIGHTING_PREVIEW)
out mat3 vs_TangentSpaceTranspose;
layout(location = 6) out mat3 vs_TangentSpaceTranspose;
#endif

out vec4 vs_Color; // in seamless, r g b = blend weights
out float vs_VertexBlendX;
layout(location = 9) out vec4 vs_Color; // in seamless, r g b = blend weights
layout(location = 10) out float vs_VertexBlendX;

#include "common_clipplanes_gl460.vs"

Expand Down
2 changes: 1 addition & 1 deletion Game.Assets/sdn/shaders/luminance_compare_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#version 460

in vec2 vs_BaseTexCoord;
layout(location = 0) in vec2 vs_BaseTexCoord;

layout(std140, binding = 3) uniform source_pixel_sharedUBO {
bool isAlphaTesting;
Expand Down
10 changes: 5 additions & 5 deletions Game.Assets/sdn/shaders/screenspaceeffect_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ layout(std140, binding = 0) uniform source_matrices {
mat4 modelMatrix;
};

out vec2 vs_BaseTexCoord;
out vec4 vs_TexCoord0;
out vec4 vs_TexCoord1;
out vec4 vs_TexCoord2;
out vec4 vs_Color0;
layout(location = 0) out vec2 vs_BaseTexCoord;
layout(location = 1) out vec4 vs_TexCoord0;
layout(location = 2) out vec4 vs_TexCoord1;
layout(location = 3) out vec4 vs_TexCoord2;
layout(location = 4) out vec4 vs_Color0;

#include "common_clipplanes_gl460.vs"

Expand Down
12 changes: 6 additions & 6 deletions Game.Assets/sdn/shaders/shadow_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#version 460

centroid in vec2 vs_TexCoord0;
centroid in vec2 vs_TexCoord1;
centroid in vec2 vs_TexCoord2;
centroid in vec2 vs_TexCoord3;
centroid in vec2 vs_TexCoord4;
in vec4 vs_ShadowColor;
layout(location = 0) centroid in vec2 vs_TexCoord0;
layout(location = 1) centroid in vec2 vs_TexCoord1;
layout(location = 2) centroid in vec2 vs_TexCoord2;
layout(location = 3) centroid in vec2 vs_TexCoord3;
layout(location = 4) centroid in vec2 vs_TexCoord4;
layout(location = 5) in vec4 vs_ShadowColor;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
12 changes: 6 additions & 6 deletions Game.Assets/sdn/shaders/shadow_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ layout(std140, binding = 5) uniform source_vs_constants {
#define cTextureJitter0 vs_const[50]
#define cTextureJitter1 vs_const[51]

centroid out vec2 vs_TexCoord0;
centroid out vec2 vs_TexCoord1;
centroid out vec2 vs_TexCoord2;
centroid out vec2 vs_TexCoord3;
centroid out vec2 vs_TexCoord4;
out vec4 vs_ShadowColor;
layout(location = 0) centroid out vec2 vs_TexCoord0;
layout(location = 1) centroid out vec2 vs_TexCoord1;
layout(location = 2) centroid out vec2 vs_TexCoord2;
layout(location = 3) centroid out vec2 vs_TexCoord3;
layout(location = 4) centroid out vec2 vs_TexCoord4;
layout(location = 5) out vec4 vs_ShadowColor;

#include "common_clipplanes_gl460.vs"

Expand Down
10 changes: 5 additions & 5 deletions Game.Assets/sdn/shaders/shadowmodel_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#version 460

in vec3 vs_T0;
in vec3 vs_T1;
in vec3 vs_T2;
in float vs_T3;
in vec4 vs_Color;
layout(location = 0) in vec3 vs_T0;
layout(location = 1) in vec3 vs_T1;
layout(location = 2) in vec3 vs_T2;
layout(location = 3) in float vs_T3;
layout(location = 4) in vec4 vs_Color;

layout(binding = 0) uniform sampler2D basetexture;

Expand Down
10 changes: 5 additions & 5 deletions Game.Assets/sdn/shaders/shadowmodel_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ layout(std140, binding = 5) uniform source_vs_constants {
#define flOneOverShadowDist cShadowConstants.y
#define flShadowScale cShadowConstants.z

out vec3 vs_T0;
out vec3 vs_T1;
out vec3 vs_T2;
out float vs_T3;
out vec4 vs_Color;
layout(location = 0) out vec3 vs_T0;
layout(location = 1) out vec3 vs_T1;
layout(location = 2) out vec3 vs_T2;
layout(location = 3) out float vs_T3;
layout(location = 4) out vec4 vs_Color;

#include "common_clipplanes_gl460.vs"

Expand Down
12 changes: 6 additions & 6 deletions Game.Assets/sdn/shaders/skin_gl460.fs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1"
// DYNAMIC: "FLASHLIGHTSHADOWS" "0..1"

in vec4 vs_BaseTexCoord; // xy=base zw=detail
in vec3 vs_LightAtten; // Scalar light attenuation factors for FOUR lights
in vec3 vs_WorldVertToEyeVector;
in mat3 vs_TangentSpaceTranspose;
in vec4 vs_WorldPos_Atten3;
in vec4 vs_ProjPos_WrinkleWeight;
layout(location = 0) in vec4 vs_BaseTexCoord; // xy=base zw=detail
layout(location = 1) in vec3 vs_LightAtten; // Scalar light attenuation factors for FOUR lights
layout(location = 2) in vec3 vs_WorldVertToEyeVector;
layout(location = 3) in mat3 vs_TangentSpaceTranspose;
layout(location = 6) in vec4 vs_WorldPos_Atten3;
layout(location = 7) in vec4 vs_ProjPos_WrinkleWeight;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
12 changes: 6 additions & 6 deletions Game.Assets/sdn/shaders/skin_gl460.vs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ const int SHADER_SPECIFIC_CONST_4 = 52;

const bool g_bSkinning = SKINNING != 0;

out vec4 vs_BaseTexCoord; // includes detail tex coord
out vec3 vs_LightAtten;
out vec3 vs_WorldVertToEyeVector;
out mat3 vs_TangentSpaceTranspose;
out vec4 vs_WorldPos_Atten3;
out vec4 vs_ProjPos_WrinkleWeight;
layout(location = 0) out vec4 vs_BaseTexCoord; // includes detail tex coord
layout(location = 1) out vec3 vs_LightAtten;
layout(location = 2) out vec3 vs_WorldVertToEyeVector;
layout(location = 3) out mat3 vs_TangentSpaceTranspose;
layout(location = 6) out vec4 vs_WorldPos_Atten3;
layout(location = 7) out vec4 vs_ProjPos_WrinkleWeight;

//-----------------------------------------------------------------------------
// Main shader entry point
Expand Down
2 changes: 1 addition & 1 deletion Game.Assets/sdn/shaders/sky_gl460.fs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#version 460
// DYNAMIC: "WRITE_DEPTH_TO_DESTALPHA" "0..1"

in vec2 vs_BaseTexCoord00;
layout(location = 0) in vec2 vs_BaseTexCoord00;

layout(std140, binding = 6) uniform source_ps_constants {
vec4 ps_const[256];
Expand Down
Loading
Loading