/
redgpu
/
raygpu
Обзор
Документация
Войти
/
redgpu
/
raygpu
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
amalgamation/glslang/Test/struct_function_parameters.frag
48 строк
1 KB
manuel
Bump glslang to 16.0.0
31 окт 2025, 02:24
31 окт 2025, 02:24
2d4c73f
Код
Авторство
О чём код?
#version 400 struct Vertex { vec3 position; vec3 normal; }; struct Light { vec3 position; vec3 color; float intensity; }; struct Camera { mat4 viewMatrix; mat4 projMatrix; }; // Test various positions of struct parameters - these should be TYPE_NAME void render(Vertex v, Light l, Camera c) { // Function with struct parameters at start } void process(int id, Vertex v, float time) { // Function with struct parameter in middle } void compute(float delta, int count, Light l, Camera c, bool enabled) { // Function with multiple struct parameters mixed with other types } void single(Vertex v) { // Function with single struct parameter } void multiple(Vertex v1, Vertex v2, Light l1, Light l2) { // Function with multiple parameters of same struct type } void main() { Vertex v = Vertex(vec3(0.0), vec3(1.0, 0.0, 0.0)); Light l = Light(vec3(10.0), vec3(1.0), 1.0); Camera c = Camera(mat4(1.0), mat4(1.0)); render(v, l, c); process(1, v, 0.5); compute(0.016, 100, l, c, true); }