Blender V5.3
gpu_shader_display_fallback.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
10
15
20
21struct VertOut {
23};
24
25[[vertex]] void vert_main([[resource_table]] const Resources &srt,
26 [[position]] float4 &out_pos,
27 [[in]] const VertIn &v_in,
28 [[out]] VertOut &v_out)
29{
30 float2 ndc = (float2(2.0f) * (v_in.pos / srt.fullscreen)) - float2(1.0f);
31 out_pos = float4(ndc, 0.0f, 1.0f);
32 v_out.uv = v_in.texCoord;
33}
34
35struct FragOut {
37};
38
40 [[in]] const VertOut &v_out,
41 [[out]] FragOut &frag_out)
42{
43 frag_out.color = texture(srt.image_texture, v_out.uv);
44}
45
46} // namespace builtin::display_fallback
47
#define position
#define smooth
#define push_constant
#define resource_table
#define sampler(slot)
#define attribute(slot)
#define fragment
#define vertex
#define frag_color(slot)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
SamplerBase< float, 2 > sampler2D
PipelineGraphic gpu_shader_cycles_display_fallback(builtin::display_fallback::vert_main, builtin::display_fallback::frag_main)
void frag_main(const Resources &srt, const VertOut &v_out, FragOut &frag_out)
void vert_main(const Resources &srt, float4 &out_pos, const VertIn &v_in, VertOut &v_out)