Imagination PowerVR SDK Blog

glTexStorage2D( GL_TEXTURE_CUBE_MAP ... ) issue with PVRVFrame

pvrvframe
pvrtrace

#1

According to the GLES 3.0 spec, it appears that the following GL call is valid for cube maps (see section 3.8.4 on pg. 137):



glTexStorage2D( GL_TEXTURE_CUBE_MAP, 1, GL_RGBA8, 512, 512 )



This usage is also described in GL-land (ARB_texture_storage ext spec, OpenGL Programming Guide, etc.). Interestingly though, the OpenGL ES 3.0 Programming Guide appears to have it wrong!



However, when fed the above, PVRVFrame emulation libs (v3.3 or 3.4) throw a GL_INVALID_ENUM error for the above, causing the subsequent glTexSubImage2D calls on the faces to fail. Just to confirm, this is a bug in the emulator, right? If not already known, could you file a bug report to get this fixed? Thanks!



In the meantime, I’ll fall back to using glTexImage2D on the cube map faces as a work-around.


#2

Hi Dark_Photon, thanks for reporting this. Definitely looks like a bug so I’ll file a report for it.


#3

Ok. Thanks, Chris!


#4

I’m having trouble reproducing this behaviour here. My test case is very simple though:



/* … set up an ES 3.0 context … */



GLuint t = 0;

glGenTextures(1, &t);

glBindTexture(GL_TEXTURE_CUBE_MAP, t);

glTexStorage2D(GL_TEXTURE_CUBE_MAP, 1, GL_RGBA8, 512, 512);



assert(glGetError() == GL_NO_ERROR);



Is there any more context to this problem which you think I should know about?


#5

Hey Chris, sorry for the delay in responding.



I can’t add too much to that. In the PVRTrace log (SDK 3.4), I see:







eglCreateContext( EGLDisplay( 107578256 ), EGLConfig( 2 ), EGL_NO_CONTEXT, { EGL_CONTEXT_CLIENT_VERSION : 3 } ) : EGLContext(1)



… Hundreds of lines of EGL+GL calls omitted here



glGenTextures( 1, { 89 } )

glBindTexture( GL_TEXTURE_CUBE_MAP, 89 )

glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_LINEAR )

glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MIN_FILTER, GL_LINEAR )

glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE )

glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE )

glTexParameteri( GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE )

glTexStorage2D( GL_TEXTURE_CUBE_MAP, 1, GL_RGBA8, 512, 512 ) ! GL_INVALID_ENUM





This is the first GL error.


#6

Hey Dark_Photon, which graphics card are you using? I’ve tested this on both an AMD and NVIDIA card but both quite beefy ones.



Perhaps something earlier in the app is affecting the behaviour somehow. If you like you can send your PVRTrace recording to me via the support portal.


#7

Hey Chris. Thanks for the reply. GPU is AMD FirePro V4900 (driver: AMD 8.982.8.3000; 10/3/2012). In contrast to the ones you’re working with, this is a pretty whimpy desktop card. OS: Win7. Maybe this will help you out. If not, I can try to get you a paired-down trace log for you later.


#8

I think you may be hitting an AMD driver bug. If there’s a newer driver available for that card I would try updating it.


#9

Getting back to this… Just wanted to follow-up that updating the old GPU graphics drivers for this GPU (ATI FirePro V4900):


  • FROM: 8.982.8.3000 (10/3/12)
  • TO : 14.301.1010.0 (11/1/14)



    Resolves this problem. Thanks, Chris!