Skip to main content
added 1436 characters in body
Source Link
Raxvan
  • 809
  • 4
  • 10

Edit for the edit:

  • buffer creation with initialisation: it's like the difference between int a = new int[10] and a[0] = 0,a[1] = 1.... etc when you create a buffer you make room for the data and when you init the data you put the stuff you want in there.

  • buffer data update if it's on the cpu ram then you have vertex * vertices that you can play with it, if it's not there , you would have to move it from GPU vertex * vertices = map(buffer_id);(map is a mythological function that should move data from GPU to CPU ram, it also has it's oposite buffer_id = create_buffer(vertices);

  • binding the buffer as active it's just a concept that they call binding rendering is a complex process and it's like calling a function with 10000 parameters. Binding is just a term they used for telling which buffer goes where. There is no real magic behind this term, it does not convert or move or reallocate buffers, just tells the driver that on the next draw call use this buffer.

  • API draw call After all the binding and setting buffers up this is the place where rubber meets the road. The draw call will take all the data (or the id's that point to the data) you specified, sent it to the GPU (if needed) and tell the GPU to start crunching the numbers. This is not entirely true on all the platforms there are many differences, but for keeping thing simple the draw will tell the GPU to .... draw.

Edit for the edit:

  • buffer creation with initialisation: it's like the difference between int a = new int[10] and a[0] = 0,a[1] = 1.... etc when you create a buffer you make room for the data and when you init the data you put the stuff you want in there.

  • buffer data update if it's on the cpu ram then you have vertex * vertices that you can play with it, if it's not there , you would have to move it from GPU vertex * vertices = map(buffer_id);(map is a mythological function that should move data from GPU to CPU ram, it also has it's oposite buffer_id = create_buffer(vertices);

  • binding the buffer as active it's just a concept that they call binding rendering is a complex process and it's like calling a function with 10000 parameters. Binding is just a term they used for telling which buffer goes where. There is no real magic behind this term, it does not convert or move or reallocate buffers, just tells the driver that on the next draw call use this buffer.

  • API draw call After all the binding and setting buffers up this is the place where rubber meets the road. The draw call will take all the data (or the id's that point to the data) you specified, sent it to the GPU (if needed) and tell the GPU to start crunching the numbers. This is not entirely true on all the platforms there are many differences, but for keeping thing simple the draw will tell the GPU to .... draw.

added 219 characters in body
Source Link
Raxvan
  • 809
  • 4
  • 10

In general the boundary and the involvement of the cpu versus gpu are specific on the platform, but most of them follow this model: cpu has some ram, gpu also and you can move memory around (in some cases the ram is shared but for the sake of simplicity let's stick to separate rams).

first point: The data that you initialize you can choose to keep it in the CPU ram or on the GPU ram, and the are advantages for both. When you render something the GPU has to do the heavy lifting so it is obvious that the data that is already on the GPU mem will provide better performance. for the CPU it must first send the data to the GPU (which can choose to keep it for a while) and then perform the rendering.

second point: There are many trick in rendering but the main way thing are done is with polygons. On a frame gpu will render the objects made out of polygons one by one and after finishing that the GPU will send the picture to the display. There is no concept such as objects , there are just polygons and the way you put them together will create an image. the job of the GPU is to project those polygons from 3d to 2d and apply effect(if wanted). The polygons go only wan way CPU->GPU->SCREEN or GPU->SCREEN directly (if the polygons are already in the GPU ram)

third point: When you render animations for example it is better to keep the data close to the cpu because there he does the heavy lifting , it would not be optimal to keep the data in GPU , move it to CPU and back every frame. There are lots of other examples like this to count but in general all the data will stay close to whoever is doing the computations. Usually you would want to move as much data as possible to the GPU ram to gain performance.

The actual sending the data to the gpu is done by the API you use (directx/opengl or other) and the concept of binding and stuff like this are just abstractions so that the API understands what you want to do.

In general the boundary and the involvement of the cpu versus gpu are specific on the platform, but most of them follow this model: cpu has some ram, gpu also and you can move memory around (in some cases the ram is shared but for the sake of simplicity let's stick to separate rams).

first point: The data that you initialize you can choose to keep it in the CPU ram or on the GPU ram, and the are advantages for both. When you render something the GPU has to do the heavy lifting so it is obvious that the data that is already on the GPU mem will provide better performance. for the CPU it must first send the data to the GPU (which can choose to keep it for a while) and then perform the rendering.

second point: There are many trick in rendering but the main way thing are done is with polygons. On a frame gpu will render the objects made out of polygons one by one and after finishing that the GPU will send the picture to the display. There is no concept such as objects , there are just polygons and the way you put them together will create an image. the job of the GPU is to project those polygons from 3d to 2d and apply effect(if wanted). The polygons go only wan way CPU->GPU->SCREEN or GPU->SCREEN directly (if the polygons are already in the GPU ram)

third point: When you render animations for example it is better to keep the data close to the cpu because there he does the heavy lifting , it would not be optimal to keep the data in GPU , move it to CPU and back every frame. There are lots of other examples like this to count but in general all the data will stay close to whoever is doing the computations. Usually you would want to move as much data as possible to the GPU ram to gain performance.

In general the boundary and the involvement of the cpu versus gpu are specific on the platform, but most of them follow this model: cpu has some ram, gpu also and you can move memory around (in some cases the ram is shared but for the sake of simplicity let's stick to separate rams).

first point: The data that you initialize you can choose to keep it in the CPU ram or on the GPU ram, and the are advantages for both. When you render something the GPU has to do the heavy lifting so it is obvious that the data that is already on the GPU mem will provide better performance. for the CPU it must first send the data to the GPU (which can choose to keep it for a while) and then perform the rendering.

second point: There are many trick in rendering but the main way thing are done is with polygons. On a frame gpu will render the objects made out of polygons one by one and after finishing that the GPU will send the picture to the display. There is no concept such as objects , there are just polygons and the way you put them together will create an image. the job of the GPU is to project those polygons from 3d to 2d and apply effect(if wanted). The polygons go only wan way CPU->GPU->SCREEN or GPU->SCREEN directly (if the polygons are already in the GPU ram)

third point: When you render animations for example it is better to keep the data close to the cpu because there he does the heavy lifting , it would not be optimal to keep the data in GPU , move it to CPU and back every frame. There are lots of other examples like this to count but in general all the data will stay close to whoever is doing the computations. Usually you would want to move as much data as possible to the GPU ram to gain performance.

The actual sending the data to the gpu is done by the API you use (directx/opengl or other) and the concept of binding and stuff like this are just abstractions so that the API understands what you want to do.

Source Link
Raxvan
  • 809
  • 4
  • 10

In general the boundary and the involvement of the cpu versus gpu are specific on the platform, but most of them follow this model: cpu has some ram, gpu also and you can move memory around (in some cases the ram is shared but for the sake of simplicity let's stick to separate rams).

first point: The data that you initialize you can choose to keep it in the CPU ram or on the GPU ram, and the are advantages for both. When you render something the GPU has to do the heavy lifting so it is obvious that the data that is already on the GPU mem will provide better performance. for the CPU it must first send the data to the GPU (which can choose to keep it for a while) and then perform the rendering.

second point: There are many trick in rendering but the main way thing are done is with polygons. On a frame gpu will render the objects made out of polygons one by one and after finishing that the GPU will send the picture to the display. There is no concept such as objects , there are just polygons and the way you put them together will create an image. the job of the GPU is to project those polygons from 3d to 2d and apply effect(if wanted). The polygons go only wan way CPU->GPU->SCREEN or GPU->SCREEN directly (if the polygons are already in the GPU ram)

third point: When you render animations for example it is better to keep the data close to the cpu because there he does the heavy lifting , it would not be optimal to keep the data in GPU , move it to CPU and back every frame. There are lots of other examples like this to count but in general all the data will stay close to whoever is doing the computations. Usually you would want to move as much data as possible to the GPU ram to gain performance.