Merge branch 'odin-lang:master' into master

This commit is contained in:
ftphikari
2023-07-25 15:32:18 +03:00
committed by GitHub
170 changed files with 11751 additions and 5071 deletions
+11 -3
View File
@@ -6,9 +6,9 @@ Its use is similar to that of `core:` packages, which would be available in any
Presently, the `vendor:` collection comprises the following packages:
## microui
## microui (Port)
A tiny, portable, immediate-mode UI library written in Odin. (Ported from [rxi/microui](https://github.com/rxi/microui).)
A tiny, portable, immediate-mode UI library written in Odin. [rxi/microui](https://github.com/rxi/microui)
This package is available under the MIT license. See `LICENSE` for more details.
@@ -158,4 +158,12 @@ Includes full bindings.
Used in: [bgfx](https://github.com/bkaradzic/bgfx), [Filament](https://github.com/google/filament), [gltfpack](https://github.com/zeux/meshoptimizer/tree/master/gltf), [raylib](https://github.com/raysan5/raylib), [Unigine](https://developer.unigine.com/en/docs/2.14.1/third_party?rlang=cpp#cgltf), and more!
See also LICENCE in `cgltf` directory itself.
Se also LICENCE in `cgltf` directory itself.
## nanovg (Port)
[NanoVG](https://github.com/memononen/nanovg) is a small antialiased vector graphics rendering library for OpenGL. It has lean API modeled after HTML5 canvas API. It is aimed to be a practical and fun toolset for building scalable user interfaces and visualizations.
## fontstash (Port)
[Font stash](https://github.com/memononen/fontstash) is a light-weight online font texture atlas builder. It uses stb_truetype to render fonts on demand to a texture atlas.
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream_160 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+4 -4
View File
@@ -72,7 +72,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -151,7 +151,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -230,7 +230,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -309,7 +309,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+4 -4
View File
@@ -72,7 +72,7 @@ hash_stream_224 :: proc(s: io.Stream) -> ([DIGEST_SIZE_224]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -151,7 +151,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -230,7 +230,7 @@ hash_stream_384 :: proc(s: io.Stream) -> ([DIGEST_SIZE_384]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -309,7 +309,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+2 -2
View File
@@ -70,7 +70,7 @@ hash_stream_128 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -149,7 +149,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+3 -3
View File
@@ -72,7 +72,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -151,7 +151,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -230,7 +230,7 @@ hash_stream_slice :: proc(s: io.Stream, bit_size: int, allocator := context.allo
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+2 -2
View File
@@ -70,7 +70,7 @@ hash_stream_256 :: proc(s: io.Stream) -> ([DIGEST_SIZE_256]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -149,7 +149,7 @@ hash_stream_512 :: proc(s: io.Stream) -> ([DIGEST_SIZE_512]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+3 -3
View File
@@ -71,7 +71,7 @@ hash_stream_128 :: proc(s: io.Stream) -> ([DIGEST_SIZE_128]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -150,7 +150,7 @@ hash_stream_160 :: proc(s: io.Stream) -> ([DIGEST_SIZE_160]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
@@ -229,7 +229,7 @@ hash_stream_192 :: proc(s: io.Stream) -> ([DIGEST_SIZE_192]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+1 -1
View File
@@ -69,7 +69,7 @@ hash_stream :: proc(s: io.Stream) -> ([DIGEST_SIZE]byte, bool) {
defer delete(buf)
i := 1
for i > 0 {
i, _ = s->impl_read(buf)
i, _ = io.read(s, buf)
if i > 0 {
botan.hash_update(ctx, len(buf) == 0 ? nil : &buf[0], uint(i))
}
+85 -2104
View File
File diff suppressed because it is too large Load Diff
+1194
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -50,7 +50,7 @@ Player :: struct {
player_num: c.int,
using u: struct #raw_union {
local: struct {},
remove: struct {
remote: struct {
ip_address: [32]byte,
port: u16,
},
+123
View File
@@ -0,0 +1,123 @@
#ifdef GL_ES
#if defined(GL_FRAGMENT_PRECISION_HIGH) || defined(NANOVG_GL3)
precision highp float;
#else
precision mediump float;
#endif
#endif
#ifdef NANOVG_GL3
#ifdef USE_UNIFORMBUFFER
layout(std140) uniform frag {
mat3 scissorMat;
mat3 paintMat;
vec4 innerCol;
vec4 outerCol;
vec2 scissorExt;
vec2 scissorScale;
vec2 extent;
float radius;
float feather;
float strokeMult;
float strokeThr;
int texType;
int type;
};
#else // NANOVG_GL3 && !USE_UNIFORMBUFFER
uniform vec4 frag[UNIFORMARRAY_SIZE];
#endif
uniform sampler2D tex;
in vec2 ftcoord;
in vec2 fpos;
out vec4 outColor;
#else // !NANOVG_GL3
uniform vec4 frag[UNIFORMARRAY_SIZE];
uniform sampler2D tex;
varying vec2 ftcoord;
varying vec2 fpos;
#endif
#ifndef USE_UNIFORMBUFFER
#define scissorMat mat3(frag[0].xyz, frag[1].xyz, frag[2].xyz)
#define paintMat mat3(frag[3].xyz, frag[4].xyz, frag[5].xyz)
#define innerCol frag[6]
#define outerCol frag[7]
#define scissorExt frag[8].xy
#define scissorScale frag[8].zw
#define extent frag[9].xy
#define radius frag[9].z
#define feather frag[9].w
#define strokeMult frag[10].x
#define strokeThr frag[10].y
#define texType int(frag[10].z)
#define type int(frag[10].w)
#endif
float sdroundrect(vec2 pt, vec2 ext, float rad) {
vec2 ext2 = ext - vec2(rad,rad);
vec2 d = abs(pt) - ext2;
return min(max(d.x,d.y),0.0) + length(max(d,0.0)) - rad;
}
// Scissoring
float scissorMask(vec2 p) {
vec2 sc = (abs((scissorMat * vec3(p,1.0)).xy) - scissorExt);
sc = vec2(0.5,0.5) - sc * scissorScale;
return clamp(sc.x,0.0,1.0) * clamp(sc.y,0.0,1.0);
}
#ifdef EDGE_AA
// Stroke - from [0..1] to clipped pyramid, where the slope is 1px.
float strokeMask() {
return min(1.0, (1.0-abs(ftcoord.x*2.0-1.0))*strokeMult) * min(1.0, ftcoord.y);
}
#endif
void main(void) {
vec4 result;
float scissor = scissorMask(fpos);
#ifdef EDGE_AA
float strokeAlpha = strokeMask();
if (strokeAlpha < strokeThr) discard;
#else
float strokeAlpha = 1.0;
#endif
if (type == 0) { // Gradient
// Calculate gradient color using box gradient
vec2 pt = (paintMat * vec3(fpos,1.0)).xy;
float d = clamp((sdroundrect(pt, extent, radius) + feather*0.5) / feather, 0.0, 1.0);
vec4 color = mix(innerCol,outerCol,d);
// Combine alpha
color *= strokeAlpha * scissor;
result = color;
} else if (type == 1) { // Image
// Calculate color fron texture
vec2 pt = (paintMat * vec3(fpos,1.0)).xy / extent;
#ifdef NANOVG_GL3
vec4 color = texture(tex, pt);
#else
vec4 color = texture2D(tex, pt);
#endif
if (texType == 1) color = vec4(color.xyz*color.w,color.w);
if (texType == 2) color = vec4(color.x);
// Apply color tint and alpha.
color *= innerCol;
// Combine alpha
color *= strokeAlpha * scissor;
result = color;
} else if (type == 2) { // Stencil fill
result = vec4(1,1,1,1);
} else if (type == 3) { // Textured tris
#ifdef NANOVG_GL3
vec4 color = texture(tex, ftcoord);
#else
vec4 color = texture2D(tex, ftcoord);
#endif
if (texType == 1) color = vec4(color.xyz*color.w,color.w);
if (texType == 2) color = vec4(color.x);
color *= scissor;
result = color * innerCol;
}
#ifdef NANOVG_GL3
outColor = result;
#else
gl_FragColor = result;
#endif
}
+1453
View File
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
#ifdef NANOVG_GL3
uniform vec2 viewSize;
in vec2 vertex;
in vec2 tcoord;
out vec2 ftcoord;
out vec2 fpos;
#else
uniform vec2 viewSize;
attribute vec2 vertex;
attribute vec2 tcoord;
varying vec2 ftcoord;
varying vec2 fpos;
#endif
void main(void) {
ftcoord = tcoord;
fpos = vertex;
gl_Position = vec4(2.0*vertex.x/viewSize.x - 1.0, 1.0 - 2.0*vertex.y/viewSize.y, 0, 1);
}
+3443
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1133,7 +1133,7 @@ foreign lib {
SetGesturesEnabled :: proc(flags: Gestures) --- // Enable a set of gestures using flags
IsGestureDetected :: proc(gesture: Gesture) -> bool --- // Check if a gesture have been detected
GetGestureDetected :: proc() -> Gesture --- // Get latest detected gesture
GetGestureDetected :: proc() -> Gestures --- // Get latest detected gesture
GetGestureHoldDuration :: proc() -> f32 --- // Get gesture hold time in milliseconds
GetGestureDragVector :: proc() -> Vector2 --- // Get gesture drag vector
GetGestureDragAngle :: proc() -> f32 --- // Get gesture drag angle
+91
View File
@@ -429,7 +429,93 @@ def parse_enums(f):
f.write("{} :: distinct bit_set[{}; Flags]\n".format(flag.ljust(max_len), flag_name))
f.write("{} :: enum u32 {{}}\n".format(flag_name.ljust(max_len)))
def parse_fake_enums(f):
data = re.findall(r"static const Vk(\w+FlagBits2) VK_(\w+?) = (\w+);", src, re.S)
data.sort(key=lambda x: x[0])
fake_enums = {}
for type_name, name, value in data:
if type_name in fake_enums:
fake_enums[type_name].append((name,value))
else:
fake_enums[type_name] = [(name, value)]
for name in fake_enums.keys():
flags_name = name.replace("FlagBits", "Flags")
enum_name = name.replace("FlagBits", "Flag")
f.write("{} :: distinct bit_set[{}; Flags64]\n".format(flags_name, enum_name))
f.write("{} :: enum Flags64 {{\n".format(name.replace("FlagBits", "Flag")))
prefix = to_snake_case(name).upper()
suffix = None
for ext in ext_suffixes:
prefix_new = remove_suffix(prefix, "_"+ext)
assert suffix is None
if prefix_new != prefix:
suffix = "_"+ext
prefix = prefix_new
break
prefix = prefix.replace("_FLAG_BITS2", "_2")
prefix += "_"
ff = []
groups = []
flags = {}
names_and_values = fake_enums[name]
for name, value in names_and_values:
value = value.replace("ULL", "")
n = fix_enum_name(name, prefix, suffix, True)
try:
v = fix_enum_value(value, prefix, suffix, True)
except FlagError as e:
v = int(str(e))
groups.append((n, v))
continue
except IgnoreFlagError as e:
groups.append((n, 0))
continue
if n == v:
continue
try:
flags[int(v)] = n
except ValueError as e:
pass
if v == "NONE":
continue
ff.append((n, v))
max_flag_value = max([int(v) for n, v in ff if is_int(v)] + [0])
max_group_value = max([int(v) for n, v in groups if is_int(v)] + [0])
if max_flag_value < max_group_value:
if (1<<max_flag_value)+1 < max_group_value:
ff.append(('_MAX', 31))
flags[31] = '_MAX'
pass
max_len = max([len(n) for n, v in ff] + [0])
flag_names = set([n for n, v in ff])
for n, v in ff:
if not is_int(v) and v not in flag_names:
print("Ignoring", n, "=", v)
continue
f.write("\t{} = {},".format(n.ljust(max_len), v))
if n == "_MAX":
f.write(" // Needed for the *_ALL bit set")
f.write("\n")
f.write("}\n\n")
def parse_structs(f):
data = re.findall(r"typedef (struct|union) Vk(\w+?) {(.+?)} \w+?;", src, re.S)
@@ -490,6 +576,10 @@ def parse_structs(f):
continue
name = name.replace("FlagBits", "Flag")
_type = _type.replace("FlagBits", "Flag")
if name.endswith("Flag2") or name.endswith("Flags2"):
continue
aliases.append((name, _type))
max_len = max([len(n) for n, _ in aliases] + [0])
@@ -732,6 +822,7 @@ with open("../enums.odin", 'w', encoding='utf-8') as f:
f.write(BASE)
f.write("\n")
parse_enums(f)
parse_fake_enums(f)
f.write("\n\n")
with open("../structs.odin", 'w', encoding='utf-8') as f:
f.write(BASE)
+218
View File
@@ -3825,5 +3825,223 @@ WaylandSurfaceCreateFlagsKHR :: distinct bit_set[Wayland
WaylandSurfaceCreateFlagKHR :: enum u32 {}
Win32SurfaceCreateFlagsKHR :: distinct bit_set[Win32SurfaceCreateFlagKHR; Flags]
Win32SurfaceCreateFlagKHR :: enum u32 {}
AccessFlags2 :: distinct bit_set[AccessFlag2; Flags64]
AccessFlag2 :: enum Flags64 {
INDIRECT_COMMAND_READ = 0,
INDIRECT_COMMAND_READ_KHR = 0,
INDEX_READ = 1,
INDEX_READ_KHR = 1,
VERTEX_ATTRIBUTE_READ = 2,
VERTEX_ATTRIBUTE_READ_KHR = 2,
UNIFORM_READ = 3,
UNIFORM_READ_KHR = 3,
INPUT_ATTACHMENT_READ = 4,
INPUT_ATTACHMENT_READ_KHR = 4,
SHADER_READ = 5,
SHADER_READ_KHR = 5,
SHADER_WRITE = 6,
SHADER_WRITE_KHR = 6,
COLOR_ATTACHMENT_READ = 7,
COLOR_ATTACHMENT_READ_KHR = 7,
COLOR_ATTACHMENT_WRITE = 8,
COLOR_ATTACHMENT_WRITE_KHR = 8,
DEPTH_STENCIL_ATTACHMENT_READ = 9,
DEPTH_STENCIL_ATTACHMENT_READ_KHR = 9,
DEPTH_STENCIL_ATTACHMENT_WRITE = 10,
DEPTH_STENCIL_ATTACHMENT_WRITE_KHR = 10,
TRANSFER_READ = 11,
TRANSFER_READ_KHR = 11,
TRANSFER_WRITE = 12,
TRANSFER_WRITE_KHR = 12,
HOST_READ = 13,
HOST_READ_KHR = 13,
HOST_WRITE = 14,
HOST_WRITE_KHR = 14,
MEMORY_READ = 15,
MEMORY_READ_KHR = 15,
MEMORY_WRITE = 16,
MEMORY_WRITE_KHR = 16,
SHADER_SAMPLED_READ = 32,
SHADER_SAMPLED_READ_KHR = 32,
SHADER_STORAGE_READ = 33,
SHADER_STORAGE_READ_KHR = 33,
SHADER_STORAGE_WRITE = 34,
SHADER_STORAGE_WRITE_KHR = 34,
VIDEO_DECODE_READ_KHR = 35,
VIDEO_DECODE_WRITE_KHR = 36,
VIDEO_ENCODE_READ_KHR = 37,
VIDEO_ENCODE_WRITE_KHR = 38,
TRANSFORM_FEEDBACK_WRITE_EXT = 25,
TRANSFORM_FEEDBACK_COUNTER_READ_EXT = 26,
TRANSFORM_FEEDBACK_COUNTER_WRITE_EXT = 27,
CONDITIONAL_RENDERING_READ_EXT = 20,
COMMAND_PREPROCESS_READ_NV = 17,
COMMAND_PREPROCESS_WRITE_NV = 18,
FRAGMENT_SHADING_RATE_ATTACHMENT_READ_KHR = 23,
SHADING_RATE_IMAGE_READ_NV = 23,
ACCELERATION_STRUCTURE_READ_KHR = 21,
ACCELERATION_STRUCTURE_WRITE_KHR = 22,
ACCELERATION_STRUCTURE_READ_NV = 21,
ACCELERATION_STRUCTURE_WRITE_NV = 22,
FRAGMENT_DENSITY_MAP_READ_EXT = 24,
COLOR_ATTACHMENT_READ_NONCOHERENT_EXT = 19,
DESCRIPTOR_BUFFER_READ_EXT = 41,
INVOCATION_MASK_READ_HUAWEI = 39,
SHADER_BINDING_TABLE_READ_KHR = 40,
MICROMAP_READ_EXT = 44,
MICROMAP_WRITE_EXT = 45,
OPTICAL_FLOW_READ_NV = 42,
OPTICAL_FLOW_WRITE_NV = 43,
}
FormatFeatureFlags2 :: distinct bit_set[FormatFeatureFlag2; Flags64]
FormatFeatureFlag2 :: enum Flags64 {
SAMPLED_IMAGE = 0,
SAMPLED_IMAGE_KHR = 0,
STORAGE_IMAGE = 1,
STORAGE_IMAGE_KHR = 1,
STORAGE_IMAGE_ATOMIC = 2,
STORAGE_IMAGE_ATOMIC_KHR = 2,
UNIFORM_TEXEL_BUFFER = 3,
UNIFORM_TEXEL_BUFFER_KHR = 3,
STORAGE_TEXEL_BUFFER = 4,
STORAGE_TEXEL_BUFFER_KHR = 4,
STORAGE_TEXEL_BUFFER_ATOMIC = 5,
STORAGE_TEXEL_BUFFER_ATOMIC_KHR = 5,
VERTEX_BUFFER = 6,
VERTEX_BUFFER_KHR = 6,
COLOR_ATTACHMENT = 7,
COLOR_ATTACHMENT_KHR = 7,
COLOR_ATTACHMENT_BLEND = 8,
COLOR_ATTACHMENT_BLEND_KHR = 8,
DEPTH_STENCIL_ATTACHMENT = 9,
DEPTH_STENCIL_ATTACHMENT_KHR = 9,
BLIT_SRC = 10,
BLIT_SRC_KHR = 10,
BLIT_DST = 11,
BLIT_DST_KHR = 11,
SAMPLED_IMAGE_FILTER_LINEAR = 12,
SAMPLED_IMAGE_FILTER_LINEAR_KHR = 12,
SAMPLED_IMAGE_FILTER_CUBIC = 13,
SAMPLED_IMAGE_FILTER_CUBIC_EXT = 13,
TRANSFER_SRC = 14,
TRANSFER_SRC_KHR = 14,
TRANSFER_DST = 15,
TRANSFER_DST_KHR = 15,
SAMPLED_IMAGE_FILTER_MINMAX = 16,
SAMPLED_IMAGE_FILTER_MINMAX_KHR = 16,
MIDPOINT_CHROMA_SAMPLES = 17,
MIDPOINT_CHROMA_SAMPLES_KHR = 17,
SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER = 18,
SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_KHR = 18,
SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER = 19,
SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_KHR = 19,
SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT = 20,
SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_KHR = 20,
SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE = 21,
SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_KHR = 21,
DISJOINT = 22,
DISJOINT_KHR = 22,
COSITED_CHROMA_SAMPLES = 23,
COSITED_CHROMA_SAMPLES_KHR = 23,
STORAGE_READ_WITHOUT_FORMAT = 31,
STORAGE_READ_WITHOUT_FORMAT_KHR = 31,
STORAGE_WRITE_WITHOUT_FORMAT = 32,
STORAGE_WRITE_WITHOUT_FORMAT_KHR = 32,
SAMPLED_IMAGE_DEPTH_COMPARISON = 33,
SAMPLED_IMAGE_DEPTH_COMPARISON_KHR = 33,
VIDEO_DECODE_OUTPUT_KHR = 25,
VIDEO_DECODE_DPB_KHR = 26,
ACCELERATION_STRUCTURE_VERTEX_BUFFER_KHR = 29,
FRAGMENT_DENSITY_MAP_EXT = 24,
FRAGMENT_SHADING_RATE_ATTACHMENT_KHR = 30,
VIDEO_ENCODE_INPUT_KHR = 27,
VIDEO_ENCODE_DPB_KHR = 28,
LINEAR_COLOR_ATTACHMENT_NV = 38,
WEIGHT_IMAGE_QCOM = 34,
WEIGHT_SAMPLED_IMAGE_QCOM = 35,
BLOCK_MATCHING_QCOM = 36,
BOX_FILTER_SAMPLED_QCOM = 37,
OPTICAL_FLOW_IMAGE_NV = 40,
OPTICAL_FLOW_VECTOR_NV = 41,
OPTICAL_FLOW_COST_NV = 42,
}
PipelineStageFlags2 :: distinct bit_set[PipelineStageFlag2; Flags64]
PipelineStageFlag2 :: enum Flags64 {
TOP_OF_PIPE = 0,
TOP_OF_PIPE_KHR = 0,
DRAW_INDIRECT = 1,
DRAW_INDIRECT_KHR = 1,
VERTEX_INPUT = 2,
VERTEX_INPUT_KHR = 2,
VERTEX_SHADER = 3,
VERTEX_SHADER_KHR = 3,
TESSELLATION_CONTROL_SHADER = 4,
TESSELLATION_CONTROL_SHADER_KHR = 4,
TESSELLATION_EVALUATION_SHADER = 5,
TESSELLATION_EVALUATION_SHADER_KHR = 5,
GEOMETRY_SHADER = 6,
GEOMETRY_SHADER_KHR = 6,
FRAGMENT_SHADER = 7,
FRAGMENT_SHADER_KHR = 7,
EARLY_FRAGMENT_TESTS = 8,
EARLY_FRAGMENT_TESTS_KHR = 8,
LATE_FRAGMENT_TESTS = 9,
LATE_FRAGMENT_TESTS_KHR = 9,
COLOR_ATTACHMENT_OUTPUT = 10,
COLOR_ATTACHMENT_OUTPUT_KHR = 10,
COMPUTE_SHADER = 11,
COMPUTE_SHADER_KHR = 11,
ALL_TRANSFER = 12,
ALL_TRANSFER_KHR = 12,
TRANSFER = 12,
TRANSFER_KHR = 12,
BOTTOM_OF_PIPE = 13,
BOTTOM_OF_PIPE_KHR = 13,
HOST = 14,
HOST_KHR = 14,
ALL_GRAPHICS = 15,
ALL_GRAPHICS_KHR = 15,
ALL_COMMANDS = 16,
ALL_COMMANDS_KHR = 16,
COPY = 32,
COPY_KHR = 32,
RESOLVE = 33,
RESOLVE_KHR = 33,
BLIT = 34,
BLIT_KHR = 34,
CLEAR = 35,
CLEAR_KHR = 35,
INDEX_INPUT = 36,
INDEX_INPUT_KHR = 36,
VERTEX_ATTRIBUTE_INPUT = 37,
VERTEX_ATTRIBUTE_INPUT_KHR = 37,
PRE_RASTERIZATION_SHADERS = 38,
PRE_RASTERIZATION_SHADERS_KHR = 38,
VIDEO_DECODE_KHR = 26,
VIDEO_ENCODE_KHR = 27,
TRANSFORM_FEEDBACK_EXT = 24,
CONDITIONAL_RENDERING_EXT = 18,
COMMAND_PREPROCESS_NV = 17,
FRAGMENT_SHADING_RATE_ATTACHMENT_KHR = 22,
SHADING_RATE_IMAGE_NV = 22,
ACCELERATION_STRUCTURE_BUILD_KHR = 25,
RAY_TRACING_SHADER_KHR = 21,
RAY_TRACING_SHADER_NV = 21,
ACCELERATION_STRUCTURE_BUILD_NV = 25,
FRAGMENT_DENSITY_PROCESS_EXT = 23,
TASK_SHADER_NV = 19,
MESH_SHADER_NV = 20,
TASK_SHADER_EXT = 19,
MESH_SHADER_EXT = 20,
SUBPASS_SHADING_HUAWEI = 39,
INVOCATION_MASK_HUAWEI = 40,
ACCELERATION_STRUCTURE_COPY_KHR = 28,
MICROMAP_BUILD_EXT = 30,
CLUSTER_CULLING_SHADER_HUAWEI = 41,
OPTICAL_FLOW_NV = 29,
}
-6
View File
@@ -7406,12 +7406,6 @@ IOSurfaceRef :: struct {} // Opaque struct defined by Apples CoreGraphics fra
// Aliases
PhysicalDeviceVariablePointerFeatures :: PhysicalDeviceVariablePointersFeatures
PhysicalDeviceShaderDrawParameterFeatures :: PhysicalDeviceShaderDrawParametersFeatures
PipelineStageFlags2 :: Flags64
PipelineStageFlag2 :: Flags64
AccessFlags2 :: Flags64
AccessFlag2 :: Flags64
FormatFeatureFlags2 :: Flags64
FormatFeatureFlag2 :: Flags64
RenderingFlagsKHR :: RenderingFlags
RenderingFlagKHR :: RenderingFlag
RenderingInfoKHR :: RenderingInfo
+32 -35
View File
@@ -27,7 +27,7 @@ ContextAttributes :: distinct bit_set[ContextAttribute; u32]
DEFAULT_CONTEXT_ATTRIBUTES :: ContextAttributes{}
@(default_calling_convention="c")
@(default_calling_convention="contextless")
foreign webgl {
// CreateCurrentContextById must be called before `GetCurrentContextAttributes` if the user wants to
// set specific attributes, otherwise the default attributes will be set for the WebGL context
@@ -168,61 +168,59 @@ foreign webgl {
Viewport :: proc(x, y, w, h: i32) ---
}
Uniform1fv :: proc "c" (location: i32, v: f32) { Uniform1f(location, v) }
Uniform2fv :: proc "c" (location: i32, v: glm.vec2) { Uniform2f(location, v.x, v.y) }
Uniform3fv :: proc "c" (location: i32, v: glm.vec3) { Uniform3f(location, v.x, v.y, v.z) }
Uniform4fv :: proc "c" (location: i32, v: glm.vec4) { Uniform4f(location, v.x, v.y, v.z, v.w) }
Uniform1iv :: proc "c" (location: i32, v: i32) { Uniform1i(location, v) }
Uniform2iv :: proc "c" (location: i32, v: glm.ivec2) { Uniform2i(location, v.x, v.y) }
Uniform3iv :: proc "c" (location: i32, v: glm.ivec3) { Uniform3i(location, v.x, v.y, v.z) }
Uniform4iv :: proc "c" (location: i32, v: glm.ivec4) { Uniform4i(location, v.x, v.y, v.z, v.w) }
Uniform1fv :: proc "contextless" (location: i32, v: f32) { Uniform1f(location, v) }
Uniform2fv :: proc "contextless" (location: i32, v: glm.vec2) { Uniform2f(location, v.x, v.y) }
Uniform3fv :: proc "contextless" (location: i32, v: glm.vec3) { Uniform3f(location, v.x, v.y, v.z) }
Uniform4fv :: proc "contextless" (location: i32, v: glm.vec4) { Uniform4f(location, v.x, v.y, v.z, v.w) }
Uniform1iv :: proc "contextless" (location: i32, v: i32) { Uniform1i(location, v) }
Uniform2iv :: proc "contextless" (location: i32, v: glm.ivec2) { Uniform2i(location, v.x, v.y) }
Uniform3iv :: proc "contextless" (location: i32, v: glm.ivec3) { Uniform3i(location, v.x, v.y, v.z) }
Uniform4iv :: proc "contextless" (location: i32, v: glm.ivec4) { Uniform4i(location, v.x, v.y, v.z, v.w) }
VertexAttrib1fv :: proc "c" (index: i32, v: f32) { VertexAttrib1f(index, v) }
VertexAttrib2fv :: proc "c" (index: i32, v: glm.vec2){ VertexAttrib2f(index, v.x, v.y) }
VertexAttrib3fv :: proc "c" (index: i32, v: glm.vec3){ VertexAttrib3f(index, v.x, v.y, v.z) }
VertexAttrib4fv :: proc "c" (index: i32, v: glm.vec4){ VertexAttrib4f(index, v.x, v.y, v.z, v.w) }
VertexAttrib1fv :: proc "contextless" (index: i32, v: f32) { VertexAttrib1f(index, v) }
VertexAttrib2fv :: proc "contextless" (index: i32, v: glm.vec2){ VertexAttrib2f(index, v.x, v.y) }
VertexAttrib3fv :: proc "contextless" (index: i32, v: glm.vec3){ VertexAttrib3f(index, v.x, v.y, v.z) }
VertexAttrib4fv :: proc "contextless" (index: i32, v: glm.vec4){ VertexAttrib4f(index, v.x, v.y, v.z, v.w) }
UniformMatrix2fv :: proc "c" (location: i32, m: glm.mat2) {
UniformMatrix2fv :: proc "contextless" (location: i32, m: glm.mat2) {
foreign webgl {
@(link_name="UniformMatrix2fv")
_UniformMatrix2fv :: proc "c" (location: i32, value: [^]f32) ---
_UniformMatrix2fv :: proc "contextless" (location: i32, value: [^]f32) ---
}
value := transmute([2*2]f32)m
_UniformMatrix2fv(location, &value[0])
}
UniformMatrix3fv :: proc "c" (location: i32, m: glm.mat3) {
UniformMatrix3fv :: proc "contextless" (location: i32, m: glm.mat3) {
foreign webgl {
@(link_name="UniformMatrix3fv")
_UniformMatrix3fv :: proc "c" (location: i32, value: [^]f32) ---
_UniformMatrix3fv :: proc "contextless" (location: i32, value: [^]f32) ---
}
value := transmute([3*3]f32)m
_UniformMatrix3fv(location, &value[0])
}
UniformMatrix4fv :: proc "c" (location: i32, m: glm.mat4) {
UniformMatrix4fv :: proc "contextless" (location: i32, m: glm.mat4) {
foreign webgl {
@(link_name="UniformMatrix4fv")
_UniformMatrix4fv :: proc "c" (location: i32, value: [^]f32) ---
_UniformMatrix4fv :: proc "contextless" (location: i32, value: [^]f32) ---
}
value := transmute([4*4]f32)m
_UniformMatrix4fv(location, &value[0])
}
GetShaderiv :: proc "c" (shader: Shader, pname: Enum) -> (p: i32) {
@(default_calling_convention="c")
GetShaderiv :: proc "contextless" (shader: Shader, pname: Enum) -> (p: i32) {
foreign webgl {
@(link_name="GetShaderiv")
_GetShaderiv :: proc "c" (shader: Shader, pname: Enum, p: ^i32) ---
_GetShaderiv :: proc "contextless" (shader: Shader, pname: Enum, p: ^i32) ---
}
_GetShaderiv(shader, pname, &p)
return
}
GetProgramInfoLog :: proc "c" (program: Program, buf: []byte) -> string {
@(default_calling_convention="c")
GetProgramInfoLog :: proc "contextless" (program: Program, buf: []byte) -> string {
foreign webgl {
@(link_name="GetProgramInfoLog")
_GetProgramInfoLog :: proc "c" (program: Program, buf: []byte, length: ^int) ---
_GetProgramInfoLog :: proc "contextless" (program: Program, buf: []byte, length: ^int) ---
}
length: int
@@ -230,11 +228,10 @@ GetProgramInfoLog :: proc "c" (program: Program, buf: []byte) -> string {
return string(buf[:length])
}
GetShaderInfoLog :: proc "c" (shader: Shader, buf: []byte) -> string {
@(default_calling_convention="c")
GetShaderInfoLog :: proc "contextless" (shader: Shader, buf: []byte) -> string {
foreign webgl {
@(link_name="GetShaderInfoLog")
_GetShaderInfoLog :: proc "c" (shader: Shader, buf: []byte, length: ^int) ---
_GetShaderInfoLog :: proc "contextless" (shader: Shader, buf: []byte, length: ^int) ---
}
length: int
@@ -244,27 +241,27 @@ GetShaderInfoLog :: proc "c" (shader: Shader, buf: []byte) -> string {
BufferDataSlice :: proc "c" (target: Enum, slice: $S/[]$E, usage: Enum) {
BufferDataSlice :: proc "contextless" (target: Enum, slice: $S/[]$E, usage: Enum) {
BufferData(target, len(slice)*size_of(E), raw_data(slice), usage)
}
BufferSubDataSlice :: proc "c" (target: Enum, offset: uintptr, slice: $S/[]$E) {
BufferSubDataSlice :: proc "contextless" (target: Enum, offset: uintptr, slice: $S/[]$E) {
BufferSubData(target, offset, len(slice)*size_of(E), raw_data(slice), usage)
}
CompressedTexImage2DSlice :: proc "c" (target: Enum, level: i32, internalformat: Enum, width, height: i32, border: i32, slice: $S/[]$E) {
CompressedTexImage2DSlice :: proc "contextless" (target: Enum, level: i32, internalformat: Enum, width, height: i32, border: i32, slice: $S/[]$E) {
CompressedTexImage2DSlice(target, level, internalformat, width, height, border, len(slice)*size_of(E), raw_data(slice))
}
CompressedTexSubImage2DSlice :: proc "c" (target: Enum, level: i32, xoffset, yoffset, width, height: i32, format: Enum, slice: $S/[]$E) {
CompressedTexSubImage2DSlice :: proc "contextless" (target: Enum, level: i32, xoffset, yoffset, width, height: i32, format: Enum, slice: $S/[]$E) {
CompressedTexSubImage2DSlice(target, level, level, xoffset, yoffset, width, height, format, len(slice)*size_of(E), raw_data(slice))
}
ReadPixelsSlice :: proc "c" (x, y, width, height: i32, format: Enum, type: Enum, slice: $S/[]$E) {
ReadPixelsSlice :: proc "contextless" (x, y, width, height: i32, format: Enum, type: Enum, slice: $S/[]$E) {
ReadnPixels(x, y, width, height, format, type, len(slice)*size_of(E), raw_data(slice))
}
TexImage2DSlice :: proc "c" (target: Enum, level: i32, internalformat: Enum, width, height: i32, border: i32, format, type: Enum, slice: $S/[]$E) {
TexImage2DSlice :: proc "contextless" (target: Enum, level: i32, internalformat: Enum, width, height: i32, border: i32, format, type: Enum, slice: $S/[]$E) {
TexImage2D(target, level, internalformat, width, height, border, format, type, len(slice)*size_of(E), raw_data(slice))
}
TexSubImage2DSlice :: proc "c" (target: Enum, level: i32, xoffset, yoffset, width, height: i32, format, type: Enum, slice: $S/[]$E) {
TexSubImage2DSlice :: proc "contextless" (target: Enum, level: i32, xoffset, yoffset, width, height: i32, format, type: Enum, slice: $S/[]$E) {
TexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, len(slice)*size_of(E), raw_data(slice))
}
+21 -21
View File
@@ -10,13 +10,13 @@ Sync :: distinct u32
TransformFeedback :: distinct u32
VertexArrayObject :: distinct u32
IsWebGL2Supported :: proc "c" () -> bool {
IsWebGL2Supported :: proc "contextless" () -> bool {
major, minor: i32
GetWebGLVersion(&major, &minor)
return major >= 2
}
@(default_calling_convention="c")
@(default_calling_convention="contextless")
foreign webgl2 {
/* Buffer objects */
CopyBufferSubData :: proc(readTarget, writeTarget: Enum, readOffset, writeOffset: int, size: int) ---
@@ -110,7 +110,7 @@ foreign webgl2 {
GetActiveUniformBlockName :: proc(program: Program, uniformBlockIndex: i32, buf: []byte) -> string {
foreign webgl2 {
_GetActiveUniformBlockName :: proc(program: Program, uniformBlockIndex: i32, buf: []byte, length: ^int) ---
_GetActiveUniformBlockName :: proc "contextless" (program: Program, uniformBlockIndex: i32, buf: []byte, length: ^int) ---
}
n: int
_GetActiveUniformBlockName(program, uniformBlockIndex, buf, &n)
@@ -118,65 +118,65 @@ GetActiveUniformBlockName :: proc(program: Program, uniformBlockIndex: i32, buf:
}
Uniform1uiv :: proc "c" (location: i32, v: u32) {
Uniform1uiv :: proc "contextless" (location: i32, v: u32) {
Uniform1ui(location, v)
}
Uniform2uiv :: proc "c" (location: i32, v: glm.uvec2) {
Uniform2uiv :: proc "contextless" (location: i32, v: glm.uvec2) {
Uniform2ui(location, v.x, v.y)
}
Uniform3uiv :: proc "c" (location: i32, v: glm.uvec3) {
Uniform3uiv :: proc "contextless" (location: i32, v: glm.uvec3) {
Uniform3ui(location, v.x, v.y, v.z)
}
Uniform4uiv :: proc "c" (location: i32, v: glm.uvec4) {
Uniform4uiv :: proc "contextless" (location: i32, v: glm.uvec4) {
Uniform4ui(location, v.x, v.y, v.z, v.w)
}
UniformMatrix3x2fv :: proc "c" (location: i32, m: glm.mat3x2) {
UniformMatrix3x2fv :: proc "contextless" (location: i32, m: glm.mat3x2) {
foreign webgl2 {
_UniformMatrix3x2fv :: proc "c" (location: i32, addr: [^]f32) ---
_UniformMatrix3x2fv :: proc "contextless" (location: i32, addr: [^]f32) ---
}
array := matrix_flatten(m)
_UniformMatrix3x2fv(location, &array[0])
}
UniformMatrix4x2fv :: proc "c" (location: i32, m: glm.mat4x2) {
UniformMatrix4x2fv :: proc "contextless" (location: i32, m: glm.mat4x2) {
foreign webgl2 {
_UniformMatrix4x2fv :: proc "c" (location: i32, addr: [^]f32) ---
_UniformMatrix4x2fv :: proc "contextless" (location: i32, addr: [^]f32) ---
}
array := matrix_flatten(m)
_UniformMatrix4x2fv(location, &array[0])
}
UniformMatrix2x3fv :: proc "c" (location: i32, m: glm.mat2x3) {
UniformMatrix2x3fv :: proc "contextless" (location: i32, m: glm.mat2x3) {
foreign webgl2 {
_UniformMatrix2x3fv :: proc "c" (location: i32, addr: [^]f32) ---
_UniformMatrix2x3fv :: proc "contextless" (location: i32, addr: [^]f32) ---
}
array := matrix_flatten(m)
_UniformMatrix2x3fv(location, &array[0])
}
UniformMatrix4x3fv :: proc "c" (location: i32, m: glm.mat4x3) {
UniformMatrix4x3fv :: proc "contextless" (location: i32, m: glm.mat4x3) {
foreign webgl2 {
_UniformMatrix4x3fv :: proc "c" (location: i32, addr: [^]f32) ---
_UniformMatrix4x3fv :: proc "contextless" (location: i32, addr: [^]f32) ---
}
array := matrix_flatten(m)
_UniformMatrix4x3fv(location, &array[0])
}
UniformMatrix2x4fv :: proc "c" (location: i32, m: glm.mat2x4) {
UniformMatrix2x4fv :: proc "contextless" (location: i32, m: glm.mat2x4) {
foreign webgl2 {
_UniformMatrix2x4fv :: proc "c" (location: i32, addr: [^]f32) ---
_UniformMatrix2x4fv :: proc "contextless" (location: i32, addr: [^]f32) ---
}
array := matrix_flatten(m)
_UniformMatrix2x4fv(location, &array[0])
}
UniformMatrix3x4fv :: proc "c" (location: i32, m: glm.mat3x4) {
UniformMatrix3x4fv :: proc "contextless" (location: i32, m: glm.mat3x4) {
foreign webgl2 {
_UniformMatrix3x4fv :: proc "c" (location: i32, addr: [^]f32) ---
_UniformMatrix3x4fv :: proc "contextless" (location: i32, addr: [^]f32) ---
}
array := matrix_flatten(m)
_UniformMatrix3x4fv(location, &array[0])
}
VertexAttribI4iv :: proc "c" (index: i32, v: glm.ivec4) {
VertexAttribI4iv :: proc "contextless" (index: i32, v: glm.ivec4) {
VertexAttribI4i(index, v.x, v.y, v.z, v.w)
}
VertexAttribI4uiv :: proc "c" (index: i32, v: glm.uvec4) {
VertexAttribI4uiv :: proc "contextless" (index: i32, v: glm.uvec4) {
VertexAttribI4ui(index, v.x, v.y, v.z, v.w)
}