aboutsummaryrefslogtreecommitdiffstats
path: root/src/gl.zig
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2021-11-11 11:30:28 +0000
committers-ol <s+removethis@s-ol.nu>2021-11-11 11:31:34 +0000
commitd05c479194bedd52500c5e4be5bdef2266f73061 (patch)
tree5dabb0e90f1b3d17fd7b0eb97f34004a0d9447cf /src/gl.zig
parentremove/ignore unused variables (diff)
downloadglsl-view-d05c479194bedd52500c5e4be5bdef2266f73061.tar.gz
glsl-view-d05c479194bedd52500c5e4be5bdef2266f73061.zip
update for zig 0.8.0
Diffstat (limited to 'src/gl.zig')
-rw-r--r--src/gl.zig14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gl.zig b/src/gl.zig
index 9f437c5..9f15aef 100644
--- a/src/gl.zig
+++ b/src/gl.zig
@@ -359,7 +359,7 @@ pub const UniformCache = struct {
pub fn deinit(self: *UniformCache) void {
var it = self.uniforms.iterator();
while (it.next()) |entry| {
- self.allocator.free(entry.key);
+ self.allocator.free(entry.key_ptr.*);
}
self.uniforms.deinit();
@@ -381,8 +381,8 @@ pub const UniformCache = struct {
var it = self.uniforms.iterator();
var i: usize = 0;
while (it.next()) |entry| {
- existing_names[i] = entry.key;
- existing_names_c[i] = entry.key.ptr;
+ existing_names[i] = entry.key_ptr.*;
+ existing_names_c[i] = entry.key_ptr.*.ptr;
i += 1;
}
}
@@ -397,8 +397,8 @@ pub const UniformCache = struct {
for (existing_indices) |index, i| {
const name = existing_names[i];
if (index == c.GL_INVALID_INDEX) {
- if (self.uniforms.remove(name)) |removed| {
- self.allocator.free(removed.key);
+ if (self.uniforms.remove(name)) {
+ self.allocator.free(name);
}
} else {
var uniform = self.uniforms.get(name).?;
@@ -415,14 +415,14 @@ pub const UniformCache = struct {
var result = try self.uniforms.getOrPut(cloned_name);
if (!result.found_existing) {
- result.entry.value = CachedUniform.init(self.shader.*, name.ptr) catch {
+ result.value_ptr.* = CachedUniform.init(self.shader.*, name.ptr) catch {
_ = self.uniforms.remove(cloned_name);
self.allocator.free(cloned_name);
return null;
};
}
- return &result.entry.value;
+ return result.value_ptr;
}
};