Strategies for implementing GUIMark2 Bitmap with DX11

Started by
5 comments, last by AverageJoeSSU 11 years, 3 months ago

Topic sums it up really...

What is the best/quickest way to push independently transformed bitmaps to the screen?

Particularly from the perspective of, doing it in DX9, and then changing subsystems to leverage DX11 features.

For Example, perhaps using the compute stage to calculate transforms on the individual bitmaps.

Or perhaps binding a texture array to prevent state switching. (that may be a previous OGL limitation)

Thanks,

Joe

For those of you who don't know what this benchmark is....

http://www.craftymind.com/factory/guimark2/FlashGamingTest.html

------------------------------

redwoodpixel.com

Advertisement

The best way to do is to do all the transformation in software and store the vertices in a huge buffer that is already transformed. Then send the whole batch to the screen to draw the whole thing at once.

The best way to do is to do all the transformation in software and store the vertices in a huge buffer that is already transformed. Then send the whole batch to the screen to draw the whole thing at once.

Okay so is this largely unchanged in dx11?

by calcing transforms in software that means you have to push a full transform for each bitmap. Seems to me like you could instead pass translates and calc transforms on the GPU.

and compute shaders wouldnt be useful? or passing in points and reconstructing the quad for the bitmap in a geometry shader?????

come on guys i know some of you out there can think up tweaks!

-J

------------------------------

redwoodpixel.com

Okay so is this largely unchanged in dx11?

by calcing transforms in software that means you have to push a full transform for each bitmap. Seems to me like you could instead pass translates and calc transforms on the GPU.

and compute shaders wouldnt be useful? or passing in points and reconstructing the quad for the bitmap in a geometry shader?????

come on guys i know some of you out there can think up tweaks!

The only way you could batch that way is to pass an array of matrices to your vertex shader along with some id for each image that tells you which index of the array you want to use for each image. You either do it on the CPU side or waste Shader Registers. Pick your poison

You can absolutely do almost everything on the GPU if DX11 is your target spec. Take a look at the code for SpriteBatch for some ideas.

Also you don't have to pass an entire matrix per sprite if you don't need that much information, nor do you have to pass an ID (vertex shaders have access to SV_InstanceID which is automatically generated by the GPU). You also don't waste "Shader Registers", that's an outdated notion from DX9. In DX11 you have the option of using constant buffers, vertex buffers, or even structured buffers for storing per-instance data.

Awesome!

You can absolutely do almost everything on the GPU if DX11 is your target spec. Take a look at the code for SpriteBatch for some ideas.

Also you don't have to pass an entire matrix per sprite if you don't need that much information, nor do you have to pass an ID (vertex shaders have access to SV_InstanceID which is automatically generated by the GPU). You also don't waste "Shader Registers", that's an outdated notion from DX9. In DX11 you have the option of using constant buffers, vertex buffers, or even structured buffers for storing per-instance data.

This is exactly the kind of stuff i was looking for!!!

------------------------------

redwoodpixel.com

I'm a bit surprised that i do not see use of the other shader stages.

Things like http://zeeky-h-bomb.blogspot.com/2010/03/instancing-and-geometry-shader.html

what he is doing (midway through the article). I guess this prohibits you from doing other things on the CPU kind of like an ALL or Nothing kind of thing.

For Example generating mirrored tex coords would then have to be done in a shader... but i guess it isnt that big of a deal.

------------------------------

redwoodpixel.com

This topic is closed to new replies.

Advertisement