mirror of
https://github.com/libretro/RetroArch
synced 2025-02-19 12:41:00 +00:00
2820ab0b51 Merge pull request #1076 from KhronosGroup/bitcast-pre-330-glsl 63bcbd511e GLSL: Need extension to use bitcast on GLSL < 330. 9f3bebe3d0 Merge pull request #1075 from lifpan/master b11c20fc1d Remove unreasonable assertion for OpTypeImage Sampled parameter. 1a592b7c0f Merge pull request #1067 from cdavis5e/msl-scalar-block-layout 28454facbb MSL: Handle packed matrices. ea5c0ed82f MSL: Fix alignment of packed types. 44f688bf0b Merge pull request #1070 from KhronosGroup/fix-1066 25c74b324e Forget loop variable enables after emitting block chain. 6b010e0cbc Merge pull request #1069 from KhronosGroup/fix-1053 f6f849397e MSL: Re-roll array expressions in initializers. e5fa7edfd6 MSL: Support scalar block layout. git-subtree-dir: deps/SPIRV-Cross git-subtree-split: 2820ab0b51bf5e4187435d904b34e762b988f48b
52 lines
2.0 KiB
GLSL
52 lines
2.0 KiB
GLSL
Texture2D<float4> uSampler2D : register(t0);
|
|
SamplerComparisonState _uSampler2D_sampler : register(s0);
|
|
Texture2DArray<float4> uSampler2DArray : register(t1);
|
|
SamplerComparisonState _uSampler2DArray_sampler : register(s1);
|
|
TextureCube<float4> uSamplerCube : register(t2);
|
|
SamplerComparisonState _uSamplerCube_sampler : register(s2);
|
|
TextureCubeArray<float4> uSamplerCubeArray : register(t3);
|
|
SamplerComparisonState _uSamplerCubeArray_sampler : register(s3);
|
|
|
|
static float3 vUVRef;
|
|
static float4 vDirRef;
|
|
static float FragColor;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
float3 vUVRef : TEXCOORD0;
|
|
float4 vDirRef : TEXCOORD1;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float FragColor : SV_Target0;
|
|
};
|
|
|
|
void frag_main()
|
|
{
|
|
float s0 = uSampler2D.SampleCmp(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1));
|
|
float s1 = uSampler2DArray.SampleCmp(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1));
|
|
float s2 = uSamplerCube.SampleCmp(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w);
|
|
float s3 = uSamplerCubeArray.SampleCmp(_uSamplerCubeArray_sampler, vDirRef, 0.5f);
|
|
float l0 = uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, vUVRef.xy, vUVRef.z, int2(-1, -1));
|
|
float l1 = uSampler2DArray.SampleCmpLevelZero(_uSampler2DArray_sampler, vDirRef.xyz, vDirRef.w, int2(-1, -1));
|
|
float l2 = uSamplerCube.SampleCmpLevelZero(_uSamplerCube_sampler, vDirRef.xyz, vDirRef.w);
|
|
float4 _80 = vDirRef;
|
|
_80.z = vDirRef.w;
|
|
float p0 = uSampler2D.SampleCmp(_uSampler2D_sampler, _80.xy / _80.z, vDirRef.z / _80.z, int2(1, 1));
|
|
float4 _87 = vDirRef;
|
|
_87.z = vDirRef.w;
|
|
float p1 = uSampler2D.SampleCmpLevelZero(_uSampler2D_sampler, _87.xy / _87.z, vDirRef.z / _87.z, int2(1, 1));
|
|
FragColor = (((((((s0 + s1) + s2) + s3) + l0) + l1) + l2) + p0) + p1;
|
|
}
|
|
|
|
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
|
{
|
|
vUVRef = stage_input.vUVRef;
|
|
vDirRef = stage_input.vDirRef;
|
|
frag_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.FragColor = FragColor;
|
|
return stage_output;
|
|
}
|