Loading libs/vr/libdisplay/include/private/dvr/late_latch.h +3 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,9 @@ class LateLatch { LateLatchOutput* eds_late_latch_output_; DvrPose* pose_client_; pdx::LocalHandle surface_metadata_fd_; pdx::LocalHandle pose_buffer_fd_; }; } // namespace dvr Loading libs/vr/libdisplay/late_latch.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -252,7 +252,8 @@ LateLatch::LateLatch(bool is_app_late_latch, LocalHandle&& surface_metadata_fd) : is_app_late_latch_(is_app_late_latch), app_late_latch_output_(NULL), eds_late_latch_output_(NULL) { eds_late_latch_output_(NULL), surface_metadata_fd_(std::move(surface_metadata_fd)) { CHECK_GL(); glGenBuffers(1, &input_buffer_id_); glBindBuffer(GL_SHADER_STORAGE_BUFFER, input_buffer_id_); Loading @@ -264,12 +265,11 @@ LateLatch::LateLatch(bool is_app_late_latch, GL_DYNAMIC_COPY); CHECK_GL(); LocalHandle pose_buffer_fd; pose_client_ = dvrPoseCreate(); if (!pose_client_) { ALOGE("LateLatch Error: failed to create pose client"); } else { int ret = privateDvrPoseGetRingBufferFd(pose_client_, &pose_buffer_fd); int ret = privateDvrPoseGetRingBufferFd(pose_client_, &pose_buffer_fd_); if (ret < 0) { ALOGE("LateLatch Error: failed to get pose ring buffer"); } Loading @@ -280,20 +280,20 @@ LateLatch::LateLatch(bool is_app_late_latch, if (!glBindSharedBufferQCOM) { ALOGE("Error: Missing gralloc buffer extension, no pose data"); } else { if (pose_buffer_fd) { if (pose_buffer_fd_) { glBindBuffer(GL_SHADER_STORAGE_BUFFER, pose_buffer_object_); glBindSharedBufferQCOM(GL_SHADER_STORAGE_BUFFER, kPoseAsyncBufferTotalCount * sizeof(DvrPoseAsync), pose_buffer_fd.Release()); pose_buffer_fd_.Get()); } CHECK_GL(); } glBindBuffer(GL_SHADER_STORAGE_BUFFER, metadata_buffer_id_); if (surface_metadata_fd && glBindSharedBufferQCOM) { if (surface_metadata_fd_ && glBindSharedBufferQCOM) { glBindSharedBufferQCOM(GL_SHADER_STORAGE_BUFFER, sizeof(DisplaySurfaceMetadata), surface_metadata_fd.Release()); surface_metadata_fd_.Get()); } else { // Fall back on internal metadata buffer when none provided, for example // when distortion is done in the application process. Loading libs/vr/libvrflinger/compositor.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -246,16 +246,17 @@ void Compositor::RenderTarget::DiscardColorAttachment() { class Compositor::RenderPoseBufferObject { public: RenderPoseBufferObject(LocalHandle&& render_pose_buffer_fd) { RenderPoseBufferObject(LocalHandle&& render_pose_buffer_fd) : fd_(std::move(render_pose_buffer_fd)) { // Create new pose tracking buffer for this surface. glGenBuffers(1, &render_pose_buffer_object_); glBindBuffer(GL_UNIFORM_BUFFER, render_pose_buffer_object_); if (render_pose_buffer_fd) { if (fd_) { LOG_ALWAYS_FATAL_IF(!glBindSharedBufferQCOM); if (glBindSharedBufferQCOM) glBindSharedBufferQCOM(GL_UNIFORM_BUFFER, sizeof(DisplaySurfaceMetadata), render_pose_buffer_fd.Get()); fd_.Get()); else ALOGE("Error: Missing gralloc buffer extension"); CHECK_GL(); Loading @@ -271,6 +272,7 @@ class Compositor::RenderPoseBufferObject { // Render pose buffer object. This contains an array of poses that corresponds // with the surface buffers. GLuint render_pose_buffer_object_; LocalHandle fd_; RenderPoseBufferObject(const RenderPoseBufferObject&) = delete; void operator=(const RenderPoseBufferObject&) = delete; Loading Loading @@ -429,6 +431,7 @@ bool Compositor::InitializeEGL() { } void Compositor::Shutdown() { glFinish(); render_target_[0].Destroy(); render_target_[1].Destroy(); layers_.clear(); Loading Loading
libs/vr/libdisplay/include/private/dvr/late_latch.h +3 −0 Original line number Diff line number Diff line Loading @@ -178,6 +178,9 @@ class LateLatch { LateLatchOutput* eds_late_latch_output_; DvrPose* pose_client_; pdx::LocalHandle surface_metadata_fd_; pdx::LocalHandle pose_buffer_fd_; }; } // namespace dvr Loading
libs/vr/libdisplay/late_latch.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -252,7 +252,8 @@ LateLatch::LateLatch(bool is_app_late_latch, LocalHandle&& surface_metadata_fd) : is_app_late_latch_(is_app_late_latch), app_late_latch_output_(NULL), eds_late_latch_output_(NULL) { eds_late_latch_output_(NULL), surface_metadata_fd_(std::move(surface_metadata_fd)) { CHECK_GL(); glGenBuffers(1, &input_buffer_id_); glBindBuffer(GL_SHADER_STORAGE_BUFFER, input_buffer_id_); Loading @@ -264,12 +265,11 @@ LateLatch::LateLatch(bool is_app_late_latch, GL_DYNAMIC_COPY); CHECK_GL(); LocalHandle pose_buffer_fd; pose_client_ = dvrPoseCreate(); if (!pose_client_) { ALOGE("LateLatch Error: failed to create pose client"); } else { int ret = privateDvrPoseGetRingBufferFd(pose_client_, &pose_buffer_fd); int ret = privateDvrPoseGetRingBufferFd(pose_client_, &pose_buffer_fd_); if (ret < 0) { ALOGE("LateLatch Error: failed to get pose ring buffer"); } Loading @@ -280,20 +280,20 @@ LateLatch::LateLatch(bool is_app_late_latch, if (!glBindSharedBufferQCOM) { ALOGE("Error: Missing gralloc buffer extension, no pose data"); } else { if (pose_buffer_fd) { if (pose_buffer_fd_) { glBindBuffer(GL_SHADER_STORAGE_BUFFER, pose_buffer_object_); glBindSharedBufferQCOM(GL_SHADER_STORAGE_BUFFER, kPoseAsyncBufferTotalCount * sizeof(DvrPoseAsync), pose_buffer_fd.Release()); pose_buffer_fd_.Get()); } CHECK_GL(); } glBindBuffer(GL_SHADER_STORAGE_BUFFER, metadata_buffer_id_); if (surface_metadata_fd && glBindSharedBufferQCOM) { if (surface_metadata_fd_ && glBindSharedBufferQCOM) { glBindSharedBufferQCOM(GL_SHADER_STORAGE_BUFFER, sizeof(DisplaySurfaceMetadata), surface_metadata_fd.Release()); surface_metadata_fd_.Get()); } else { // Fall back on internal metadata buffer when none provided, for example // when distortion is done in the application process. Loading
libs/vr/libvrflinger/compositor.cpp +6 −3 Original line number Diff line number Diff line Loading @@ -246,16 +246,17 @@ void Compositor::RenderTarget::DiscardColorAttachment() { class Compositor::RenderPoseBufferObject { public: RenderPoseBufferObject(LocalHandle&& render_pose_buffer_fd) { RenderPoseBufferObject(LocalHandle&& render_pose_buffer_fd) : fd_(std::move(render_pose_buffer_fd)) { // Create new pose tracking buffer for this surface. glGenBuffers(1, &render_pose_buffer_object_); glBindBuffer(GL_UNIFORM_BUFFER, render_pose_buffer_object_); if (render_pose_buffer_fd) { if (fd_) { LOG_ALWAYS_FATAL_IF(!glBindSharedBufferQCOM); if (glBindSharedBufferQCOM) glBindSharedBufferQCOM(GL_UNIFORM_BUFFER, sizeof(DisplaySurfaceMetadata), render_pose_buffer_fd.Get()); fd_.Get()); else ALOGE("Error: Missing gralloc buffer extension"); CHECK_GL(); Loading @@ -271,6 +272,7 @@ class Compositor::RenderPoseBufferObject { // Render pose buffer object. This contains an array of poses that corresponds // with the surface buffers. GLuint render_pose_buffer_object_; LocalHandle fd_; RenderPoseBufferObject(const RenderPoseBufferObject&) = delete; void operator=(const RenderPoseBufferObject&) = delete; Loading Loading @@ -429,6 +431,7 @@ bool Compositor::InitializeEGL() { } void Compositor::Shutdown() { glFinish(); render_target_[0].Destroy(); render_target_[1].Destroy(); layers_.clear(); Loading