Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  OpenGL functions straight from GPU  (Read 2989 times)
0 Members and 1 Guest are viewing this topic.
Offline Spacebeans
« Posted 2014-05-05 01:21:31 »

This post may not make allot of sense, I am still a hardware newb.

I was watching some OpenGL tutorials on Buffer Objects, and I noticed it said that the OpenGL functions are called from the CPU and then the graphics card interpenetrates them. So I was wondering, what if we could call the methods straight from the GPU without having to worry about a CPU bottleneck?

(I may be wrong on how this works?)
Offline Gibbo3771

JGO Kernel

Medals: 128
Projects: 5
Exp: 1 year

Currently inactive on forums :(

« Reply #1 - Posted 2014-05-05 04:36:12 »

Are you asking if it is possible? Or 'what if' we could?

Just to clarify, I would be interested to know as well but also it is pretty much impossible (really) to do anything without having the CPU deal with it, obviously.

"This code works flawlessly first time and exactly how I wanted it"
Said no programmer ever
Offline HeroesGraveDev

JGO Kernel

Medals: 382
Projects: 11
Exp: 4 years

┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻

« Reply #2 - Posted 2014-05-05 05:12:01 »


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline cylab

JGO Kernel

Medals: 180

« Reply #3 - Posted 2014-05-05 08:13:08 »

The idea of the programmable pipeline is more like setting everything up on the CPU side, send it over to the GPU and let the (GLSL) shaders do the heavy lifting. There would usually be little use for calling individual OpenGL functions from the GPU.

If you want to continously modify a dataset on the GPU, you could probably use OpenCL for that, but I heard that it might be difficult to bridge between OpenCL and GLSL when needed. I didn't use OpenCL though, so this might be uninformed...

Mathias - I Know What [you] Did Last Summer!
Offline The Lion King
« Reply #4 - Posted 2014-05-05 09:05:33 »

You can't call fn's directly from the GPU, Its not really designed for that.

You can however modify and create Buffer data in the GPU using OpenGL 4 functionality like Computational Shaders or OpenCL or even directly with vertex shaders using SSBOs*. You can use this to do a lot more on the GPU side without having to send data back and forth to the CPU. This is about as close as you can get to doing everything on the GPU. But you still have to do the initial set up, draw calls and kernel enqueues (assuming OCL).

*not sure about that last point never actually used SSBOs

"You have to want it more than you want to breath, then you will be successful"
Offline pitbuller
« Reply #5 - Posted 2014-05-06 20:34:17 »

Gpu's are fast to do many things in parallel. But not fast at all to do single thing in sequantial order.
Offline matheus23

JGO Kernel

Medals: 138
Projects: 3

You think about my Avatar right now!

« Reply #6 - Posted 2014-05-06 20:38:59 »


Just want to hop into here and say that it's called "interprete"/"interprets"... penetration is another story Grin

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline BurntPizza

« JGO Bitwise Duke »

Medals: 485
Exp: 7 years

« Reply #7 - Posted 2014-05-06 20:52:38 »


Just want to hop into here and say that it's called "interprete"/"interprets"... penetration is another story Grin

Get your interpreter out of the gutter!

On topic: I'd say that functions "on the GPU" makes little sense if you are talking about functions as in the subroutines the OpenGL or CUDA etc. APIs are made of. Those functions are (and have to be) on the CPU, how else would you call them? However, the GPU does run programs, which are in turn made of functions; ever heard of shaders?

The OpenGL functions are there as an "access point" to the GPU: since all your code runs in the context of (and literally in) the CPU, they function as a "telephone line" out to the GPU to tell it what to start doing.

I'm turning up blank on a good analogy, but I think the concept posed by CrowdProcess is very similar to how a GPU works, and is interesting in itself, so give it a read. (Note that the abstract idea is nothing new, but CP is a cool example of it in action that I remembered)
Offline theagentd
« Reply #8 - Posted 2014-05-06 21:21:17 »

Your GPU can't issue OpenGL commands, no. You can however compute parameters for a draw call on the GPU, store them in a buffer object and issue an indirect draw call to use them.

Pages: [1]
  ignore  |  Print  

EgonOlsen (59 views)
2018-06-10 19:43:48

EgonOlsen (42 views)
2018-06-10 19:43:44

EgonOlsen (61 views)
2018-06-10 19:43:20

DesertCoockie (240 views)
2018-05-13 18:23:11

nelsongames (142 views)
2018-04-24 18:15:36

nelsongames (141 views)
2018-04-24 18:14:32

ivj94 (883 views)
2018-03-24 14:47:39

ivj94 (144 views)
2018-03-24 14:46:31

ivj94 (795 views)
2018-03-24 14:43:53

Solater (159 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!