Skip to content

Commit

Permalink
Fixes a number of .Type -> .type (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Srekel authored Jan 18, 2025
1 parent e4217ed commit 3bafa10
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/bindings/d3d12.zig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub const HEAP_PROPERTIES = extern struct {
pub fn initType(heap_type: HEAP_TYPE) HEAP_PROPERTIES {
var v = std.mem.zeroes(@This());
v = HEAP_PROPERTIES{
.Type = heap_type,
.type = heap_type,
.CPUPageProperty = .UNKNOWN,
.MemoryPoolPreference = .UNKNOWN,
.CreationNodeMask = 0,
Expand Down Expand Up @@ -583,7 +583,7 @@ pub const RESOURCE_BARRIER = extern struct {

pub fn initUav(resource: *IResource) RESOURCE_BARRIER {
var v = std.mem.zeroes(@This());
v = .{ .Type = .UAV, .Flags = .{}, .u = .{ .UAV = .{ .pResource = resource } } };
v = .{ .type = .UAV, .Flags = .{}, .u = .{ .UAV = .{ .pResource = resource } } };
return v;
}
};
Expand Down
26 changes: 13 additions & 13 deletions src/zd3d12.zig
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ pub const GraphicsContext = struct {
const cmdqueue = blk: {
var cmdqueue: *d3d12.ICommandQueue = undefined;
hrPanicOnFail(device.CreateCommandQueue(&.{
.Type = .DIRECT,
.type = .DIRECT,
.Priority = @intFromEnum(d3d12.COMMAND_QUEUE_PRIORITY.NORMAL),
.Flags = .{},
.NodeMask = 0,
Expand Down Expand Up @@ -1175,7 +1175,7 @@ pub const GraphicsContext = struct {
for (gctx.transition_resource_barriers.items) |barrier| {
if (gctx.resource_pool.isResourceValid(barrier.resource)) {
d3d12_barriers[num_valid_barriers] = .{
.Type = .TRANSITION,
.type = .TRANSITION,
.Flags = .{},
.u = .{
.Transition = .{
Expand Down Expand Up @@ -1604,11 +1604,11 @@ pub const GraphicsContext = struct {

gctx.cmdlist.CopyTextureRegion(&.{
.pResource = gctx.lookupResource(texture).?,
.Type = .SUBRESOURCE_INDEX,
.type = .SUBRESOURCE_INDEX,
.u = .{ .SubresourceIndex = subresource },
}, 0, 0, 0, &.{
.pResource = upload.buffer,
.Type = .PLACED_FOOTPRINT,
.type = .PLACED_FOOTPRINT,
.u = .{ .PlacedFootprint = layout[0] },
}, null);
}
Expand Down Expand Up @@ -1642,11 +1642,11 @@ pub const GraphicsContext = struct {

gctx.cmdlist.CopyTextureRegion(&d3d12.TEXTURE_COPY_LOCATION{
.pResource = gctx.lookupResource(texture).?,
.Type = .SUBRESOURCE_INDEX,
.type = .SUBRESOURCE_INDEX,
.u = .{ .SubresourceIndex = 0 },
}, 0, 0, 0, &d3d12.TEXTURE_COPY_LOCATION{
.pResource = upload.buffer,
.Type = .PLACED_FOOTPRINT,
.type = .PLACED_FOOTPRINT,
.u = .{ .PlacedFootprint = layout[0] },
}, null);

Expand Down Expand Up @@ -1781,11 +1781,11 @@ pub const GraphicsContext = struct {

gctx.cmdlist.CopyTextureRegion(&d3d12.TEXTURE_COPY_LOCATION{
.pResource = gctx.lookupResource(texture).?,
.Type = .SUBRESOURCE_INDEX,
.type = .SUBRESOURCE_INDEX,
.u = .{ .SubresourceIndex = 0 },
}, 0, 0, 0, &d3d12.TEXTURE_COPY_LOCATION{
.pResource = upload.buffer,
.Type = .PLACED_FOOTPRINT,
.type = .PLACED_FOOTPRINT,
.u = .{ .PlacedFootprint = layout[0] },
}, null);

Expand Down Expand Up @@ -1886,11 +1886,11 @@ pub const GraphicsContext = struct {

gctx.cmdlist.CopyTextureRegion(&.{
.pResource = gctx.lookupResource(texture).?,
.Type = .SUBRESOURCE_INDEX,
.type = .SUBRESOURCE_INDEX,
.u = .{ .SubresourceIndex = subresource_index },
}, 0, 0, 0, &.{
.pResource = upload.buffer,
.Type = .PLACED_FOOTPRINT,
.type = .PLACED_FOOTPRINT,
.u = .{ .PlacedFootprint = layout[0] },
}, null);
}
Expand Down Expand Up @@ -2182,13 +2182,13 @@ pub const MipmapGenerator = struct {
while (mip_index < dispatch_num_mips) : (mip_index += 1) {
const dst = d3d12.TEXTURE_COPY_LOCATION{
.pResource = gctx.lookupResource(texture_handle).?,
.Type = .SUBRESOURCE_INDEX,
.type = .SUBRESOURCE_INDEX,
.u = .{ .SubresourceIndex = mip_index + 1 + current_src_mip_level +
array_slice * texture_desc.MipLevels },
};
const src = d3d12.TEXTURE_COPY_LOCATION{
.pResource = gctx.lookupResource(mipgen.scratch_textures[mip_index]).?,
.Type = .SUBRESOURCE_INDEX,
.type = .SUBRESOURCE_INDEX,
.u = .{ .SubresourceIndex = 0 },
};
const box = d3d12.BOX{
Expand Down Expand Up @@ -2489,7 +2489,7 @@ const DescriptorHeap = struct {
const heap = blk: {
var heap: ?*d3d12.IDescriptorHeap = null;
hrPanicOnFail(device.CreateDescriptorHeap(&.{
.Type = heap_type,
.type = heap_type,
.NumDescriptors = capacity,
.Flags = flags,
.NodeMask = 0,
Expand Down

0 comments on commit 3bafa10

Please sign in to comment.