spirv: write error value in an storage buffer
This commit is contained in:
@@ -350,6 +350,11 @@ pub fn finalize(self: *Module, a: Allocator) ![]Word {
|
||||
.vector16 => try self.addCapability(.Vector16),
|
||||
// Shader
|
||||
.shader => try self.addCapability(.Shader),
|
||||
.variable_pointers => {
|
||||
try self.addExtension("SPV_KHR_variable_pointers");
|
||||
try self.addCapability(.VariablePointersStorageBuffer);
|
||||
try self.addCapability(.VariablePointers);
|
||||
},
|
||||
.physical_storage_buffer => {
|
||||
try self.addExtension("SPV_KHR_physical_storage_buffer");
|
||||
try self.addCapability(.PhysicalStorageBufferAddresses);
|
||||
@@ -364,20 +369,17 @@ pub fn finalize(self: *Module, a: Allocator) ![]Word {
|
||||
// Emit memory model
|
||||
const addressing_model: spec.AddressingModel = blk: {
|
||||
if (self.hasFeature(.shader)) {
|
||||
break :blk switch (self.target.cpu.arch) {
|
||||
.spirv32 => .Logical, // TODO: I don't think this will ever be implemented.
|
||||
.spirv64 => .PhysicalStorageBuffer64,
|
||||
else => unreachable,
|
||||
};
|
||||
} else if (self.hasFeature(.kernel)) {
|
||||
break :blk switch (self.target.cpu.arch) {
|
||||
.spirv32 => .Physical32,
|
||||
.spirv64 => .Physical64,
|
||||
else => unreachable,
|
||||
};
|
||||
assert(self.target.cpu.arch == .spirv64);
|
||||
if (self.hasFeature(.physical_storage_buffer)) break :blk .PhysicalStorageBuffer64;
|
||||
break :blk .Logical;
|
||||
}
|
||||
|
||||
unreachable;
|
||||
assert(self.hasFeature(.kernel));
|
||||
break :blk switch (self.target.cpu.arch) {
|
||||
.spirv32 => .Physical32,
|
||||
.spirv64 => .Physical64,
|
||||
else => unreachable,
|
||||
};
|
||||
};
|
||||
try self.sections.memory_model.emit(self.gpa, .OpMemoryModel, .{
|
||||
.addressing_model = addressing_model,
|
||||
|
||||
Reference in New Issue
Block a user