April 28, 2024, 10:14:35 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


some alpha 3.0 bugs

Started by sapero, April 30, 2006, 08:21:23 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sapero

no, it is defined only once. All includes are created by "find/replace all in files" + manual correction.
//#typedef D3DDEVTYPE int // enumeration from d3d9types

struct D3DVSHADERCAPS2_0
{
        DWORD Caps;
        INT DynamicFlowControlDepth;
        INT NumTemps;
        INT StaticFlowControlDepth;
}

struct D3DPSHADERCAPS2_0
{
    DWORD Caps;
    INT DynamicFlowControlDepth;
    INT NumTemps;
    INT StaticFlowControlDepth;
    INT NumInstructionSlots;
}

struct D3DCAPS9
{
    // Device Info
    D3DDEVTYPE  DeviceType;
    UINT        AdapterOrdinal;

    // Caps from DX7 Draw
    DWORD   Caps;
    DWORD   Caps2;
    DWORD   Caps3;
    DWORD   PresentationIntervals;

    // Cursor Caps
    DWORD   CursorCaps;

    // 3D Device Caps
    DWORD   DevCaps;

    DWORD   PrimitiveMiscCaps;
    DWORD   RasterCaps;
    DWORD   ZCmpCaps;
    DWORD   SrcBlendCaps;
    DWORD   DestBlendCaps;
    DWORD   AlphaCmpCaps;
    DWORD   ShadeCaps;
    DWORD   TextureCaps;
    DWORD   TextureFilterCaps;          // D3DPTFILTERCAPS for IDirect3DTexture9's
    DWORD   CubeTextureFilterCaps;      // D3DPTFILTERCAPS for IDirect3DCubeTexture9's
    DWORD   VolumeTextureFilterCaps;    // D3DPTFILTERCAPS for IDirect3DVolumeTexture9's
    DWORD   TextureAddressCaps;         // D3DPTADDRESSCAPS for IDirect3DTexture9's
    DWORD   VolumeTextureAddressCaps;   // D3DPTADDRESSCAPS for IDirect3DVolumeTexture9's

    DWORD   LineCaps;                   // D3DLINECAPS

    DWORD   MaxTextureWidth, MaxTextureHeight;
    DWORD   MaxVolumeExtent;

    DWORD   MaxTextureRepeat;
    DWORD   MaxTextureAspectRatio;
    DWORD   MaxAnisotropy;
    float   MaxVertexW;

    float   GuardBandLeft;
    float   GuardBandTop;
    float   GuardBandRight;
    float   GuardBandBottom;

    float   ExtentsAdjust;
    DWORD   StencilCaps;

    DWORD   FVFCaps;
    DWORD   TextureOpCaps;
    DWORD   MaxTextureBlendStages;
    DWORD   MaxSimultaneousTextures;

    DWORD   VertexProcessingCaps;
    DWORD   MaxActiveLights;
    DWORD   MaxUserClipPlanes;
    DWORD   MaxVertexBlendMatrices;
    DWORD   MaxVertexBlendMatrixIndex;

    float   MaxPointSize;

    DWORD   MaxPrimitiveCount;          // max number of primitives per DrawPrimitive call
    DWORD   MaxVertexIndex;
    DWORD   MaxStreams;
    DWORD   MaxStreamStride;            // max stride for SetStreamSource

    DWORD   VertexShaderVersion;
    DWORD   MaxVertexShaderConst;       // number of vertex shader constant registers

    DWORD   PixelShaderVersion;
    float   PixelShader1xMaxValue;      // max value storable registers of ps.1.x shaders

    // Here are the DX9 specific ones
    DWORD   DevCaps2;

    float   MaxNpatchTessellationLevel;
    DWORD   Reserved5;

    UINT    MasterAdapterOrdinal;       // ordinal of master adaptor for adapter group
    UINT    AdapterOrdinalInGroup;      // ordinal inside the adapter group
    UINT    NumberOfAdaptersInGroup;    // number of adapters this adapter group (only if master)
    DWORD   DeclTypes;                  // Data types, supported vertex declarations
    DWORD   NumSimultaneousRTs;         // Will be at least 1
    DWORD   StretchRectFilterCaps;      // Filter caps supported by StretchRect
    D3DVSHADERCAPS2_0 VS20Caps;
    D3DPSHADERCAPS2_0 PS20Caps;
    DWORD   VertexTextureFilterCaps;    // D3DPTFILTERCAPS for IDirect3DTexture9's for texture, used vertex shaders
    DWORD   MaxVShaderInstructionsExecuted; // maximum number of vertex shader instructions that can be executed
    DWORD   MaxPShaderInstructionsExecuted; // maximum number of pixel shader instructions that can be executed
    DWORD   MaxVertexShader30InstructionSlots;
    DWORD   MaxPixelShader30InstructionSlots;
}

Ionic Wind Support Team

I assume you have UINT and DWORD defined somewhere?
Ionic Wind Support Team

Parker

I believe those are defined in a default header (something included from the 2d headers)

Ionic Wind Support Team

DWORD is (ddraw.inc, the default one) but UINT isn't. 
Ionic Wind Support Team

sapero

don't worry, UINT and other are defined somewhere in winbase or wintypes, and some posts above ;D
Undefined types in UDT are always(first?) reported while compiling.

Ionic Wind Support Team

I'll poke around the compiler source.  Perhaps I can spot something overwriting memory on large include files.
Ionic Wind Support Team

sapero

I have found a new bug: typecasted pointer array always has size of one pointer:
GUID *pg
  • ;
    always - on stack and in .bss section (resd 1)

Ionic Wind Support Team

That's correct.  A pointer is always 4 bytes, no matter what it points to.

Ionic Wind Support Team

sapero

brackets are gone ???

I mean: size of this array = 4 bytes (one pointer)
GUID *pg[5];
Changing second pointer - the next variable (if any) is overwritten.
Same problem with class pointer array:
Cwindow *ppp[10] allocates only one pointer
segment .bss use32 align=4
$ppp resd 1

Ionic Wind Support Team

Noted.  That syntax is not yet supported.  Use the POINTER type and typecasting for now.

pointer pg[5];
Ionic Wind Support Team

Ionic Wind Support Team

Ionic Wind Support Team