Quantcast
Channel: Processors forum - Recent Threads
Viewing all articles
Browse latest Browse all 17527

TDA2PXEVM: EGL: the difference between GL_TEXTURE_EXTERNAL_OES and GL_TEXTURE_2D

$
0
0

Part Number:TDA2PXEVM

Hello:

  Our source code use the GL_TEXTURE_2D to bind 

for (i = 0; i < 4; i++)
    {
        if (0 == i)
        {
            glActiveTexture(GL_TEXTURE0); 
        }
        else if (1 == i)
        {
            glActiveTexture(GL_TEXTURE1); 
        }
        else if (2 == i)
        {
            glActiveTexture(GL_TEXTURE2); 
        }
        else
        {
            glActiveTexture(GL_TEXTURE3); 
        }
        glBindTexture( GL_TEXTURE_2D, texYuv[i]);

And in VisionSDK it will use GL_TEXTURE_EXTERNAL_OES 

    glGenTextures(1, &pObj->texYuv[texIndex]);
    System_eglCheckGlError("glGenTextures ");
    printf("andy debug: gen texture ID %d  texIndex %d  dmaBufFd %d \n", pObj->texYuv[texIndex],texIndex,dmaBufFd);

    glBindTexture(GL_TEXTURE_EXTERNAL_OES, pObj->texYuv[texIndex]);
    System_eglCheckGlError("glBindTexture");

    glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    System_eglCheckGlError("glTexParameteri");

and in vision_sdk\apps\src\hlos\modules\sgxRenderUtils\src.cpp

#ifndef STANDALONE
	glBindTexture(GL_TEXTURE_EXTERNAL_OES, texYuv[tex2]);
	glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#else
	glBindTexture(GL_TEXTURE_2D, texYuv[tex2]);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
#endif

Can anyone introduce the difference between GL_TEXTURE_EXTERNAL_OES and GL_TEXTURE_2D,

And how to transfer GL_TEXTURE_2D to GL_TEXTURE_EXTERNAL_OES .


Viewing all articles
Browse latest Browse all 17527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>