Skip to content

Commit 32f55c2

Browse files
committed
Use upload_via_mapping instead of write_buffer in RendererD3D9
1 parent 9b366e2 commit 32f55c2

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

pathfinder/core/d3d9/renderer.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ uint64_t RendererD3D9::upload_fills(const std::vector<Fill> &fills,
399399

400400
auto fill_vertex_buffer_id = allocator->allocate_buffer(byte_size, BufferType::Vertex, "fill vertex buffer");
401401

402-
encoder->write_buffer(allocator->get_buffer(fill_vertex_buffer_id), 0, byte_size, fills.data());
402+
allocator->get_buffer(fill_vertex_buffer_id)->upload_via_mapping(byte_size, 0, fills.data());
403403

404404
return fill_vertex_buffer_id;
405405
}
@@ -424,7 +424,7 @@ uint64_t RendererD3D9::upload_tiles(const std::vector<TileObjectPrimitive> &tile
424424

425425
auto tile_vertex_buffer_id = allocator->allocate_buffer(byte_size, BufferType::Vertex, "tile vertex buffer");
426426

427-
encoder->write_buffer(allocator->get_buffer(tile_vertex_buffer_id), 0, byte_size, tiles.data());
427+
allocator->get_buffer(tile_vertex_buffer_id)->upload_via_mapping(byte_size, 0, tiles.data());
428428

429429
return tile_vertex_buffer_id;
430430
}
@@ -481,7 +481,7 @@ void RendererD3D9::draw_fills(uint64_t fill_vertex_buffer_id,
481481
fill_uniform.framebuffer_size = {MASK_FRAMEBUFFER_WIDTH,
482482
(float)(MASK_FRAMEBUFFER_HEIGHT * mask_storage.allocated_page_count)};
483483

484-
encoder->write_buffer(allocator->get_buffer(fill_ub_id), 0, sizeof(FillUniformD3d9), &fill_uniform);
484+
allocator->get_buffer(fill_ub_id)->upload_via_mapping(sizeof(FillUniformD3d9), 0, &fill_uniform);
485485

486486
encoder->begin_render_pass(mask_render_pass_clear, allocator->get_texture(*mask_storage.texture_id), ColorF());
487487

@@ -508,7 +508,7 @@ ClipBufferInfo RendererD3D9::upload_clip_tiles(const std::vector<Clip> &clips,
508508

509509
auto clip_buffer_id = allocator->allocate_buffer(byte_size, BufferType::Vertex, "clip buffer");
510510

511-
encoder->write_buffer(allocator->get_buffer(clip_buffer_id), 0, byte_size, clips.data());
511+
allocator->get_buffer(clip_buffer_id)->upload_via_mapping(byte_size, 0, clips.data());
512512

513513
return {clip_buffer_id, clip_count};
514514
}
@@ -649,10 +649,8 @@ void RendererD3D9::draw_tiles(uint64_t tile_vertex_buffer_id,
649649

650650
// We don't need to preserve the data until the upload commands are implemented because
651651
// these uniform buffers are host-visible/coherent.
652-
encoder->write_buffer(allocator->get_buffer(tile_ub_id),
653-
tile_uniform_offset,
654-
sizeof(TileUniformD3d9),
655-
&tile_uniform);
652+
allocator->get_buffer(tile_ub_id)
653+
->upload_via_mapping(sizeof(TileUniformD3d9), tile_uniform_offset, &tile_uniform);
656654
}
657655

658656
// Update descriptor set.

0 commit comments

Comments
 (0)