Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (688)
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 1190 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: 125
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: 360
Projects: 11
Exp: 3 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 Wizard

Medals: 98

« 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: 123
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: 465
Exp: 6 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

« JGO Bitwise Duke »

Medals: 597
Projects: 4
Exp: 8 years

« 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  
You cannot reply to this message, because it is very, very old.

Dwinin (73 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (79 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (111 views)
2015-10-18 23:29:12

DarkCart (137 views)
2015-10-16 00:58:11

KaiHH (118 views)
2015-10-11 14:10:14

KaiHH (158 views)
2015-10-11 13:26:18

BurntPizza (173 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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!