Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to check if D3DDEVTYPE_HAL is available (with reply address)

167 views
Skip to first unread message

Arie

unread,
Aug 22, 2002, 10:06:48 AM8/22/02
to
Hello all,

Excuses, my reply address was invalid

I am on my first steps on ActiveX8 programming.
(Windows-95 using VB6).

When doing a CreateDevice Call with the D3DEVTYPE_HAL
I get an err.nr=-2005530516.
When using D3DEVTYPE_REF all goes fine.

When running DXDIAG.EXE tho following is displayed:

DirectDraw Acceleration : Enabled
Direct3D Acceleration : Enabled
AGP texture Acceleration : Enabled

Furthermore I see significant speed difference between 'software-'
and 'hardware accelerated rendering' when performing the 'Direct3D'
test.

The DXCapsViewer also seems to display two 'DirectDrawDevices'
- Primary Display Driver (display)
- Hardware Emulation Layer.

I am struggling for 2 days with this problem, and I am lost.

Does anybody have an idea what might be wrong ?

Thanks in advance,

Arie Voors.

Mikael

unread,
Aug 22, 2002, 6:27:01 PM8/22/02
to
Hi!

>When doing a CreateDevice Call with the D3DEVTYPE_HAL
>I get an err.nr=-2005530516.
>When using D3DEVTYPE_REF all goes fine.

Well... This HRESULT is an 'D3DERR_INVALIDCALL'
equivalent. Just try to use some functions
(D3DXGetErrorString for instance), to decode D3D return
values or organize your code in a way to display messages
on your own (construction "if
returnvalue=D3DERR_INVALIDCALL then DisplayMessage ...")

If you didn't do wrong anything else (parameters of
CreateDevice valid?) D3DERR_INVALIDCALL means "HAL Device?
No way - no support" :)

Personally, before creating device i perform a quick-check
of devices: IDirect3D8::GetDeviceCaps for DEVTYPE_HAL and
DEVTYPE_REF. If GetDeviceCaps for _HAL fails, i assume
that there's no HW rendering support and create REF
Devices. If both invokes go fine, i have device caps for
further use... Noone told me it's the best way of
detection, but (personally) that's the way i've choosen...

Regards, Mikael

Rich [Microsoft Direct3D MVP]

unread,
Aug 22, 2002, 9:16:13 PM8/22/02
to
[Please do not mail me a copy of your followup]

"Mikael" <mik...@poczta.onet.pl> spake the secret code
<654d01c24a2b$08bbf4e0$2ae2...@phx.gbl> thusly:

>Personally, before creating device i perform a quick-check
>of devices: IDirect3D8::GetDeviceCaps for DEVTYPE_HAL and
>DEVTYPE_REF. If GetDeviceCaps for _HAL fails, i assume
>that there's no HW rendering support and create REF
>Devices.

The REF device will only be there if the SDK is installed. Otherwise
you'll get the "NULL reference device" and nothing will happen when
you attempt to do things.

Direct3D8 doesn't support the idea of a SW device. So if there's no
HAL device, there's no device period.

If you need a SW device, you need to use an earlier version of
Direct3D that supports software devices.
--
Ask me about my upcoming book on Direct3D from Addison-Wesley!
Direct3D Book <http://www.xmission.com/~legalize/book/>
izfree: Open source tools for Windows Installer
<http://izfree.sourceforge.net>

Mikael

unread,
Aug 23, 2002, 4:22:26 PM8/23/02
to
>The REF device will only be there if the SDK is installed.

So... As i understood - i should always rely on HAL?

Even if a user runs my apps on a really "oldie", i should
create HAL, and - eventually - expect less features
supported? And the only exception should be - a card, that
doesn't support any HW rasterization at all (in such case
HAL creation will fail and REF too)?

Regards, Mikael

Rich [Microsoft Direct3D MVP]

unread,
Aug 23, 2002, 5:25:13 PM8/23/02
to
[Please do not mail me a copy of your followup]

"Mikael" <mik...@poczta.onet.pl> spake the secret code

<6bb901c24ae2$cbece700$37ef2ecf@TKMSFTNGXA13> thusly:

>>The REF device will only be there if the SDK is installed.
>
>So... As i understood - i should always rely on HAL?

Yep. If you need to run on cards with no HW rasterizer, then you
should use an older version of Direct3D. Direct3D8 is intended for
"now and beyond" not "now and before".

>Even if a user runs my apps on a really "oldie", i should
>create HAL, and - eventually - expect less features
>supported? And the only exception should be - a card, that
>doesn't support any HW rasterization at all (in such case
>HAL creation will fail and REF too)?

Right. Direct3D8 is for modern hardware. If you need to support
really old hardware, you should use an older version of the Direct3D
interface like Direct3D7 perhaps.

Mikael

unread,
Aug 24, 2002, 4:28:26 PM8/24/02
to
Just imagine... I've been working on DX7 some time and on
DX8 till it's release time... But - after almost a year -
your answer cleared this question to me :)

Thanks for precious information...

Regards, Mikael

Arie

unread,
Aug 26, 2002, 8:01:29 AM8/26/02
to
Are you sure about this...?

Overhere I have two systems, and old w-95 system
and a newer -me system. Both without an SDK, but
on both the REF device is, when is available and
working.

Arie.

(p.s. the HAL device now works fine, after downloading
a newer (but obscure) driver...)

Mikael wrote in message <810e01c24bac$cd091da0$3bef2ecf@TKMSFTNGXA10>...

Rich [Microsoft Direct3D MVP]

unread,
Aug 26, 2002, 11:14:00 AM8/26/02
to
[Please do not mail me a copy of your followup]

"Arie" <4n...@gmx.net> spake the secret code
<akd7lh$5vl$1...@tasmania.dev.ict.nl> thusly:

>Are you sure about this...?

Yes.

>Overhere I have two systems, and old w-95 system
>and a newer -me system. Both without an SDK, but
>on both the REF device is, when is available and
>working.

Is it the 8.1 REF device? You won't get it without installing the
SDK. 8.1 non-SDK systems will give you a "null REF" device, which
does nothing at all, despite being able to instantiate it.

Arie

unread,
Aug 27, 2002, 4:59:45 AM8/27/02
to
Sorry, but I got very curious about this issue.

On both system's I am able to to change
the D3DDEVICE_HAL to D3DDEVICE_REF.
The performance is dramaticcaly reduced, but
it still works, so I thought the REF device is now
doing the work and is available for use.

On the W-95 system I 'upgraded' from DX7 to
DX8 (8.0)., so maybe the REF device is still
left form the DX7 installation.

The -ME system is still in his original configuration
with DirectX 8.0 installed and without a SDK.
Also on this sytem I am able to switch between _HAL
and _REF.

Besides that on both systems, the DXDIAG tool enables
me to disable hardware acceleration. Why is this possible
when no _HAL is available ?

Arie.

Rich [Microsoft Direct3D MVP] wrote in message ...

Rich [Microsoft Direct3D MVP]

unread,
Aug 27, 2002, 12:00:12 PM8/27/02
to
[Please do not mail me a copy of your followup]

"Arie" <4n...@gmx.net> spake the secret code

<akfhcj$ac4$1...@tasmania.dev.ict.nl> thusly:

>On both system's I am able to to change
>the D3DDEVICE_HAL to D3DDEVICE_REF.

With what version of the interfaces?

Hsiang-Tai Chien

unread,
Aug 28, 2002, 3:48:29 AM8/28/02
to

"Arie" <4n...@gmx.net> wrote:akfhcj$ac4$1...@tasmania.dev.ict.nl...

> Sorry, but I got very curious about this issue.
>
> On both system's I am able to to change
> the D3DDEVICE_HAL to D3DDEVICE_REF.
> The performance is dramaticcaly reduced, but
> it still works, so I thought the REF device is now
> doing the work and is available for use.
>
> On the W-95 system I 'upgraded' from DX7 to
> DX8 (8.0)., so maybe the REF device is still
> left form the DX7 installation.
>
> The -ME system is still in his original configuration
> with DirectX 8.0 installed and without a SDK.
> Also on this sytem I am able to switch between _HAL
> and _REF.
>
> Besides that on both systems, the DXDIAG tool enables
> me to disable hardware acceleration. Why is this possible
> when no _HAL is available ?
>
> Arie.

Have you installed DX8 SDK over these 2 systems and then remove the SDK? If
you do so, there will be a file named D3DREF8.DLL existed in your Windows
system folder, and that's why you can switch device type from D3DDEVICE_HAL
to D3DDEVICE_REF and get an workable REF device....

Please, search the D3DREF8.DLL in your Windows system folder, I think it's
the reason why you can get workable REF renderer. Without this file, REF
device should be NULL REF device and it's not workable....

But be aware, Microsoft does not allow you to distribute this D3DREF8.DLL
file to user (according to DX8.1 SDK document). So in an Windows system
without DX8SDK installed, NULL REF device (which is not workable) should be
normal....

Regards,
Hsiang-Tai Chien


Arie

unread,
Aug 28, 2002, 6:02:48 AM8/28/02
to
Hello,

The D3DREF8.DLL is available. Maybe it was installed
together with MSDN library or the VB6 package ?

I am sure I did not yet install and/or remove any SDK.

I think I 'stole' enough of your time, so it's not
strictly required to follow-up on this message.

The version data:

Operating System: Microsoft Windows 95 (4.0, Build 1212) B
Language: English (Regional Setting: Dutch)
Processor: Intel Pentium III, ~600MHz
Memory: 128MB RAM
Page File: 111MB used, 1809MB available
DirectX Version: DirectX 8.0 (4.08.00.0400)
DX Setup Parameters: /PackageInstall
DxDiag Version: 4.08.00.0400

Arie.

Rich [Microsoft Direct3D MVP] wrote in message ...

0 new messages