Fix janky pose
It's introduced through ag/1980993, where render_buffer_index_ was not
managed after the refactor.
Bug: 36194745
Test: Build and flash, pose is no longer janky.
Change-Id: I6ef86625dbc1c1afd2725614062f5e40e1b7f60a
diff --git a/libs/vr/libvrflinger/display_surface.h b/libs/vr/libvrflinger/display_surface.h
index feb173e..d31a3a9 100644
--- a/libs/vr/libvrflinger/display_surface.h
+++ b/libs/vr/libvrflinger/display_surface.h
@@ -60,10 +60,7 @@
}
}
- uint32_t GetRenderBufferIndex(int buffer_id) {
- return buffer_id_to_index_[buffer_id];
- }
-
+ uint32_t GetRenderBufferIndex(int buffer_id);
bool IsBufferAvailable();
bool IsBufferPosted();
AcquiredBuffer AcquireCurrentBuffer();
@@ -172,6 +169,8 @@
float manager_blur_;
int layer_order_;
+ // The monotonically increasing index for allocated buffers in this surface.
+ uint32_t allocated_buffer_index_;
// Maps from the buffer id to the corresponding allocated buffer index.
std::unordered_map<int, uint32_t> buffer_id_to_index_;
};