   Can one calculate the glViewport inside a vertex shader
  I have the unfortunate pleasure of working with an Intel GMA 500. The thing is buggy in every little corner you find but I have been able to drive around all of these except for one. The glViewport.So, I need to do different render passes all of them rendering in different parts of the screen (sometimes overlapping). This works fine in my desktop machine with glViewport, but it is just not working on the GMA500.For some reason, however, vertex shaders are (sort of) working fine. As far as my understanding goes, I think I could apply the glViewport transformation here myself, but the problem is that I have no idea how this looks.Has anybody tried this?, any hints or pointers would be appreciated, thanks!   
The projection matrix gives out verticies in a cube surrounding the origin between -1 and 1 in the XY directions.The viewport mapping ought to be something like; (width*x+width/2 + left), (height*y+height/2 + top) where x&y are the outputs from the regular projection transform. (z runs 0..1 IIRC).The only thing I can't recall off the top of my head is who copes with the aspect ratio of the viewport. I think it may be the projection matrix -- I wrote an inverse of this operation recently and didn't need to do anything to handle it, so it would seem reasonable that the projection's X & Y range are both -1..1 regardless of the shape of the window.I would say though, that I don't recall there being a way to inform the rasterizer stage that you're supplying screen coords...;  Yes, that seems to be the case. Naively I thought that the mapping could be just added to the vertex position but it looks like the glViewport equations happen after rasterization and before they are delivered to the fragment shader.Will have to look for another solution. I guess if I had Framebuffer Objects I could do the remapping myself.