add new win32 platform implementation (#1224)

* Buffer resources from swap chain were not being released.
* sysgpu Texture.getWidth() should return width not height.
* d3d12: Fixing issues with d3d12 on sysgpu.
* Initial win32 platform
This commit is contained in:
Hordur Johannsson 2024-07-13 22:33:45 +00:00 committed by GitHub
parent 3fa889b136
commit c32e763e11
Failed to generate hash of commit
12 changed files with 3329 additions and 18 deletions

View file

@ -413,10 +413,6 @@ pub const Device = struct {
}
pub fn deinit(device: *Device) void {
if (device.lost_cb) |lost_cb| {
lost_cb(.destroyed, "Device was destroyed.", device.lost_cb_userdata);
}
device.queue.waitUntil(device.queue.fence_value);
device.processQueuedOperations();

View file

@ -32,8 +32,6 @@ pub fn gen(allocator: std.mem.Allocator, air: *const Air, debug_info: DebugInfo)
hlsl.arena.deinit();
}
try hlsl.output.appendSlice(allocator, "#pragma pack_matrix( row_major )\n");
for (air.refToList(air.globals_index)) |inst_idx| {
switch (air.getInst(inst_idx)) {
.@"var" => try hlsl.emitGlobalVar(inst_idx),
@ -938,12 +936,14 @@ fn emitBinary(hlsl: *Hlsl, inst: Inst.Binary) !void {
const rhs_type = hlsl.air.getInst(inst.rhs_type);
if (lhs_type == .matrix or rhs_type == .matrix) {
// matrices are transposed
// TODO(d3d12):
// Changed to column major storage because dxc does not apply same ordering to Storage Buffers.
// matrices are in column major storage
try hlsl.writeAll("mul");
try hlsl.writeAll("(");
try hlsl.emitExpr(inst.rhs);
try hlsl.writeAll(", ");
try hlsl.emitExpr(inst.lhs);
try hlsl.writeAll(", ");
try hlsl.emitExpr(inst.rhs);
try hlsl.writeAll(")");
} else {
try hlsl.emitBinaryOp(inst);