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
55 lines
1.5 KiB
GLSL
55 lines
1.5 KiB
GLSL
Texture2D<float4> uSampler[4] : register(t0);
|
|
SamplerState _uSampler_sampler[4] : register(s0);
|
|
Texture2D<float4> uTextures[4] : register(t8);
|
|
SamplerState uSamplers[4] : register(s4);
|
|
|
|
static int vIndex;
|
|
static float2 vTex;
|
|
static float4 FragColor;
|
|
|
|
struct SPIRV_Cross_Input
|
|
{
|
|
nointerpolation float2 vTex : TEXCOORD0;
|
|
nointerpolation int vIndex : TEXCOORD1;
|
|
};
|
|
|
|
struct SPIRV_Cross_Output
|
|
{
|
|
float4 FragColor : SV_Target0;
|
|
};
|
|
|
|
float4 sample_from_global()
|
|
{
|
|
return uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex + 0.100000001490116119384765625f.xx);
|
|
}
|
|
|
|
float4 sample_from_argument(Texture2D<float4> samplers[4], SamplerState _samplers_sampler[4])
|
|
{
|
|
return samplers[vIndex].Sample(_samplers_sampler[vIndex], vTex + 0.20000000298023223876953125f.xx);
|
|
}
|
|
|
|
float4 sample_single_from_argument(Texture2D<float4> samp, SamplerState _samp_sampler)
|
|
{
|
|
return samp.Sample(_samp_sampler, vTex + 0.300000011920928955078125f.xx);
|
|
}
|
|
|
|
void frag_main()
|
|
{
|
|
FragColor = 0.0f.xxxx;
|
|
FragColor += uTextures[2].Sample(uSamplers[1], vTex);
|
|
FragColor += uSampler[vIndex].Sample(_uSampler_sampler[vIndex], vTex);
|
|
FragColor += sample_from_global();
|
|
FragColor += sample_from_argument(uSampler, _uSampler_sampler);
|
|
FragColor += sample_single_from_argument(uSampler[3], _uSampler_sampler[3]);
|
|
}
|
|
|
|
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
|
|
{
|
|
vIndex = stage_input.vIndex;
|
|
vTex = stage_input.vTex;
|
|
frag_main();
|
|
SPIRV_Cross_Output stage_output;
|
|
stage_output.FragColor = FragColor;
|
|
return stage_output;
|
|
}
|