PowerVR Series1

Up
SGLDirect Reference
SGL Reference
DirectDraw Programming
Direct3D Programming
SGL Programming
Performance Notes
Debug and Timing Utilities
PCI Card Installation
FAQ

 

Frequently Asked Questions

 

Contents

What do I do when I get the error message "Cannot load SGL.DLL"?
I have an S3 868/968 graphics card and my system crashes when I attempt to use PowerVR.
How do I set up a simple debug environment for PowerVR ?
My 2D overlay 'tears' or 'flickers' with drivers 4.0.0b4 or later.
My SGL Direct program breaks during initialization with drivers 4.0.0b4 or later.
How do I detect which PowerVR chip (PCX1/PCX2) is present ?
Why does ConvertBMPtoSGL() not work when using a Watcom compiler ?
What do I need to consider for bilinear mode operation ?
Does PowerVR support hardware clipping ?
Can I do n-sided polygons rather than just triangles on PowerVR ?
How do I get maximum performance with PowerVR ?
What is the most important performance optimization for PowerVR ?
Alpha Blending doesn't work in my DX5 Direct3D application.
My system locks up during sound initialisation when running GLQuake on PCX2.
My system crashes when using PCX2 together with my Imagine 128 Series 2 graphics card.
My system hangs in VC++5.0 on exit of Direct3D application in debugger mode.
On PCX2, frequently updated textures look corrupt - why?
Can I define Application Specific Settings (AppHints) in my application?
My PowerVR PCX2 application crashes when playing videos. What can I do ?
IDirectDraw4::GetDeviceIdentifier still reports PCX2 as the active device after switching the PCX2 HAL off in the control panel. Why ?
I am using MS VisualC++5.0. Running my application in debug mode on PCX2 makes my machine crash after the D3D device is released. What can I do ?

 

What do I do when I get the error message "Cannot load SGL.DLL"?

This may be a problem with a previously run application not closing the VXD properly.
Try running resetvxd.exe (if you have driver version 3.1.0b4 or later). resetvxd.txt.

 

I have an S3 868/968 graphics card and my system crashes when I attempt to use PowerVR.

There is a bug in some S3 chips causing an error in memory allocation at boot time.
Have a look at the S3 memory allocation problem page to solve this problem.

 

How do I set up a simple debug environment for PowerVR ?

If you are using the DirectDraw Mode of SGL Direct you can opt to have the render not use the built-in DirectDraw surface, but blit to the GUI screen. This can be convenient for debugging as the DirectDraw screen is not used and will not change resolutions or create a lock on the surface.

For driver version before and including 4.0.0b3, edit sglhw.ini and change
mode=ddraw in the [mode] section to mode=desktop.
Note that the 2D callback will not be called.

For driver version 4.0.0b4 and higher, edit sglhw.ini and add the following
[Debug]
RenderToDesktop=1
Note that the 2D callback is called, but you may see 'tearing' due to the fact that the GUI screen will not be locked.

 

My 2D overlay 'tears' or 'flickers' with drivers 4.0.0b4 or later.

The double_buffer boolean in sgl_create_screen_device() is observed in drivers version 4.0.0b4 or later (used to be ignored and double buffering enabled as default).
This must now be set correctly for the desired mode - set this to TRUE if you use 2D overlay.

 

My SGL Direct program breaks during initialization with drivers 4.0.0b4 or later.

Make sure the call to sgl_use_ddraw_mode / sgl_use_address_mode() is done before creating the SGL screen device using sgl_create_screen_device().

 

How do I detect which PowerVR chip (PCX1/PCX2) is present ?

In SGL / SGL Direct you can identify the PowerVR chip by calling sgl_win_versions. This will return a pointer to a structure containing pci_bridge_device_id, which will have one of the following values, depending on the PowerVR chipset :

pci_bridge_device_id Chipset
0x001F Midas 3 (pre-PCX1)
0x002A Midas 4 (PCX1)
0x0046 Midas 5 (PCX2)


Physically on the PowerVR board, the PowerVR chip number will reveal whether it is a PCX1 or PCX2 chip:

PowerVR chip number Chipset
XX2010GD Midas 4 (PCX1)
XX2011GD Midas 5 (PCX2)


A generic detection routine which can be used in SGL, SGL Direct and Direct3D applications is provided together with an example windows application in the Tips and Tricks seciton. To download this example please go to the Tips and Tricks PowerVR Detection Example section.

 

Why does ConvertBMPtoSGL() not work when using a Watcom compiler ?

The current implementation of ConvertBMPtoSGL() returns a structure compatible with Microsoft's standard. However, the returned structure is not compatible with Watcom and therefore calls to ConvertBMPtoSGL() fail under Watcom. A different function which will work with Watcom may be available in the future.

 

What do I need to consider for bilinear mode operation ?

Have a look at the SGL Direct Bilinear Mode Considerations page.

 

Does PowerVR support hardware clipping under SGL Direct ?

YES. PowerVR hardware supports clipping polygons to any rectangle of pixels without a fill rate penalty. Read the PowerVR Fast Hardware Clipping notes to find out more.

 

Can I do n-sided polygons rather than just triangles on PowerVR ?

Absolutely. Read the notes on High Performance Polygons on PowerVR to find out how you can improve 3D performance of your SGL Direct or Direct3D title by around 35% by using n-sided polygons.

 

How do I get maximum performance with PowerVR ?

Read the notes on PowerVR Performance Optimizations.

 

What is the most important performance optimization for PowerVR ?

Hardware/Software overlap. Due to the fact that PowerVR hardware renders the 3D scene totally asynchronously from the host CPU, useful tasks can be carried out on the CPU whilst waiting for the 3D hardware render to complete. For some useful tips on how to do this, read the notes on PowerVR Hardware/Software Overlap.

 

Alpha Blending doesn't work in my DX5 Direct3D application.

In early versions of the DirectX5 DDK (before Meltdown July 97) there was a separata flag 'ALPHABLEND' enumerated as number 42 in D3DRENDERSTATETYPE. This flag was then merged with BLENDENABLE (27) to yield ALPHABLENDENABLE enumerated as 27. Therefore, programs compiled with an early version of DirectX5 which set the ALPHABLEND flag will not yield any alpha blending since this flag is no longer supported in DirectX5. The application should either be recompiled with a later version of DirectX5 and/or the ALPHABLENDENABLE flag set.

 

My system locks up during sound initialisation when running GLQuake on PCX2.

We have heard of problems with PCI sound cards like the "Monster Sound" PCI card on certain motherboard / BIOS configurations. Disabling "PCI Streaming" in the BIOS will solve this problem and allow you to run GL games like GLQuake and GLHexenII in optimised mode on PCX2.

 

My system crashes when using PCX2 together with my Imagine 128 Series 2 graphics card.

There appears to be a bug in the Imagine 128 Series 2 DirectDraw driver and/or DirectSound which eventually causes a crash if hardware page flipping is used, eg by running PowerVR. This is a bug in the Imagine 128 drivers.

 

My system hangs in VC++5.0 on exit of Direct3D application in debugger mode

This is still being investigated and we are waiting on a report back from Microsoft. However we have a work around. There is an interaction with the debugger itself and a call-back in our drivers (the call-back releases any data the driver may have created). This call-back is required by Microsoft and must be called. This works in other debuggers and only happens when the VC5 debugger is running. The work around is to temporarily remove the calls to things like Release(pD3D) at exit. For example, the problem routines in the DX5 SDK, e.g. ex2, are ReleaseD3D() and ReleaseDevice(). If they are commented out and they are at the end of the game, then there will not be a memory leakage as DDraw will clean up anyway (in fact DDraw will call the same call-back (weird huh?) but quit OK, even in the VC debugger). Our recommendation is to use #if DEBUG around these problem calls until we have the answer/fix from Microsoft.

 

On PCX2, frequently updated textures look corrupt - why?

Uploading textures to the PowerVR PCX2 card can coincide with the card actually rendering the previous frame. This is not a problem unless you are actually overwriting the texture which the card is rendering from at the same moment in time. This will result in that texture appearing corrupted on the screen. In order to solve this problem, upload the textures just before Endscene. When using Direct3D, to ensure that PowerVR has finished rendering the previous frame, lock the render surface using the DDLOCK_WAIT flag and then immediately unlock it again, followed by the texture upload. In SGL Direct, use sgltri_isrendercomplete() to make sure the hardware has finished rendering before uploading the textures.
Uploading textures just before Endscene is recommended for performance reasons also on PCX1.

 

Can I define Application Specific Settings (AppHints) in my application ?

Yes you can. Other than modifying AppHints through the PowerVR Control Panel (via Display Properties) your application can create AppHints by using our PVRCreateAppHint function. Go to the PowerVR AppHints page to learn more about this and download the associated files.

 

My PowerVR PCX2 application crashes when playing videos. What can I do ?

We are aware of an 'undocumented feature' which has to do with creating / destroying DirectDraw surfaces in sequence. Typically this may happen when creating a DirectDraw surface for playing a video and subsequently deleting that surface and creating a new DirectDraw surface for 3D. This may cause the system to hang, probably due to timing issues. Creating a single DirectDraw surface for 3D graphics and using that same surface for video playback seems to solve this problem.

 

IDirectDraw4::GetDeviceIdentifier still reports PCX2 as the active device after switching the PCX2 HAL off in the control panel. Why ?

Using the 3D Control Center utility to switch between 3D hardware devices will ensure the primary HAL is correctly selected and reported by GetDeviceIdentifier. For PCX2 detection, using our PCX runtime detection code will always work.

 

I am using MS VisualC++5.0. Running my application in debug mode on PCX2 makes my machine crash after the D3D device is released. What can I do ?

This problem has now been resolved in VisualC++ version 6.0.

 

Confidential / provided under Non-Disclosure Agreement
Copyright © 1999-2000, PowerVR Technologies and partners. PowerVR Technologies is a division of Imagination Technologies Limited.