yes
This commit is contained in:
@@ -93,7 +93,7 @@ pub const Value = union(Type) {
|
|||||||
i32_ptr: *i32, //< For vector specializations
|
i32_ptr: *i32, //< For vector specializations
|
||||||
u32_ptr: *u32,
|
u32_ptr: *u32,
|
||||||
},
|
},
|
||||||
runtime_array_window: ?[]u8 = null,
|
uniform_slice_window: ?[]u8 = null,
|
||||||
},
|
},
|
||||||
|
|
||||||
pub inline fn getCompositeDataOrNull(self: *const Self) ?[]Self {
|
pub inline fn getCompositeDataOrNull(self: *const Self) ?[]Self {
|
||||||
@@ -440,7 +440,7 @@ pub const Value = union(Type) {
|
|||||||
pub fn flushPtr(self: *Self, allocator: std.mem.Allocator) RuntimeError!void {
|
pub fn flushPtr(self: *Self, allocator: std.mem.Allocator) RuntimeError!void {
|
||||||
switch (self.*) {
|
switch (self.*) {
|
||||||
.Pointer => |*p| {
|
.Pointer => |*p| {
|
||||||
if (p.runtime_array_window) |window| {
|
if (p.uniform_slice_window) |window| {
|
||||||
switch (p.ptr) {
|
switch (p.ptr) {
|
||||||
.common => |ptr| {
|
.common => |ptr| {
|
||||||
_ = try ptr.read(window);
|
_ = try ptr.read(window);
|
||||||
@@ -450,7 +450,7 @@ pub const Value = union(Type) {
|
|||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.runtime_array_window = null;
|
p.uniform_slice_window = null;
|
||||||
},
|
},
|
||||||
else => {},
|
else => {},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -516,7 +516,10 @@ fn CondOperator(comptime T: ValueType, comptime Op: CondOp) type {
|
|||||||
}
|
}
|
||||||
return switch (Op) {
|
return switch (Op) {
|
||||||
.IsFinite => std.math.isFinite(a),
|
.IsFinite => std.math.isFinite(a),
|
||||||
.IsInf => std.math.isInf(a),
|
.IsInf => blk: {
|
||||||
|
std.debug.print("test {s} - {d} - {s}\n", .{ @typeName(TT), a, if (std.math.isInf(a)) "true" else "false" });
|
||||||
|
break :blk std.math.isInf(a);
|
||||||
|
},
|
||||||
.IsNan => std.math.isNan(a),
|
.IsNan => std.math.isNan(a),
|
||||||
.IsNormal => std.math.isNormal(a),
|
.IsNormal => std.math.isNormal(a),
|
||||||
else => RuntimeError.InvalidSpirV,
|
else => RuntimeError.InvalidSpirV,
|
||||||
@@ -1186,7 +1189,7 @@ fn opAccessChain(allocator: std.mem.Allocator, word_count: SpvWord, rt: *Runtime
|
|||||||
.AccessChain = .{
|
.AccessChain = .{
|
||||||
.target = var_type,
|
.target = var_type,
|
||||||
.value = blk: {
|
.value = blk: {
|
||||||
var runtime_array_window: ?[]u8 = null;
|
var uniform_slice_window: ?[]u8 = null;
|
||||||
|
|
||||||
for (0..index_count) |index| {
|
for (0..index_count) |index| {
|
||||||
const is_last = (index == index_count - 1);
|
const is_last = (index == index_count - 1);
|
||||||
@@ -1213,7 +1216,7 @@ fn opAccessChain(allocator: std.mem.Allocator, word_count: SpvWord, rt: *Runtime
|
|||||||
.RuntimeArray => |*arr| {
|
.RuntimeArray => |*arr| {
|
||||||
value_ptr = try arr.createValueFromIndex(if (is_last) allocator else arena_allocator, rt.results, i.value.uint32);
|
value_ptr = try arr.createValueFromIndex(if (is_last) allocator else arena_allocator, rt.results, i.value.uint32);
|
||||||
if (is_last)
|
if (is_last)
|
||||||
runtime_array_window = arr.data[(try arr.getOffsetOfIndex(i.value.uint32))..];
|
uniform_slice_window = arr.data[(try arr.getOffsetOfIndex(i.value.uint32))..];
|
||||||
},
|
},
|
||||||
.Vector4f32 => |*v| {
|
.Vector4f32 => |*v| {
|
||||||
if (i.value.uint32 > 4) return RuntimeError.OutOfBounds;
|
if (i.value.uint32 > 4) return RuntimeError.OutOfBounds;
|
||||||
@@ -1260,7 +1263,7 @@ fn opAccessChain(allocator: std.mem.Allocator, word_count: SpvWord, rt: *Runtime
|
|||||||
break :blk .{
|
break :blk .{
|
||||||
.Pointer = .{
|
.Pointer = .{
|
||||||
.ptr = .{ .common = value_ptr },
|
.ptr = .{ .common = value_ptr },
|
||||||
.runtime_array_window = runtime_array_window,
|
.uniform_slice_window = uniform_slice_window,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user