blob: 713b2d89f25273c5b6fbbe6d5643804a0c396d86 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
cbuffer buf : register(b0)
{
float ubuf_t : packoffset(c0);
};
static float2 coords;
static float4 fragColor;
struct SPIRV_Cross_Input
{
float2 coords : TEXCOORD0;
};
struct SPIRV_Cross_Output
{
float4 fragColor : SV_Target0;
};
void frag_main()
{
float i = 1.0f - (pow(abs(coords.x), 4.0f) + pow(abs(coords.y), 4.0f));
i = smoothstep(ubuf_t - 0.800000011920928955078125f, ubuf_t + 0.800000011920928955078125f, i);
i = floor(i * 20.0f) / 20.0f;
fragColor = float4((coords * 0.5f) + 0.5f.xx, i, i);
}
SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input)
{
coords = stage_input.coords;
frag_main();
SPIRV_Cross_Output stage_output;
stage_output.fragColor = fragColor;
return stage_output;
}
|