From 1c86bb51da99df1950124d812eabcfe15af4f771 Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 9 Feb 2025 18:50:15 +1100 Subject: support for shader int variable type --- sc/sc.cpp | 2 ++ sc/sh_enums.h | 1 + sc/sh_helpers.h | 1 + 3 files changed, 4 insertions(+) (limited to 'sc') diff --git a/sc/sc.cpp b/sc/sc.cpp index 9b1789f..d7e9038 100644 --- a/sc/sc.cpp +++ b/sc/sc.cpp @@ -158,6 +158,8 @@ struct Desc { switch (type) { case svariable_type_float: return { 4, 4 }; + case svariable_type_int: + return { 4, 4 }; case svariable_type_vec2: return { 8, 8 }; case svariable_type_vec3: diff --git a/sc/sh_enums.h b/sc/sh_enums.h index 9e62a9d..e9a33b8 100644 --- a/sc/sh_enums.h +++ b/sc/sh_enums.h @@ -24,6 +24,7 @@ sprogram_type_xmacro() #define svariable_type_xmacro() \ x(float) \ + x(int) \ x(vec2) \ x(vec3) \ x(vec4) \ diff --git a/sc/sh_helpers.h b/sc/sh_helpers.h index 87c6e6a..fa503dc 100644 --- a/sc/sh_helpers.h +++ b/sc/sh_helpers.h @@ -1,6 +1,7 @@ int svariable_type_size(SVariable_Type type) { switch (type) { case svariable_type_float: return 4; + case svariable_type_int: return 4; case svariable_type_vec2: return 8; case svariable_type_vec3: return 12; case svariable_type_vec4: return 16; -- cgit v1.2.3-54-g00ecf