Jump to content
  • Advertisement
  • entries
  • comments
  • views

Lets play a game...

Sign in to follow this  


Had an idea this morning (yes, it does happen...)

A Direct3D "architecture" challenge. Sticky thread in the DX forum, open to anyone who can be bothered.

Going through the FAQ and previous post listings I've noticed that the age old state-change reordering (or just generally reducing the number of state changes) crops up every now and then.

The general idea is that you need to use algorithms and data-structures to avoid making any redundant calls, and any calls that you must make are done in the best possible order.

For the purpose of a challenge that wouldn't require any Direct3D programming.

So I knocked up a simple prototype where you can provide it a function pointer to a custom "solution". This solution is given a mock IDevice interface where it can change the pipeline configuration (analagous to the normal IDirect3DDevice9) and a list of Object's. Its then upto the implementation to configure the pipeline and "render" each of these objects in the most efficient order.

I've knocked up a prototype and it seems to work fine. The IDevice keeps track of how many of which calls are made, and when the user-provided code returns the total cost is computed. Lower cost = better:

Function Name | Number of Objects | Sequence Time | Actual Time (microseconds)
First Come First Served | 1000 | 2711000 | 113
First Come First Served (With Redundant Call Filtering) | 1000 | 2806044 | 861
Shortest Job First | 1000 | 2396238 | 45879
Shortest Job First (Without individual VS/PS constant checks) | 1000 | 2408584 | 19680

("Sequence Time" = cost)

I put together this little framework so I could test out a few algorithms myself, but thought I could release it publicly. My thinking being that it might be useful to people, but more importantly, if its a sticky thread and people actually have a go AND post their solutions it might well be an interesting reference thread...

Sound like something you'd be interested in?
Sign in to follow this  


Recommended Comments

Sound like something you'd be interested in?
Yeah it does sound interesting. Smart way to use an imposter device in my opinion. I'm not sure I'd have much time to play with it at the moment though. I like the new avatar. I was getting sick of looking at that car. [grin]

Share this comment

Link to comment
Smart way to use an imposter device in my opinion.
I thought it was fairly neat... it effectively sets things up as a sort of simulator without actually having any "proper" D3D attachements.

I like the new avatar. I was getting sick of looking at that car.
hehe, might take to changing it on a more regular basis. I noticed another mod had an animated avatar the other day, so I wonder if I can as well (the one I've got is also in a day/night cycle screensaver).

Lemon Jelly > *


Share this comment

Link to comment
Heh, I'll be gone for the next two weeks, but I'll be sure to give it a go afterwards.

Already got an idea :).

Share this comment

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!