Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (120)
games submitted by our members
Games in WIP (577)
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 569 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
« 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: 269
Projects: 11
Exp: 2 years


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


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

OpenCL?

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

JGO Ninja


Medals: 52



« 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: 109
Projects: 3


You think about my Avatar right now!


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

interpenetrates

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
« Reply #7 - Posted 2014-05-06 20:52:38 »

interpenetrates

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.

http://www.opengl.org/registry/specs/ARB/draw_indirect.txt

Myomyomyo.
Pages: [1]
  ignore  |  Print  
 
 

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Longarmx (52 views)
2014-10-17 03:59:02

Norakomi (43 views)
2014-10-16 15:22:06

Norakomi (33 views)
2014-10-16 15:20:20

lcass (37 views)
2014-10-15 16:18:58

TehJavaDev (68 views)
2014-10-14 00:39:48

TehJavaDev (67 views)
2014-10-14 00:35:47

TehJavaDev (60 views)
2014-10-14 00:32:37

BurntPizza (73 views)
2014-10-11 23:24:42

BurntPizza (45 views)
2014-10-11 23:10:45

BurntPizza (86 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org 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‑gaming.org
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!