# PVRTexLib - Texture with mipmap count zero

**URL:** <https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800>\
**Category:** PowerVR Insider\
**Tags:** pvrtextool\
**Created:** [May 29, 2013, 11:12am UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800 "2013-05-29T11:12:10Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![neha31gupta](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@neha31gupta](https://forums.imgtec.com/u/neha31gupta)\
**Post date:** [May 29, 2013, 11:12am UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800/1 "2013-05-29T11:12:10Z")

</div>

Hi,  
  
  
  
I am trying to create top level non-mip-mapped texture. I am using PVRTexLib version 4.5.  
  
  
  
In order to achieve this, i am setting u32MIPMapCount as 0 while creating CPVRTextureHeader object.

* * *
CPVRTextureHeader sHeader(PVRStandard8PixelType.PixelTypeID,  
256, // u32Height,  
256, // u32Width,  
1,  
0, //mipmap count  
1,  
1, //cubemap  
ePVRTCSpacesRGB,  
ePVRTVarTypeUnsignedByteNorm,  
false);  
  
CPVRTexture sCompressedTexture(sHeader);
* * *
  
When i try to access data pointer of this texture using below code, i get null pointer.
* * *
void \*p = sCompressedTexture.getDataPtr(0,0,0);  
if(!p)  
{  
std::cout \<\< "p is nulln";  
}
* * *
  
Data pointer of texture is perfectly fine if i set u32MIPMapCount as 1 while creating CPVRTextureHeader object. But this will create top level plus one extra mipmap level.  
  
Please confirm how can i get the correct data pointer for top level non-mip-mapped texture (u32MIPMapCount = 0).

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [May 29, 2013, 11:44am UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800/2 "2013-05-29T11:44:42Z")

</div>

Hi Neha31Gupta,  
  
  
  
The top level of a texture is included in the “number of mip maps”, so you actually want to set it to 1, rather than 0. 1 actually does just mean the top level, and no additional mip maps.  
  
  
  
Thanks,  
  
Tobias

---

<div class="post-metadata">

**Author:** ![neha31gupta](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@neha31gupta](https://forums.imgtec.com/u/neha31gupta)\
**Post date:** [May 30, 2013, 2:51am UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800/3 "2013-05-30T02:51:08Z")

</div>

As per “PVRTexTool.User Manual.pdf” (section 5.4.1) - ‘u32MIPMapCount’ is the number of MIP-map sublevels present in addition to the top level: 0 means that only a top level non-MIP-mapped texture exists, 1 means the top level plus an extra MIP-map level, etc.  
  
  
  
Am i missing something?

---

<div class="post-metadata">

**Author:** ![neha31gupta](https://avatars.discourse-cdn.com/v4/letter/n/9de0a6/32.png) [@neha31gupta](https://forums.imgtec.com/u/neha31gupta)\
**Post date:** [June 3, 2013, 3:34am UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800/4 "2013-06-03T03:34:25Z")

</div>

I am blocked due to this issue. Can some body please answer my query?

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [June 3, 2013, 8:29am UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800/5 "2013-06-03T08:29:05Z")

</div>

Hi,  
  
  
  
Have you tried setting the value of “u32MIPMapCount” to 1 as Tobias suggested? Tobias is the lead engineer for TexTool, so I suspect the documentation may have an error in it.  
  
  
  
Thanks,  
  
Joe

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [June 10, 2013, 3:23pm UTC](https://forums.imgtec.com/t/pvrtexlib-texture-with-mipmap-count-zero/1800/6 "2013-06-10T15:23:41Z")

</div>

Hi Neha,  
  
  
  
Sorry I was ill last week so didn’t get around to answering this - there is in fact a bug in the documentation as Joe suggested, not entirely sure how it got there but I’ll see that it gets fixed. What I said in my post is correct, the document is wrong.  
  
  
  
Regards,  
  
Tobias
