Dx9 sm3 or not?
Dx9 sm3 or not?
I'm wondering if the current dx9 driver is actualy using dx9.0c.
Why i'm wondering this is because there is a hard cap of 8 texture units in dx9 pixel shader even if the standar say there should be 16 and vertex shader are not working in irrlicht even if they should
Why i'm wondering this is because there is a hard cap of 8 texture units in dx9 pixel shader even if the standar say there should be 16 and vertex shader are not working in irrlicht even if they should
Re: Dx9 sm3 or not?
alright after a quick search i found that the device caps max simulatanous texture was relevant only for fixed pipeline and that when we are using shaders the real cap is somewhere between 16 an 32 depending on the hardware. i had to make a couple line modification to irrlicht and i can now use 16 texture in dx9
here are the changes
in IVideoDriver.h line 53
the enum E_TRANSFORMATION_STATE
needs to be extended (in dx9 it caused no crashes it was simply impossible to run with 16 texture without this but with my dx10 driver using more then 8 texture without modifiying this caused heavy crashes.)
the enum should probably be extended to 32 simply to avoid having a hidden limitatin there
in CD3D9Driver.cpp line 461
the line
need to be replaced with
So what do you guys think about this modification? Anychance it could be integrated in irrlicht?
here are the changes
in IVideoDriver.h line 53
the enum E_TRANSFORMATION_STATE
needs to be extended (in dx9 it caused no crashes it was simply impossible to run with 16 texture without this but with my dx10 driver using more then 8 texture without modifiying this caused heavy crashes.)
Code: Select all
//! View transformation
ETS_VIEW = 0,
//! World transformation
ETS_WORLD,
//! Projection transformation
ETS_PROJECTION,
//! Texture transformation
ETS_TEXTURE_0,
//! Texture transformation
ETS_TEXTURE_1,
//! Texture transformation
ETS_TEXTURE_2,
//! Texture transformation
ETS_TEXTURE_3,
#if _IRR_MATERIAL_MAX_TEXTURES_>4
//! Texture transformation
ETS_TEXTURE_4,
#if _IRR_MATERIAL_MAX_TEXTURES_>5
//! Texture transformation
ETS_TEXTURE_5,
#if _IRR_MATERIAL_MAX_TEXTURES_>6
//! Texture transformation
ETS_TEXTURE_6,
#if _IRR_MATERIAL_MAX_TEXTURES_>7
//! Texture transformation
ETS_TEXTURE_7,
#if _IRR_MATERIAL_MAX_TEXTURES_>8
//! Texture transformation
ETS_TEXTURE_8,
#if _IRR_MATERIAL_MAX_TEXTURES_>9
//! Texture transformation
ETS_TEXTURE_9,
#if _IRR_MATERIAL_MAX_TEXTURES_>10
//! Texture transformation
ETS_TEXTURE_10,
#if _IRR_MATERIAL_MAX_TEXTURES_>11
//! Texture transformation
ETS_TEXTURE_11,
#if _IRR_MATERIAL_MAX_TEXTURES_>12
//! Texture transformation
ETS_TEXTURE_12,
#if _IRR_MATERIAL_MAX_TEXTURES_>13
//! Texture transformation
ETS_TEXTURE_13,
#if _IRR_MATERIAL_MAX_TEXTURES_>14
//! Texture transformation
ETS_TEXTURE_14,
#if _IRR_MATERIAL_MAX_TEXTURES_>15
//! Texture transformation
ETS_TEXTURE_15,
in CD3D9Driver.cpp line 461
the line
Code: Select all
MaxTextureUnits = core::min_((u32)Caps.MaxSimultaneousTextures, MATERIAL_MAX_TEXTURES);
Code: Select all
MaxTextureUnits = MATERIAL_MAX_TEXTURES;
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Dx9 sm3 or not?
I started a similar change in OpenGL just recently, due to similar limitations. Guess we have to synchronize these things and have similar results on both drivers in the end.
Re: Dx9 sm3 or not?
well thell me what you added to the openGL cause for dx this is everything that was needed
Re: Dx9 sm3 or not?
And why not simply, prepare irr for 16 textures by default? older hardware won't be able to set the highest texture stages, but the new hard shouldn't be capped this way with irr.
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
Re: Dx9 sm3 or not?
Honestly we should just skip straight to 32 for new hardware this is the real cap.
And unless someone is using the fixed pipeline every hardware all the way dow to sm2 should be able to use all 16
And unless someone is using the fixed pipeline every hardware all the way dow to sm2 should be able to use all 16
Re: Dx9 sm3 or not?
Or even 64 for mostly (all?) DX11 hardware
Now, seriously I think that 16-32 is an optimal number which should be enabled default in Irrlicht, because current 4 textures is a strange limitation. Of course changes will not be included in 1.8, but in 1.9 we should change limit of textures I think.
Now, seriously I think that 16-32 is an optimal number which should be enabled default in Irrlicht, because current 4 textures is a strange limitation. Of course changes will not be included in 1.8, but in 1.9 we should change limit of textures I think.
Library helping with network requests, tasks management, logger etc in desktop and mobile apps: https://github.com/GrupaPracuj/hermes
Re: Dx9 sm3 or not?
at this point indeed ya we should go straight for the 64 limit instead of waking up in a couple month then patch it again
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Dx9 sm3 or not?
There is no 4 texture limit in Irrlicht. You can go up to any number you want. But due to different caps used, most gfx cards report these low values. Next thing, once we change the caps, there's again no limit to any number. The limit is only defined by the texture matrices used in SMaterial. And we won't allow for such large numbers anyway, so there will be a change in the numbering scheme of the enum to allow arbitrary numbers of texture matrices.
Re: Dx9 sm3 or not?
I expanded the texture define to the maximum on my custom version and the maximum that can be enabeled in dx9 is 16
if we keep using the current way of setting the texture at the same time we set the sampler and this limitation will remain in dx11 and 10 as there is only 16 sampler register even if some dx10 and 11 hardware can handle up to 128 texture.
if we keep using the current way of setting the texture at the same time we set the sampler and this limitation will remain in dx11 and 10 as there is only 16 sampler register even if some dx10 and 11 hardware can handle up to 128 texture.