Skip to content

Commit a74d77e

Browse files
authored
Merge pull request #908 from smallfx/jxn-v3
Properly set scissor coordinates in Metal backend
2 parents 75efc45 + 0bef756 commit a74d77e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

backends/gpu/metal/sources/commandlist.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,10 @@ void kore_metal_command_list_trace_rays(kore_gpu_command_list *list, uint32_t wi
385385

386386
void kore_metal_command_list_set_viewport(kore_gpu_command_list *list, float x, float y, float width, float height, float min_depth, float max_depth) {}
387387

388-
void kore_metal_command_list_set_scissor_rect(kore_gpu_command_list *list, uint32_t x, uint32_t y, uint32_t width, uint32_t height) {}
388+
void kore_metal_command_list_set_scissor_rect(kore_gpu_command_list *list, uint32_t x, uint32_t y, uint32_t width, uint32_t height) {
389+
id<MTLRenderCommandEncoder> render_command_encoder = (__bridge id<MTLRenderCommandEncoder>)list->metal.render_command_encoder;
390+
[render_command_encoder setScissorRect:(MTLScissorRect){x, y, width, height}];
391+
}
389392

390393
void kore_metal_command_list_set_blend_constant(kore_gpu_command_list *list, kore_gpu_color color) {}
391394

0 commit comments

Comments
 (0)