Forums - Sample Code for GL_QCOM_motion_estimation

8 posts / 0 new
Last post
Sample Code for GL_QCOM_motion_estimation
naveenkumar.p
Join Date: 19 Sep 19
Posts: 2
Posted: Wed, 2021-03-10 12:05

Is there any sample code for using QCOM OpenGL motions estimation extension? I couldn't find any on Adreno SDK or anywhere online.

The extension is discussed briefly in the blog post here: https://developer.qualcomm.com/blog/improving-vr-performance-using-motio...

 

The OpenGL QCOM entry is here: https://www.khronos.org/registry/OpenGL/extensions/QCOM/QCOM_motion_esti...

  • Up0
  • Down0
naveenkumar.p
Join Date: 19 Sep 19
Posts: 2
Posted: Sun, 2021-03-14 22:18

In particular, I am trying to figure out when to call glTexEstimateMotionQCOM, is there any binding/sync required and when the output will be ready.  The extension says "The resulting motion vectors .... ready to be used by other application shaders and stages". Does it mean that the motion vectors will be available right after calling glTexEstimateMotionQCOM. In a native application, I called the function for two textures (backed by EGLImages), and bound the output texture (created using GL_RGBA16F format) to a framebuffer to read the motion vectors using glReadPixels into a float buffer. The motions are are all zero. To check the function for error cases, I tried passing invalid textures to the function.  It didn't generate any INVALID_OPERATION error. No error in 'adb logcat' too. I confirmed that the extension is supported from glGetString(GL_EXTENSIONS). In short, the API glTexEstimateMotionQCOM had no effect. Any help is appreciated.

  • Up0
  • Down0
zbigniew.nastalski
Join Date: 24 Sep 21
Posts: 1
Posted: Fri, 2021-09-24 02:32

naveenkumar.p

Were you able to find the sample code? I am also looking for it without much success. Any help would be appreciated.
Thanks
Zee

 

 

  • Up0
  • Down0
tvkamara
Join Date: 30 Mar 22
Posts: 2
Posted: Wed, 2022-03-30 13:22

I am also looking for any sample code that would utilize GL_QCOM_motion_estimation. I'm currently trying to use the extension on a GLSL shader in Unity. When starting my application I can see GL_QCOM_motion_estimation in the list of extensions.

And in my shader I have:

#extension GL_QCOM_motion_estimation : require

For some reason I get:

AdrenoGLES-0: ERROR: 0:7: '' :     GLSL error: extension 'GL_QCOM_motion_estimation' is not supported
    ERROR: 0:13: '' :     GLSL error: extension 'GL_QCOM_motion_estimation' is not supported
    ERROR: 2 compilation errors.  No code generated.
 
even though the extension is listed when the application starts. Any ideas what could be causing this?
 
  • Up0
  • Down0
DuBo
Join Date: 9 Dec 13
Posts: 72
Posted: Thu, 2022-04-21 23:48

Dear tvkamara

This extension is for GL API usage, not for GLSL shader. 

So you cannot use it in GLSL shader like "#extension GL_QCOM_motion_estimation : require".

Please study more from https://www.khronos.org/registry/OpenGL/extensions/QCOM/QCOM_motion_esti...

 

Thanks
Bob Du

 

 

  • Up0
  • Down0
DuBo
Join Date: 9 Dec 13
Posts: 72
Posted: Fri, 2022-04-22 00:01

Dear naveenkumar.p

1. The motion vectorrs should be ready once the calling of glTexEstimateMotionQCOM() return.

2. As for your below experiments, what are the 2 textures you used? Are they GL_8 format 2D Textures  or Luminuance data of EGLImage as required by spec?

>> In a native application, I called the function for two textures (backed by EGLImages), and bound the output texture (created using >>GL_RGBA16F format) to a framebuffer to read the motion vectors using glReadPixels into a float buffer. The motions are are all zero.

spec:

    void TexEstimateMotionQCOM(uint ref,
                               uint target,
                               uint output);

    void TexEstimateMotionRegionsQCOM(uint ref,
                                      uint target,
                                      uint output,
                                      uint mask);

    are called to perfom the motion estimation based on the contents of the two input
    textures, <ref> and <target>.  The results of the motion estimation are stored in
    the <output> texture.

    The <ref> and <target> must be either be GL_R8 2D textures, or backed by EGLImages where
    the underlying format contain a luminance plane.  The <ref> and <target> dimension must
    be identical and must be an exact multiple of the search block size.  While <ref> and <target>
    can have multiple levels, the implementation only reads from the base level.

 

Thanks
Bob Du

  • Up0
  • Down0
vyd208
Join Date: 10 Jan 22
Posts: 1
Posted: Mon, 2022-08-08 08:29

 I have tried to implement the extension for a snapdragon 888 with adreno 660 and the latest android NDK, but there doesn't seem to be a version of the opengl ES library within the NDK that contains the extension. I have checked that the extension exists on the device, but I cannot access the extension through the opengl ES headers currently in the NDK. Has a sample app already been published or going to published soon? Any help would be greatly appreciated.

  • Up0
  • Down0
DuBo
Join Date: 9 Dec 13
Posts: 72
Posted: Wed, 2022-11-30 00:47

Dear Customer


Can you get the API function poitner from eglGetProcAddress("glTexEstimateMotionQCOM")?

Thanks
Bob Du

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.