- [Mac] Lower shader uniform count

This commit is contained in:
Tanasart 2024-09-10 10:40:05 +07:00
parent de76e2cf0b
commit 9191946443
24 changed files with 134 additions and 27 deletions

View file

@ -5,7 +5,11 @@ uniform float tolerance;
uniform int useMask; uniform int useMask;
uniform sampler2D mask; uniform sampler2D mask;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform vec4 colorTarget[PALETTE_LIMIT]; uniform vec4 colorTarget[PALETTE_LIMIT];
uniform int colorTargetAmount; uniform int colorTargetAmount;

View file

@ -4,7 +4,11 @@ varying vec4 v_vColour;
uniform float seed; uniform float seed;
uniform float ratio; uniform float ratio;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform int usePalette; uniform int usePalette;
uniform vec4 palette[PALETTE_LIMIT]; uniform vec4 palette[PALETTE_LIMIT];

View file

@ -1,5 +1,11 @@
#define CURVE_MAX 512
#define MAX_POINTS 256 #ifdef _YY_HLSL11_
#define CURVE_MAX 1024
#define MAX_POINTS 256
#else
#define CURVE_MAX 256
#define MAX_POINTS 128
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -5,7 +5,11 @@ varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
uniform float hue; uniform float hue;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform int usePalette; uniform int usePalette;
uniform vec4 palette[PALETTE_LIMIT]; uniform vec4 palette[PALETTE_LIMIT];

View file

@ -4,7 +4,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform float sat; uniform float sat;
uniform float value; uniform float value;

View file

@ -4,7 +4,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform float hue; uniform float hue;
uniform float sat; uniform float sat;

View file

@ -4,7 +4,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform float value; uniform float value;

View file

@ -1,4 +1,8 @@
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
// //
// Simple passthrough fragment shader // Simple passthrough fragment shader
// //

View file

@ -1,4 +1,8 @@
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
// //
// Simple passthrough fragment shader // Simple passthrough fragment shader
// //

View file

@ -1,4 +1,8 @@
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
// //
// Simple passthrough fragment shader // Simple passthrough fragment shader
// //

View file

@ -1,4 +1,9 @@
#define CURVE_MAX 512
#ifdef _YY_HLSL11_
#define CURVE_MAX 1024
#else
#define CURVE_MAX 256
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -1,4 +1,9 @@
#define CURVE_MAX 512
#ifdef _YY_HLSL11_
#define CURVE_MAX 1024
#else
#define CURVE_MAX 256
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -17,7 +17,16 @@ uniform int use_8bit;
uniform vec4 light_ambient; uniform vec4 light_ambient;
uniform float shadowBias; uniform float shadowBias;
#define LIGHT_DIR_LIMIT 16 #ifdef _YY_HLSL11_
#define LIGHT_DIR_LIMIT 16
#define LIGHT_PNT_LIMIT 16
#define LIGHT_PNT_LIMIT6 16*6
#else
#define LIGHT_DIR_LIMIT 8
#define LIGHT_PNT_LIMIT 8
#define LIGHT_PNT_LIMIT6 8*6
#endif
uniform int light_dir_count; uniform int light_dir_count;
uniform vec3 light_dir_direction[LIGHT_DIR_LIMIT]; uniform vec3 light_dir_direction[LIGHT_DIR_LIMIT];
uniform vec4 light_dir_color[LIGHT_DIR_LIMIT]; uniform vec4 light_dir_color[LIGHT_DIR_LIMIT];
@ -32,14 +41,13 @@ uniform int use_8bit;
//uniform sampler2D light_dir_shadowmap_2; //uniform sampler2D light_dir_shadowmap_2;
//uniform sampler2D light_dir_shadowmap_3; //uniform sampler2D light_dir_shadowmap_3;
#define LIGHT_PNT_LIMIT 16
uniform int light_pnt_count; uniform int light_pnt_count;
uniform vec3 light_pnt_position[LIGHT_PNT_LIMIT]; uniform vec3 light_pnt_position[LIGHT_PNT_LIMIT];
uniform vec4 light_pnt_color[LIGHT_PNT_LIMIT]; uniform vec4 light_pnt_color[LIGHT_PNT_LIMIT];
uniform float light_pnt_intensity[LIGHT_PNT_LIMIT]; uniform float light_pnt_intensity[LIGHT_PNT_LIMIT];
uniform float light_pnt_radius[LIGHT_PNT_LIMIT]; uniform float light_pnt_radius[LIGHT_PNT_LIMIT];
uniform mat4 light_pnt_view[96]; uniform mat4 light_pnt_view[LIGHT_PNT_LIMIT6];
uniform mat4 light_pnt_proj[LIGHT_PNT_LIMIT]; uniform mat4 light_pnt_proj[LIGHT_PNT_LIMIT];
uniform int light_pnt_shadow_active[LIGHT_PNT_LIMIT]; uniform int light_pnt_shadow_active[LIGHT_PNT_LIMIT];
uniform float light_pnt_shadow_bias[LIGHT_DIR_LIMIT]; uniform float light_pnt_shadow_bias[LIGHT_DIR_LIMIT];

View file

@ -1,7 +1,11 @@
// //
// Simple passthrough fragment shader // Simple passthrough fragment shader
// //
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -1,4 +1,8 @@
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -7,7 +7,11 @@ varying vec4 v_vColour;
uniform int useMask; uniform int useMask;
uniform sampler2D mask; uniform sampler2D mask;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform vec4 colorFrom[PALETTE_LIMIT]; uniform vec4 colorFrom[PALETTE_LIMIT];
uniform int colorFrom_amo; uniform int colorFrom_amo;
uniform vec4 colorTo[PALETTE_LIMIT]; uniform vec4 colorTo[PALETTE_LIMIT];

View file

@ -4,7 +4,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform vec4 palette[PALETTE_LIMIT]; uniform vec4 palette[PALETTE_LIMIT];
uniform float paletteAmount; uniform float paletteAmount;

View file

@ -1,7 +1,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define MAXPATH 1024 #ifdef _YY_HLSL11_
#define MAXPATH 1024
#else
#define MAXPATH 256
#endif
uniform vec4 color; uniform vec4 color;
uniform vec4 bgColor; uniform vec4 bgColor;

View file

@ -1,4 +1,8 @@
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -1,7 +1,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform vec4 palette[PALETTE_LIMIT]; uniform vec4 palette[PALETTE_LIMIT];
uniform int keys; uniform int keys;

View file

@ -4,7 +4,11 @@
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform vec4 colors[PALETTE_LIMIT]; uniform vec4 colors[PALETTE_LIMIT];
uniform float colorAmount; uniform float colorAmount;
uniform float seed; uniform float seed;

View file

@ -1,3 +1,9 @@
#ifdef _YY_HLSL11_
#define SHAPE_LIMIT 1024
#else
#define SHAPE_LIMIT 256
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
@ -11,7 +17,7 @@ void main() {
vec2 pxPos = v_vTexcoord * vec2(float(maxShape), 1.) - 0.5; vec2 pxPos = v_vTexcoord * vec2(float(maxShape), 1.) - 0.5;
int amo = 0; int amo = 0;
vec4 list[1024]; vec4 list[SHAPE_LIMIT];
for(float i = 0.; i <= dimension.x; i++) for(float i = 0.; i <= dimension.x; i++)
for(float j = 0.; j <= dimension.y; j++) { for(float j = 0.; j <= dimension.y; j++) {

View file

@ -1,5 +1,10 @@
// 2D Signed Distance equations by InigoQuilez // 2D Signed Distance equations by InigoQuilez
#define CURVE_MAX 512
#ifdef _YY_HLSL11_
#define CURVE_MAX 1024
#else
#define CURVE_MAX 512
#endif
varying vec2 v_vTexcoord; varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;

View file

@ -2,7 +2,11 @@ varying vec2 v_vTexcoord;
varying vec4 v_vColour; varying vec4 v_vColour;
#define PI 3.14159265359 #define PI 3.14159265359
#define PALETTE_LIMIT 1024 #ifdef _YY_HLSL11_
#define PALETTE_LIMIT 1024
#else
#define PALETTE_LIMIT 256
#endif
uniform float seed; uniform float seed;
uniform vec2 dimension; uniform vec2 dimension;