Merge pull request #345 from hunterk/master

add parameters to xbrz-freescale and put multipass into a subdirectory
This commit is contained in:
hizzlekizzle 2023-01-12 13:18:55 -06:00 committed by GitHub
commit 67bcc56117
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 29 deletions

View file

@ -46,9 +46,20 @@
// * do so, delete this exception statement from your version. * // * do so, delete this exception statement from your version. *
// **************************************************************************** // ****************************************************************************
#define BLEND_NONE 0 layout(push_constant) uniform Push
#define BLEND_NORMAL 1 {
#define BLEND_DOMINANT 2 vec4 SourceSize;
vec4 OutputSize;
float blend_none, blend_normal, blend_dominant;
} params;
#pragma parameter blend_none "Blend None" 0.0 0.0 2.0 1.0
#pragma parameter blend_normal "Blend Normal" 1.0 0.0 2.0 1.0
#pragma parameter blend_dominant "Blend Dominant" 2.0 0.0 2.0 1.0
#define BLEND_NONE int(params.blend_none)
#define BLEND_NORMAL int(params.blend_normal)
#define BLEND_DOMINANT int(params.blend_dominant)
#define LUMINANCE_WEIGHT 1.0 #define LUMINANCE_WEIGHT 1.0
#define EQUAL_COLOR_TOLERANCE 30.0/255.0 #define EQUAL_COLOR_TOLERANCE 30.0/255.0
#define STEEP_DIRECTION_THRESHOLD 2.2 #define STEEP_DIRECTION_THRESHOLD 2.2
@ -85,12 +96,6 @@ float get_left_ratio(vec2 center, vec2 origin, vec2 direction, vec2 scale)
return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v); return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v);
} }
layout(push_constant) uniform Push
{
vec4 SourceSize;
vec4 OutputSize;
} params;
layout(std140, set = 0, binding = 0) uniform UBO layout(std140, set = 0, binding = 0) uniform UBO
{ {
mat4 MVP; mat4 MVP;

View file

@ -43,9 +43,20 @@
// * do so, delete this exception statement from your version. * // * do so, delete this exception statement from your version. *
// **************************************************************************** // ****************************************************************************
#define BLEND_NONE 0 layout(push_constant) uniform Push
#define BLEND_NORMAL 1 {
#define BLEND_DOMINANT 2 vec4 xbrz_fs_refpassSize;
vec4 OutputSize;
float blend_none, blend_normal, blend_dominant;
} params;
#pragma parameter blend_none "Blend None" 0.0 0.0 2.0 1.0
#pragma parameter blend_normal "Blend Normal" 1.0 0.0 2.0 1.0
#pragma parameter blend_dominant "Blend Dominant" 2.0 0.0 2.0 1.0
#define BLEND_NONE int(params.blend_none)
#define BLEND_NORMAL int(params.blend_normal)
#define BLEND_DOMINANT int(params.blend_dominant)
#define LUMINANCE_WEIGHT 1.0 #define LUMINANCE_WEIGHT 1.0
#define EQUAL_COLOR_TOLERANCE 30.0/255.0 #define EQUAL_COLOR_TOLERANCE 30.0/255.0
#define STEEP_DIRECTION_THRESHOLD 2.2 #define STEEP_DIRECTION_THRESHOLD 2.2
@ -82,12 +93,6 @@ float get_left_ratio(vec2 center, vec2 origin, vec2 direction, vec2 scale)
return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v); return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v);
} }
layout(push_constant) uniform Push
{
vec4 xbrz_fs_refpassSize;
vec4 OutputSize;
} params;
layout(std140, set = 0, binding = 0) uniform UBO layout(std140, set = 0, binding = 0) uniform UBO
{ {
mat4 MVP; mat4 MVP;

View file

@ -46,9 +46,20 @@
// * do so, delete this exception statement from your version. * // * do so, delete this exception statement from your version. *
// **************************************************************************** // ****************************************************************************
#define BLEND_NONE 0 layout(push_constant) uniform Push
#define BLEND_NORMAL 1 {
#define BLEND_DOMINANT 2 vec4 SourceSize;
vec4 OutputSize;
float blend_none, blend_normal, blend_dominant;
} params;
#pragma parameter blend_none "Blend None" 0.0 0.0 2.0 1.0
#pragma parameter blend_normal "Blend Normal" 1.0 0.0 2.0 1.0
#pragma parameter blend_dominant "Blend Dominant" 2.0 0.0 2.0 1.0
#define BLEND_NONE int(params.blend_none)
#define BLEND_NORMAL int(params.blend_normal)
#define BLEND_DOMINANT int(params.blend_dominant)
#define LUMINANCE_WEIGHT 1.0 #define LUMINANCE_WEIGHT 1.0
#define EQUAL_COLOR_TOLERANCE 30.0/255.0 #define EQUAL_COLOR_TOLERANCE 30.0/255.0
#define STEEP_DIRECTION_THRESHOLD 2.2 #define STEEP_DIRECTION_THRESHOLD 2.2
@ -85,12 +96,6 @@ float get_left_ratio(vec2 center, vec2 origin, vec2 direction, vec2 scale)
return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v); return smoothstep(-sqrt(2.0)/2.0, sqrt(2.0)/2.0, v);
} }
layout(push_constant) uniform Push
{
vec4 SourceSize;
vec4 OutputSize;
} params;
layout(std140, set = 0, binding = 0) uniform UBO layout(std140, set = 0, binding = 0) uniform UBO
{ {
mat4 MVP; mat4 MVP;

View file

@ -3,12 +3,12 @@ shaders = 3
shader0 = ../stock.slang shader0 = ../stock.slang
alias0 = xbrz_fs_refpass alias0 = xbrz_fs_refpass
shader1 = shaders/xbrz-freescale-pass0.slang shader1 = shaders/xbrz-freescale-multipass/xbrz-freescale-pass0.slang
filter_linear1 = false filter_linear1 = false
scale_type1 = source scale_type1 = source
scale1 = 1.0 scale1 = 1.0
shader2 = shaders/xbrz-freescale-pass1.slang shader2 = shaders/xbrz-freescale-multipass/xbrz-freescale-pass1.slang
filter_linear2 = false filter_linear2 = false
scale_type2 = viewport scale_type2 = viewport
scale2 = 1.0 scale2 = 1.0