<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: Freeing memory after glTexDirectVIVMap</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768020#M119293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this going to help you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/433086"&gt;https://community.nxp.com/thread/433086&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Apr 2018 14:38:46 GMT</pubDate>
    <dc:creator>Bio_TICFSL</dc:creator>
    <dc:date>2018-04-30T14:38:46Z</dc:date>
    <item>
      <title>Freeing memory after glTexDirectVIVMap</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768019#M119292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using an iMX6.Quad&lt;/P&gt;&lt;P&gt;I need to load quickly some 2048x2048 textures into the GPU Mem and the glTexDirectVIVMap extension is perfect for this purpose (Note: once in the GPU Mem, those textures do not need some refresh).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure about how to release the memory.&lt;/P&gt;&lt;P&gt;What am I doing is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;uchar* pData = new uchar[memsize]; //pData is 64bits aligned&lt;/P&gt;&lt;P&gt;GLuint&amp;nbsp;&lt;SPAN style="background-color: #f6f6f6;"&gt;iPhysical = ~0U;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[...] // Filling pData with some data&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;glGenTextures(&lt;/SPAN&gt;&lt;SPAN style="color: #272ad8;"&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;, &amp;amp;iTex);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;glBindTexture(GL_TEXTURE_2D, iTex);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt; &lt;/SPAN&gt;glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;glTexDirectVIVMap(GL_TEXTURE_2D, 2048, 2048, GL_VIV_UYVY, (GLvoid**)&amp;amp;pData, &amp;amp;iPhysical);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;glTexDirectInvalidateVIV(GL_TEXTURE_2D);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;[...] // Using the texture with some GL&amp;nbsp;instructions&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0.0px 0.0px 0.0px 0.0px;"&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is working pretty well.&lt;/P&gt;&lt;P&gt;When&amp;nbsp;the texture need to be released, I am just deleting it with: delete[] pData.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question is:&lt;/P&gt;&lt;P&gt;Do I need to call glDeleteTextures(1, &amp;amp;iTex) to tell the GLES2 engine that the texture does not exist anymore? Or How can I be sure that the GPU wont use this shared memory space anymore?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since I am using glTexDirectVIVMap, instead of glTexImage2D, my app crash because of the memory used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 08:07:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768019#M119292</guid>
      <dc:creator>gsoft</dc:creator>
      <dc:date>2018-04-25T08:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing memory after glTexDirectVIVMap</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768020#M119293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Fabien,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I guess this going to help you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/thread/433086"&gt;https://community.nxp.com/thread/433086&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 14:38:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768020#M119293</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2018-04-30T14:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Freeing memory after glTexDirectVIVMap</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768021#M119294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your reply. Yes indeed, the crash seems to be related with&amp;nbsp;the memory leak of the 3.0.35. We are currently patching our kernel to check if the problem is fixed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Beyond the memory leak, what is the best way to release the memory after a glTexDirectVIVMAP? Should the memory be released with glDeleteTexures or with delete [] or with both?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fabien&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Apr 2018 15:34:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/Freeing-memory-after-glTexDirectVIVMap/m-p/768021#M119294</guid>
      <dc:creator>gsoft</dc:creator>
      <dc:date>2018-04-30T15:34:17Z</dc:date>
    </item>
  </channel>
</rss>

