A render encoder now draws. It holds Metal's render state (a pipeline state, the
vertex and fragment functions' buffers, bytes, textures and sampler states, one
viewport and scissor rectangle, cull mode, winding, a depth-stencil state, the
stencil references and the blend color) and records draw_primitives and
draw_indexed_primitives as one vkCmdDraw or vkCmdDrawIndexed each, setting the
dynamic state that changed and pushing each function's fields in the one push
range. Draws take no barrier, as Metal orders none within an encoder.
- render: a content's Draws (slots with accesses, push fields, vertex bindings),
derived from the translator's interface; a state numbers its functions'
samplers through the compute path's numbering (number_samplers), so
new_render_pipeline_state takes sampler_ids, and RenderPipelineKind::Samplers
goes; DrawInput refuses what a draw does not supply. Vertex strides are baked
(the descriptor key holds them): VERTEX_INPUT_BINDING_STRIDE leaves the dynamic
states, so a per-bind stride is refused by DynamicState. The line class's
pipeline is made at its first draw, a first-use wait.
- pass: both store actions store, so a pass can end its rendering early (a memory
barrier after a draw that wrote memory, or a copy a draw needs first) and begin
it again with LOAD; Pass::begin serves both.
- PUSH_STAGES: one constant for the layout's push range and every push.
- Device::new_depth_stencil_state; IndexBuffer, Viewport, ScissorRect; Refusal
VertexBufferOffset, IndexBufferOffset, ViewportNotFinite, StencilAttachment;
Gap::Draw with DrawKind (Points, DepthTest, Viewport, AttachmentFormats,
AttachmentRead).
- ring: a write answers its block buffer and offset, so set_vertex_bytes feeds
fixed-function vertex input.
- harness: one sampler_ids for compute and render states.
The census of the gb and b2 render contents (m3-max-44704) set the scope: every
translated content reads only SlotGuestBase and ConstexprSampler fields, facts
AddressAlignment, DeviceAddresses and MovableStorageWrites, no parameter block,
writes no memory; 146 of 267 number samplers; 93 have one vertex binding.
Tests: host tests for the viewport mapping; device tests for triangles where
Metal's clip space puts them (direct, indexed through a scissor, through a
viewport; 3 barriers, no pipeline made, no bytes copied), the line pipeline made
once, stencil replace and test, a constexpr sampler sampling each texel,
stage_in from a buffer and from bytes, and the refusals and gaps. Not yet run.