Sign in to follow this  
chronozphere

Getting the VendorID from your video-card.

Recommended Posts

Hi Everyone I'm looking for an easy way to get my videocard's VendorID. Like the ones on this page: http://www.pcidatabase.com/vendors.php?sort=name I know about the DirectX way, using D3DADAPTER_IDENTIFIER9, but i rather don't use that one. I'll explain: My engine might become a multi-API engine (supporting both OGL and Direct3D). I want to be able to write vendor-specific shaders to work around the many hardware inconsistencies that may appear (Will parse the shadercode for some {IFDEF ATI / NVIDIA} strings). To be able to do that, i need to know what hardware the engine runs on. I will use the Direct3d way for my Direct3d Implementation, but i need something else for my OpenGL implementation as i don't want to depend on Direct3d just to get the vendorID. As far as i can tell, OpenGL cannot get this info for you. Is there any other way? Maybe using plain "WinAPI" routines? And can this be done on other platforms (Just in case i want to go crossplatform)? Thanks. :-)

Share this post


Link to post
Share on other sites
Maybe it's just me, but this seems like a bad idea. Rather than querying what the vendor is, why not query for particular extensions or whatever additional functionality you are looking for?

Share this post


Link to post
Share on other sites
glGetString seems good... will take a closer look at it.

@Moe: I'm not talking about extensions here. I need to determine the vendor so i can write vendor specific shaders I want to be able to use IFDEF's in my shaders and preprocess them (Thus only leaving the current vendors code) before passing them to D3D/OGL.

Share this post


Link to post
Share on other sites
Quote:
Original post by chronozphere
I want to be able to write vendor-specific shaders to work around the many hardware inconsistencies that may appear (Will parse the shadercode for some {IFDEF ATI / NVIDIA} strings).

I wouldn't recommend doing that. Driver bugs and inconsistencies aren't just vendor dependent, but chipset and the driver version dependent. If you rely on the vendorID alone, your code could break on a different chipset of the same vendor or a newer driver that fixes the inconsistency. Now, I know that ATI/AMD is a PITA to deal with (especially on OpenGL), but after trying to conditionally compile shaders per-chipset for some time (eventually unsuccessfully), I personally adhere to the principle that if the driver is broken, then it's not my job to fix it.

If you want to use vendor dependent shader extensions, then you should specifically query for their support rather than relying on the vendor string.

Share this post


Link to post
Share on other sites

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

Sign in to follow this