Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: A question about Transforms sent in a states structuer  (Read 2375 times)

0 Members and 2 Guests are viewing this topic.

tomvidm

  • Newbie
  • *
  • Posts: 15
    • View Profile
A question about Transforms sent in a states structuer
« on: July 17, 2018, 01:59:02 pm »
As I understand, when calling draw with a transform in the RenderStates structure, the transform is applied on the GPU. Is this true?

I want to benchmark the point where large number of draw calls breaks even with a large number of transforms applied on individual vertices of a VertexBuffer with a single draw call. Knowing where the transform is performed will help me understand what is going on.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: A question about Transforms sent in a states structuer
« Reply #1 on: July 17, 2018, 02:53:40 pm »
Yes, transforms are usually always applied on the GPU. The only case where they are applied on the CPU is a questionable optimization hidden in SFML.

Quote
I want to benchmark the point where large number of draw calls breaks even with a large number of transforms applied on individual vertices of a VertexBuffer with a single draw call.
What does "break" mean, and how do you know it has anything to do with transforms?
« Last Edit: July 17, 2018, 02:56:41 pm by Laurent »
Laurent Gomila - SFML developer

tomvidm

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: A question about Transforms sent in a states structuer
« Reply #2 on: July 17, 2018, 03:36:28 pm »
Thanks for the answer.

I explained myself poorly. Considering that the draw call itself is a relatively slow operation for sprites, I want to implement sprites using the VertexBuffer class, to measure the difference between:
N draw call for individual sprites with transforms being left as work for the GPU
At most 4*N transforms on the CPU and one draw call

I am disregarding culling of any kind here. I just want to make a comparison between the two cases

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Re: A question about Transforms sent in a states structuer
« Reply #3 on: July 17, 2018, 03:39:32 pm »
Quote
N draw call for individual sprites with transforms being left as work for the GPU
These transforms will probably happen on the CPU because of the optimization I mentioned above.
Laurent Gomila - SFML developer

tomvidm

  • Newbie
  • *
  • Posts: 15
    • View Profile
Re: A question about Transforms sent in a states structuer
« Reply #4 on: July 17, 2018, 03:47:40 pm »
Thank you for pointing the way and clearing up a misconception I had.

 

anything