Re: GPU programming in Forth




<jpai@xxxxxxxxxxxxxx> a écrit dans le message de news:
1137142729.890444.168360@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I have a project in need of more speed and with parallel
> characteristics that I envision will benefit from GPU usage. While I
> am
> reading materials about GPU, I would appreciate some pointers to the
> information about GPU programming in Forth as my project is written in
> Forth. Can I access GPU directly from Forth or I still need to go
> though OpenGL or DirectX?

In OpenGl, "OpenGL Shading Language" (glslang) shaders programs,
have to be send to the GPU only using the OpenGL API.

So you have to go though OpenGl.

But you can write the interface in Forth to quickly test
shader programs. Here is a pseudo word to do that.

: TEST_SHADER ( zFragmentShader zVertexShader -- flag )
0 locals| shader zVertexShader zFragmentShader |
false
gl_HaveExtensionGlSLang? -EXIT
CreateShaderProgram dup to shader -EXIT
shader zVertexShader CompileVertexShader -EXIT
shader zFragmentShader CompileFragmentShader -EXIT
shader LinkShader
ExposeScene ;

Charles

> Any information regarding this topic will be
> appreciated.


>
> Thanks in advance!
>


.



Relevant Pages

  • Re: Cello/OS X update
    ... rendering, even if you are using MesaGL, by updating the bare minimum at ... Whatever GPU you have is just gravy. ... > your display lists provide for free). ... do boring 2D graphics in OpenGL and you scream as well. ...
    (comp.lang.lisp)
  • Re: OpenGL-based framebuffer concepts
    ... Someone once mentioned OpenGL ES as a possibility as it ... stack into the kernel including the rendering loops which tend to be ... GPU needs such advanced resource management that the X server (or ... delivery of GPU commands from userspace to hardware, ...
    (Linux-Kernel)
  • Re: OpenGL and high-performance image processing.
    ... > processing extensions. ... > opinion about usefulness of the OpenGL extensions as a way write high-speed ... > I thought it may be viable to use GPU instead of CPU, ... I haven't done any work with fragment programs myself, ...
    (sci.image.processing)
  • Re: OpenGL-based framebuffer concepts
    ... No GPU today "supports" OpenGL ... Kernel either passes the OpenGL commands to the GPU or if they ... I build an OpenGL rendering context. ...
    (Linux-Kernel)
  • GPU programming in Forth
    ... characteristics that I envision will benefit from GPU usage. ... reading materials about GPU, I would appreciate some pointers to the ...
    (comp.lang.forth)