summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2025-03-10 15:31:09 +1100
committerquou <quou@disroot.org>2025-03-10 15:31:31 +1100
commitd661b9edec77a6269a5f11de53699156e1aa3d05 (patch)
tree0479784f07a313c746b4848c0f29baebaded8862
parent37b929e148e5b003f68903eb9ee192d24517e683 (diff)
ivec 2, 3 & 4
-rw-r--r--sc/sc.cpp4
-rw-r--r--sc/sh_enums.h3
-rw-r--r--sc/sh_helpers.h3
3 files changed, 9 insertions, 1 deletions
diff --git a/sc/sc.cpp b/sc/sc.cpp
index 9232e10..f0ce0ff 100644
--- a/sc/sc.cpp
+++ b/sc/sc.cpp
@@ -168,14 +168,16 @@ struct Desc {
std::pair<int, int> size() const {
switch (type) {
case svariable_type_float:
- return { 4, 4 };
case svariable_type_int:
return { 4, 4 };
case svariable_type_vec2:
+ case svariable_type_ivec2:
return { 8, 8 };
case svariable_type_vec3:
+ case svariable_type_ivec3:
return { 12, 16 };
case svariable_type_vec4:
+ case svariable_type_ivec4:
return { 16, 16 };
case svariable_type_mat2:
return { 16, 16 };
diff --git a/sc/sh_enums.h b/sc/sh_enums.h
index e9a33b8..6cf9495 100644
--- a/sc/sh_enums.h
+++ b/sc/sh_enums.h
@@ -28,6 +28,9 @@ sprogram_type_xmacro()
x(vec2) \
x(vec3) \
x(vec4) \
+ x(ivec2) \
+ x(ivec3) \
+ x(ivec4) \
x(mat2) \
x(mat3) \
x(mat4)
diff --git a/sc/sh_helpers.h b/sc/sh_helpers.h
index fa503dc..1b81bd6 100644
--- a/sc/sh_helpers.h
+++ b/sc/sh_helpers.h
@@ -5,6 +5,9 @@ int svariable_type_size(SVariable_Type type) {
case svariable_type_vec2: return 8;
case svariable_type_vec3: return 12;
case svariable_type_vec4: return 16;
+ case svariable_type_ivec2: return 8;
+ case svariable_type_ivec3: return 12;
+ case svariable_type_ivec4: return 16;
case svariable_type_mat2: return 16;
case svariable_type_mat3: return 36;
case svariable_type_mat4: return 64;