/
redgpu
/
ispc
Обзор
Документация
Войти
/
redgpu
/
ispc
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
tests/func-tests/operators3.ispc
43 строки
802 B
Arina Neshlyaeva
Extend binary operators support
09 июн 2025, 21:14
09 июн 2025, 21:14
fdf117c
Код
Авторство
О чём код?
#include "test_static.isph" struct S { uint a; }; uint operator==(struct S rr, struct S rv) { return rr.a == rv.a; } uint operator!=(struct S rr, struct S rv) { return rr.a != rv.a; } uint operator>(struct S rr, struct S rv) { return rr.a > rv.a; } uint operator<(struct S rr, struct S rv) { return rr.a < rv.a; } uint operator>=(struct S rr, struct S rv) { return rr.a >= rv.a; } uint operator<=(struct S rr, struct S rv) { return rr.a <= rv.a; } task void f_f(uniform float RET[], uniform float aFOO[]) { struct S a; struct S b; a.a = aFOO[programIndex]; b.a = aFOO[programIndex] + 5; RET[programIndex] = (a == b) + (a != b) + (a > b) + (a < b) + (a >= b) + (a <= b); } task void result(uniform float RET[16]) { RET[programIndex] = 3; }