yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeUnify stdlib `Texture` types into one generic type. (#3327)4c78efd0c

master
692 B16 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage fragment -entry main -allow-glsl
2//TEST:SIMPLE(filecheck=CHECK): -target spirv -stage fragment -entry main -allow-glsl -emit-spirv-directly
3#version 450 core
4layout(location = 0) out mediump vec4 o_color;
5layout(location = 0) in highp vec2 v_texCoord;
6layout(location = 1) in highp float v_lodBias;
7layout(set = 0, binding = 0) uniform highp usampler2D u_sampler;
8layout(set = 0, binding = 1) uniform buf0 { highp vec4 u_scale; };
9layout(set = 0, binding = 2) uniform buf1 { highp vec4 u_bias; };
10
11void main()
12{
13    o_color = vec4(texelFetch(u_sampler, ivec2(v_texCoord), int(v_lodBias))) * u_scale + u_bias;
14    // CHECK: OpEntryPoint
15}
16