|
From: spamtrap on 13 Mar 2006 07:13 Anyone here ever did any serious GPU programming using ASM ? There's a ton of info on GPU programming but almost all involved cg. I just wonder if there's any API and or SDK out there that can allow asm programmers to tap on the raw power of those advance GPU ? Thanks in advance !
From: Spaz on 13 Mar 2006 15:09 Trade secret. They'd NEVER release that! <spamtrap(a)crayne.org> wrote in message news:1142252036.759973.137010(a)i39g2000cwa.googlegroups.com... > Anyone here ever did any serious GPU programming using ASM ? > > There's a ton of info on GPU programming but almost all involved cg. I > just wonder if there's any API and or SDK out there that can allow asm > programmers to tap on the raw power of those advance GPU ? > > Thanks in advance ! >
From: jukka@liimatta.org on 13 Mar 2006 17:33 > Anyone here ever did any serious GPU programming using ASM ? It's done writing something that is called "microcode", there are many ways to write it, but usually some tools are created to make the process easier. It's not a great secret either, that if that target API is OpenGL 2.0 or OpenGL ES 2.0 shader compiler must be implemented for a language called "GLSL" - there is no intermediate assembly-like language in OpenGL as there is in DirectX DirectGraphics specification. The process is as follows: D3D / DG: Cg, HLSL (and others) compile into "shading assembly", that is the only input the hardware understands (unless you are working on XBOX or XBOX360). That's the closest you are going to get without proprietary information, which may be difficult to obtain depending on your position. OpenGL: Cg, GLSL GLSL compiles directly to microcode, in other words that is the ONLY entry-point to the hardware as far as shaders are concerned. I am not familiar with Cg+OpenGL; but I would assume that it does not do transcoding to GLSL but rather, nVidia implements own backend and only use the Cg (open source, btw) as frontend. That seems the approach that would be most pragmatic, feel free to correct on this assumption. So, unless you are planning on writing chip (or -set) specific microcode (and get your hands on the specifications somehow), your best bet is to write D3D/DG immediate shader assembly. But the developers are moving rapidly away from that. >There's a ton of info on GPU programming but almost all involved cg. I >just wonder if there's any API and or SDK out there that can allow asm >programmers to tap on the raw power of those advance GPU ? As outlined above you could write DirectX/3D/DG shader assembly, but to be honest GLSL is a major step forward as hence as GPU programming goes. Here's a simple GLSL vertex shader: -- uniform vec4 col; attribute vec4 pos; varying vec4 color; void blah() { color = col; gl_Position = pos; } -- How that works: "attribute" is a variable, which is unique for each vertex - fundamentally means this is an array from client memory (in principle, in practise there are a lot of things that can be optimized outside the scope of short description only :) "uniform" is a constant for all vertices. "varying" means that for a triangle, the varying values are three vertices of the triangle are interpolated across the triangle and passed on to the fragment (read: pixel) program. So from the above source it is possible to determine, that vertex positions come from array and something called "color" is interpolated across the triangle, where it happens to be same values for the whole triangle. (note: it would be far more trivial to setup the varying "color" uniform instead in the fragment program and avoid using interpolator for the task, ofcourse).
From: Isaac Bosompem on 13 Mar 2006 20:58 The only way to access the GPU is through the use of a API, like OpenGL or D3D. Like suggest earlier, developers dont use shader assembly anymore. Those were the days when the Radeon 8500 and the GF3 were the titans lol. They use either GLSL or D3D shading language. The driver takes care of compilation, they do not want to release this as it could get in the hands of competitors which could lead to serious problems. -------------------------------------------------------------------------------------------------------------- I am an EE student looking for summer employment in Toronto, Canada area If you have any openings please contact me at isaacb[AT]rogers[DOT]com.
|
Pages: 1 Prev: x86-64 assembly problems Next: "We Never Use Assembly Language" |