71 lines
No EOL
1.7 KiB
Text
71 lines
No EOL
1.7 KiB
Text
#version 450
|
|
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
#extension GL_EXT_shader_explicit_arithmetic_types_float16 : require
|
|
#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require
|
|
#extension GL_EXT_scalar_block_layout : require
|
|
|
|
#define NIS_GLSL 1
|
|
#define NIS_USE_HALF_PRECISION 1
|
|
#define NIS_SCALER 1
|
|
|
|
#include "descriptor_set.h"
|
|
|
|
layout(binding = 0, scalar)
|
|
uniform const_buffer
|
|
{
|
|
float kDetectRatio;
|
|
float kDetectThres;
|
|
float kMinContrastRatio;
|
|
float kRatioNorm;
|
|
|
|
float kContrastBoost;
|
|
float kEps;
|
|
float kSharpStartY;
|
|
float kSharpScaleY;
|
|
|
|
float kSharpStrengthMin;
|
|
float kSharpStrengthScale;
|
|
float kSharpLimitMin;
|
|
float kSharpLimitScale;
|
|
|
|
float kScaleX;
|
|
float kScaleY;
|
|
|
|
float kDstNormX;
|
|
float kDstNormY;
|
|
float kSrcNormX;
|
|
float kSrcNormY;
|
|
|
|
uint kInputViewportOriginX;
|
|
uint kInputViewportOriginY;
|
|
uint kInputViewportWidth;
|
|
uint kInputViewportHeight;
|
|
|
|
uint kOutputViewportOriginX;
|
|
uint kOutputViewportOriginY;
|
|
uint kOutputViewportWidth;
|
|
uint kOutputViewportHeight;
|
|
|
|
float reserved0;
|
|
float reserved1;
|
|
};
|
|
|
|
// These are the names the NIS shader uses to access the data needed to do the upscaling
|
|
#define in_texture s_samplers[0]
|
|
#define out_texture dst
|
|
#define coef_scaler s_samplers[VKR_NIS_COEF_SCALER_SLOT]
|
|
#define coef_usm s_samplers[VKR_NIS_COEF_USM_SLOT]
|
|
|
|
// Gamescope is using combined image samplers so no need to specify a sampler
|
|
#define sampler2D(x, sampler) (x)
|
|
|
|
#include "NVIDIAImageScaling/NIS/NIS_Scaler.h"
|
|
|
|
layout(local_size_x=NIS_THREAD_GROUP_SIZE,
|
|
local_size_y = 1,
|
|
local_size_z = 1) in;
|
|
void main()
|
|
{
|
|
NVScaler(gl_WorkGroupID.xy, gl_LocalInvocationID.x);
|
|
} |