summaryrefslogtreecommitdiffstats
path: root/servers/visual/rasterizer_rd/light_cluster_builder.cpp
diff options
context:
space:
mode:
authorJuan Linietsky <juan@godotengine.org>2020-02-17 18:06:54 -0300
committerJuan Linietsky <reduzio@gmail.com>2020-02-18 10:10:36 +0100
commit3205a92ad872f918c8322cdcd1434c231a1fd251 (patch)
treedb44242ca27432eb8ea849679752d0835d2ae41a /servers/visual/rasterizer_rd/light_cluster_builder.cpp
parentfb8c93c10b4b73d5f18f1ed287497728800e22b5 (diff)
downloadredot-engine-3205a92ad872f918c8322cdcd1434c231a1fd251.tar.gz
PoolVector is gone, replaced by Vector
Typed `PoolTypeArray` types are now renamed `PackedTypeArray` and are sugar for `Vector<Type>`.
Diffstat (limited to 'servers/visual/rasterizer_rd/light_cluster_builder.cpp')
-rw-r--r--servers/visual/rasterizer_rd/light_cluster_builder.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/servers/visual/rasterizer_rd/light_cluster_builder.cpp b/servers/visual/rasterizer_rd/light_cluster_builder.cpp
index 78011c22cc..943ef1c7fa 100644
--- a/servers/visual/rasterizer_rd/light_cluster_builder.cpp
+++ b/servers/visual/rasterizer_rd/light_cluster_builder.cpp
@@ -47,8 +47,8 @@ void LightClusterBuilder::bake_cluster() {
float slice_depth = (z_near - z_far) / depth;
- PoolVector<uint8_t>::Write cluster_dataw = cluster_data.write();
- Cell *cluster_data_ptr = (Cell *)cluster_dataw.ptr();
+ uint8_t *cluster_dataw = cluster_data.ptrw();
+ Cell *cluster_data_ptr = (Cell *)cluster_dataw;
//clear the cluster
zeromem(cluster_data_ptr, (width * height * depth * sizeof(Cell)));
@@ -160,8 +160,7 @@ void LightClusterBuilder::bake_cluster() {
//print_line("offset: " + itos(offset));
/* Step 3, Place item lists */
- PoolVector<uint32_t>::Write idsw = ids.write();
- uint32_t *ids_ptr = idsw.ptr();
+ uint32_t *ids_ptr = ids.ptrw();
for (uint32_t i = 0; i < sort_id_count; i++) {
const SortID &id = sort_ids[i];
@@ -173,12 +172,8 @@ void LightClusterBuilder::bake_cluster() {
cell.item_pointers[id.item_type] = pointer | ((counter + 1) << COUNTER_SHIFT);
}
- cluster_dataw = PoolVector<uint8_t>::Write();
-
RD::get_singleton()->texture_update(cluster_texture, 0, cluster_data, true);
RD::get_singleton()->buffer_update(items_buffer, 0, offset * sizeof(uint32_t), ids_ptr, true);
-
- idsw = PoolVector<uint32_t>::Write();
}
void LightClusterBuilder::setup(uint32_t p_width, uint32_t p_height, uint32_t p_depth) {