From d661b9edec77a6269a5f11de53699156e1aa3d05 Mon Sep 17 00:00:00 2001 From: quou Date: Mon, 10 Mar 2025 15:31:09 +1100 Subject: ivec 2, 3 & 4 --- sc/sc.cpp | 4 +++- sc/sh_enums.h | 3 +++ sc/sh_helpers.h | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) 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 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; -- cgit v1.2.3-54-g00ecf