Forum

textureSize2D vs uniform send

Discuss programming topics that involve the OpenGL API.

Moderator: InsideQC Admins

textureSize2D vs uniform send

Postby Barnes » Tue Aug 07, 2012 8:57 am

For calculate texture lod in the shader we needs know texture size. We can send a uniform or use a function from the GL_EXT_gpu_shader4. But what do we get to the exit? Minus 30 frames per second. But this is not the strongest drop in speed when using the built-in glsl functions. Invert the matrix even slower....
User avatar
Barnes
 
Posts: 222
Joined: Thu Dec 24, 2009 2:26 pm
Location: Russia, Moscow

Re: textureSize2D vs uniform send

Postby mh » Tue Aug 07, 2012 11:44 pm

I wouldn't invert a matrix in GLSL code. Invert it CPU-side and send the inverted version as a uniform instead. Should fix that.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
User avatar
mh
 
Posts: 2287
Joined: Sat Jan 12, 2008 1:38 am


Return to OpenGL Programming

Who is online

Users browsing this forum: No registered users and 1 guest