Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added helpers:
fn checkFeatureSupport(gctx: *GraphicsContext, comptime feature: d3d12.FEATURE, data: anytype) HResultError!void
Purpose: Compile time check to ensure correct data is passed in for feature.
HResultError
instead ofHRESULT
.fn allocRenderTargetView(gctx: *GraphicsContext, handle: ResourceHandle, desc: ?*const d3d12.RENDER_TARGET_VIEW_DESC) d3d12.CPU_DESCRIPTOR_HANDLE
Purpose: Use
zd3d12.ResourceHandle
instead ofd3d12.IResource
. Allocate required.RTV
cpu descriptor and returns it.fn allocDepthStencilView(gctx: *GraphicsContext, handle: ResourceHandle, desc: ?*const d3d12.DEPTH_STENCIL_VIEW_DESC) d3d12.CPU_DESCRIPTOR_HANDLE
Purpose: Use
zd3d12.ResourceHandle
instead ofd3d12.IResource
. Allocate required.DSV
cpu descriptor and returns it.fn createRootSignature(gctx: *GraphicsContext, node_mask: w32.UINT, signature: *d3d.IBlob) HResultError!*d3d12.IRootSignature
Purpose: Take in signature
IBlob
instead of pointer and size. Return*IRootSignature
instead of out pointer.HResultError
instead ofHRESULT
.fn writeResource(gctx: *GraphicsContext, comptime T: type, destination: ResourceHandle, source: []const T) HResultError!void
Purpose: Simplify writing a slice to a resource instead of manually mapping and unmapping a byte array.
fn clearRenderTargetView(gctx: *GraphicsContext, rt_view: d3d12.CPU_DESCRIPTOR_HANDLE, rgba: *const [4]w32.FLOAT, rects: []const w32.RECT) void
Purpose:
RECT
slice instead of a length and pointer.fn clearDepthStencilView(gctx: *GraphicsContext, ds_view: d3d12.CPU_DESCRIPTOR_HANDLE, clear_flags: d3d12.CLEAR_FLAGS, depth: w32.FLOAT, stencil: w32.UINT8, rects: []const w32.RECT) void
Purpose:
RECT
slice instead of a length and pointer.fn omSetRenderTargets(gctx: *GraphicsContext, render_target_descriptors: []const d3d12.CPU_DESCRIPTOR_HANDLE, single_handle: bool, ds_descriptors: ?*const d3d12.CPU_DESCRIPTOR_HANDLE) void
Purpose:
CPU_DESCRIPTOR_HANDLE
slice instead of a length and pointer.bool
instead ofBOOL
.fn rsSetViewports(gctx: *GraphicsContext, viewports: []const d3d12.VIEWPORT)
Purpose:
VIEWPORT
slice instead of a length and pointer.fn rsSetScissorRects(gctx: *GraphicsContext, rects: []const d3d12.RECT)
Purpose:
RECT
slice instead of a length and pointer.fn iaSetPrimitiveTopology(gctx: *GraphicsContext, topology: d3d12.PRIMITIVE_TOPOLOGY) void
Purpose: Passthrough to get rid of last usage of
gctx.cmdlist
in simple_openvr samplefn iaSetVertexBuffers(gctx: *GraphicsContext, start_slot: w32.UINT, views: []const d3d12.VERTEX_BUFFER_VIEW)
Purpose:
VERTEX_BUFFER_VIEW
slice instead of a length and pointer.fn iaSetIndexBuffer(gctx: *GraphicsContext, view: ?*const d3d12.INDEX_BUFFER_VIEW) void
Purpose: Passthrough to get rid of last usage of
gctx.cmdlist
in simple_openvr samplefn setGraphicsRootConstantBufferView(gctx: *GraphicsContext, index: w32.UINT, handle: ResourceHandle) void
Purpose:
zd3d12.ResourceHandle
instead ofd3d12.IResource
.fn drawInstanced(gctx: *GraphicsContext, vertex_count_per_instance: w32.UINT, instance_count: w32.UINT, start_vertex_location: w32.UINT, start_instance_location: w32.UINT) void
Purpose: Passthrough to get rid of last usage of
gctx.cmdlist
in simple_openvr samplefn drawIndexedInstanced(gctx: *GraphicsContext, index_count_per_instance: w32.UINT, instance_count: w32.UINT, start_index_location: w32.UINT, base_vertex_location: w32.INT, start_instance_location: w32.UINT) void
Purpose: Passthrough to get rid of last usage of
gctx.cmdlist
in simple_openvr samplefn serializeVersionedRootSignature(root_signature_desc: *const d3d12.VERSIONED_ROOT_SIGNATURE_DESC) HResultError!*d3d.IBlob
Purpose: Returns
IBlob
instead of out pointer.HResultError
instead ofHRESULT
.