2 registered members (AndrewAMD, ChrstphFr),
941
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
get exact pixelshader version (ps2.0, 2.a, 2.b) and r32f support
#315712
03/18/10 13:51
03/18/10 13:51
|
Joined: Jun 2004
Posts: 655 to your left
BoH_Havoc
OP
User
|
OP
User
Joined: Jun 2004
Posts: 655
to your left
|
Hi, I'm trying to get the shader capabilities of a gfx card through D3DCAPS9 but i can't get it to work. What i need is the exact pixelshader version the gfx card supports (ps 2.0, ps 2.a, ps 2.b or ps 3.0) and if the card supports r16f and/or r32f textures as well as MRTs (2 or 4). Is there anyone who already did this and can give me some help? Oh and using a dll is not an option. I need it lite-c only. Any help appreciated
|
|
|
Re: get exact pixelshader version (ps2.0, 2.a, 2.b) and r32f support
[Re: BoH_Havoc]
#315724
03/18/10 15:06
03/18/10 15:06
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
If you haven´t done it yet, you should try messing around with the DirecX SDK documentation. I just tried to check the texture format using: ((LPDIRECT3D9)pd3d)->CheckDeviceFormat(...) But the texture formats aren´t defined, so this needs some more defines.... I am still doing something wrong as it crashes, but I think that I am quite close:
#include <acknex.h>
#include <d3d9.h>
#define D3DFMT_A8R8G8B8 21
#define D3DFMT_X8R8G8B8 22
#define D3DFMT_R16F 111
#define D3DFMT_G16R16F 112
#define D3DFMT_A16B16G16R16F 113
#define D3DFMT_R32F 114
#define D3DFMT_G32R32F 115
#define D3DFMT_A32B32G32R32F 116
#define D3DRTYPE_SURFACE 1
#define D3DRTYPE_VOLUME 2
#define D3DRTYPE_TEXTURE 3
#define D3DRTYPE_VOLUMETEXTURE 4
#define D3DRTYPE_CubeTexture 5
#define D3DRTYPE_VERTEXBUFFER 6
#define D3DRTYPE_INDEXBUFFER 7
void main()
{
level_load("");
wait(1);
((LPDIRECT3D9)pd3d)->CheckDeviceFormat(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, D3DFMT_R32F);
}
|
|
|
Re: get exact pixelshader version (ps2.0, 2.a, 2.b) and r32f support
[Re: Slin]
#315853
03/19/10 16:50
03/19/10 16:50
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
The manual's "d3d_shaderversion" variable can be used to check the shader version support. as well as MRTs (2 or 4). I was under the impression that if a card does support MRTs it usually supports 4 or 8, but the lack of a "2" option was just an assumption on my part. The "bmap_rendertarget()" -- the old way to do MRTs -- is still supported and can be useful for determining how many render targets the computer supports. See what the manual says about it. I used it in the shader contest last year for disabling deferred rendering when there's no MRT support (as far as I've heard your deferred shaders work with or without MRT support, but I was being lazy ). Unfortunately the engine doesn't seem to come with anything for checking R16f or R32f texture support, which is obviously also very important to know, so you're probably best-off with Slin's example if he/you/I/someone can get it working. Jibb EDIT: Just realized after posting that d3d_shaderversion doesn't seem to differentiate between different 2.x versions.
Last edited by JulzMighty; 03/19/10 16:52.
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: get exact pixelshader version (ps2.0, 2.a, 2.b) and r32f support
[Re: BoH_Havoc]
#316002
03/20/10 17:25
03/20/10 17:25
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Thanks for the code.
What's the big difference between the 2.x's?
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
Re: get exact pixelshader version (ps2.0, 2.a, 2.b) and r32f support
[Re: BoH_Havoc]
#316021
03/20/10 19:09
03/20/10 19:09
|
Joined: Mar 2006
Posts: 3,538 WA, Australia
JibbSmart
Expert
|
Expert
Joined: Mar 2006
Posts: 3,538
WA, Australia
|
Oh wow -- the difference is significant. Thanks for that. It definitely makes sense to make the most of those differences where possible.
Jibb
Formerly known as JulzMighty. I made KarBOOM!
|
|
|
|