From 0e0eb256d835489a3cbdcb358d9c0374f365dccc Mon Sep 17 00:00:00 2001 From: Rudolf Cornelissen Date: Thu, 23 Dec 2004 12:54:35 +0000 Subject: [PATCH] added more engine command defines.. 8-) git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10519 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../private/graphics/nvidia/DriverInterface.h | 36 +++---- headers/private/graphics/nvidia/nv_acc.h | 98 +++++++++++++++++-- 2 files changed, 109 insertions(+), 25 deletions(-) diff --git a/headers/private/graphics/nvidia/DriverInterface.h b/headers/private/graphics/nvidia/DriverInterface.h index 876b874afa..69a8d0ef2e 100644 --- a/headers/private/graphics/nvidia/DriverInterface.h +++ b/headers/private/graphics/nvidia/DriverInterface.h @@ -73,24 +73,24 @@ enum { }; /* handles to pre-defined engine commands */ -#define NV_ROP5_SOLID 0x80000000 -#define NV_IMAGE_BLACK_RECTANGLE 0x80000001 -#define NV_IMAGE_PATTERN 0x80000002 -#define NV3_SURFACE_0 0x80000003 -#define NV3_SURFACE_1 0x80000004 -#define NV3_SURFACE_2 0x80000005 -#define NV3_SURFACE_3 0x80000006 -//#define NV4_CONTEXT_SURFACES_ARGB_ZS 0x80000007 -#define NV10_CONTEXT_SURFACES_ARGB_ZS 0x80000007 -#define NV1_IMAGE_FROM_CPU 0x80000010 -#define NV_IMAGE_BLIT 0x80000011 -#define NV3_GDI_RECTANGLE_TEXT 0x80000012 -#define NV_RENDER_D3D0_TRIANGLE_ZETA 0x80000013 -#define NV4_DX5_TEXTURE_TRIANGLE 0x80000014 -#define NV10_DX5_TEXTURE_TRIANGLE 0x80000014 -#define NV4_DX6_MULTI_TEXTURE_TRIANGLE 0x80000015 -#define NV10_DX6_MULTI_TEXTURE_TRIANGLE 0x80000015 -#define NV1_RENDER_SOLID_LIN 0x80000016 +#define NV_ROP5_SOLID 0x80000000 /* 2D */ +#define NV_IMAGE_BLACK_RECTANGLE 0x80000001 /* 2D/3D */ +#define NV_IMAGE_PATTERN 0x80000002 /* 2D */ +#define NV3_SURFACE_0 0x80000003 /* 3D: old cmd */ +#define NV3_SURFACE_1 0x80000004 /* 3D: old cmd */ +#define NV3_SURFACE_2 0x80000005 /* 3D: old cmd */ +#define NV3_SURFACE_3 0x80000006 /* 3D: old cmd */ +#define NV4_CONTEXT_SURFACES_ARGB_ZS 0x80000007 /* 3D: should replace the old cmd's */ +#define NV10_CONTEXT_SURFACES_ARGB_ZS 0x80000007 /* 3D: should replace the old cmd's */ +#define NV1_IMAGE_FROM_CPU 0x80000010 /* 2D: unused, remove? */ +#define NV_IMAGE_BLIT 0x80000011 /* 2D */ +#define NV3_GDI_RECTANGLE_TEXT 0x80000012 /* 2D */ +#define NV_RENDER_D3D0_TRIANGLE_ZETA 0x80000013 /* unused (yet?) */ +#define NV4_DX5_TEXTURE_TRIANGLE 0x80000014 /* 3D */ +#define NV10_DX5_TEXTURE_TRIANGLE 0x80000014 /* 3D */ +#define NV4_DX6_MULTI_TEXTURE_TRIANGLE 0x80000015 /* unused (yet?) */ +#define NV10_DX6_MULTI_TEXTURE_TRIANGLE 0x80000015 /* unused (yet?) */ +#define NV1_RENDER_SOLID_LIN 0x80000016 /* 2D: unused */ /* max. number of overlay buffers */ #define MAXBUFFERS 3 diff --git a/headers/private/graphics/nvidia/nv_acc.h b/headers/private/graphics/nvidia/nv_acc.h index 00ad723a45..8360949c05 100644 --- a/headers/private/graphics/nvidia/nv_acc.h +++ b/headers/private/graphics/nvidia/nv_acc.h @@ -56,7 +56,10 @@ typedef struct { uint32 LeftTop; /* b0-15 is top, b16-31 is left */ uint32 WidthHeight; /* b0-15 is height, b16-31 is width */ } UnclippedRectangle[0x40]; /* command can handle upto 64 unclipped rects */ -//XFree also defines: (not used AFAIK ATM) +/* fixme: XFree also defines the registers below: + * (used for the 2D 'ScanlineCPUToScreenColorExpandFill' and 'ColorExpandScanline' + * functions.) + * We don't use this currently. */ /* U032 reserved04[(0x080)-3]; struct @@ -106,6 +109,68 @@ typedef struct { */ } cmd_nv3_gdi_rectangle_text; +/* This command could (at least) potentially speed-up our fill_span command... :-) */ +//fixme: test this 2D command! +typedef struct { + uint32 reserved00[0x0004]; + uint16 FifoFree; /* little endian (FIFO internal register) */ + uint16 Nop; /* little endian (FIFO internal register) */ + uint32 reserved01[0x00bc]; /* fixme? there's more here that's not used apparantly */ + uint32 Color; /* b0-31 is color */ + uint32 reserved02[0x003e]; + struct { + uint32 Point0; /* b0-15 is X, b16-31 is Y: starting coordinate */ + uint32 Point1; /* b0-15 is X, b16-31 is Y: ending coordinate */ + } Line[0x10]; /* command can handle upto 16 lines */ + struct { + uint32 Point0X; /* b0-31 is X: starting coordinate */ + uint32 Point0Y; /* b0-31 is Y: starting coordinate */ + uint32 Point1X; /* b0-31 is X: ending coordinate */ + uint32 Point1Y; /* b0-31 is Y: ending coordinate */ + } Line32[0x08]; /* cmd can handle upto 8 lines with 32-bit coordinates */ + struct { + uint32 Point; /* b0-15 is X, b16-31 is Y */ + } Polyline[0x20]; /* cmd can handle upto 32 polylines */ + struct { + uint32 PointX; /* b0-31 is X */ + uint32 PointY; /* b0-31 is Y */ + } Polyline32[0x10]; /* command can handle upto 16 polylines with 32-bit coord's */ + struct { + uint32 Color; /* b0-31 is color */ + uint32 Point; /* b0-15 is X, b16-31 is Y */ + } ColorPolyline[0x10]; /* cmd can handle upto 16 individually colored polylines */ +} cmd_nv1_render_solid_lin; + +/* Someone defined this in XFree once (as 'RivaRectangle') but never used it: + * a handle should also be defined in the engine's init code, which was never done AFAIK. + * The command could be very interesting for us, as it could potentially speed-up our + * rectangle_fills :-) */ +//fixme: test this 2D command! +typedef struct { + uint32 reserved00[0x0004]; + uint16 FifoFree; /* little endian (FIFO internal register) */ + uint16 Nop; /* little endian (FIFO internal register) */ + uint32 reserved01[0x00bc]; /* fixme? there's more here that's not used apparantly */ + uint32 Color; /* b0-31 is color */ + uint32 reserved02[0x003e]; + struct { + uint32 TopLeft; /* b0-15 is left, b16-31 is top */ + uint32 HeightWidth; /* b0-15 is width, b16-31 is height */ + } Rectangle[0x10]; /* command can handle upto 16 rectangles */ +} cmd_nv_render_solid_rectangle;/* nv1_render_solid_rectangle is identical */ + +//fixme: complete or remove (this 2D cmd is not used currently) +typedef struct { +} cmd_nv1_image_from_cpu; /* 'pixmap': used in XFree 4.2.0, but not beyond. + * (Used for the 2D 'ImageWriteScanline' and + * 'ScanlineImageWriteRect' functions.) + * Is this command actually usefull? */ + + +/************************ + * 3D specific commands * + ************************/ + typedef struct { uint32 reserved00[0x0004]; uint16 FifoFree; /* little endian (FIFO internal register) */ @@ -120,14 +185,14 @@ typedef struct { uint32 FogColor; /* fog colorvalue */ uint32 reserved02[0x0039]; struct { - uint32 ScreenX; /* X */ - uint32 ScreenY; /* Y */ - uint32 ScreenZ; /* depth */ - uint32 RWH; /* eyeM */ + float ScreenX; /* X */ + float ScreenY; /* Y */ + float ScreenZ; /* depth */ + float RWH; /* eyeM */ uint32 Color; /* b24-31 Alpha, b16-23 Red, b8-15 Green, b0-7 Blue */ uint32 Specular; /* b24-31 Fog, b16-23 Red, b8-15 Green, b0-7 Blue */ - uint32 TU; /* texture S */ - uint32 TV; /* texture T */ + float TU; /* texture S */ + float TV; /* texture T */ } TLVertex[0x10]; /* command can handle upto 16 textured, lit(?) vertexes */ uint32 TLVDrawPrim[0x40]; /* b20-31 is I5, b16-19 is I4, b12-15 is I3, * b8-11 is I2, 4-7 is I1, b0-3 is I0: @@ -150,4 +215,23 @@ typedef struct { uint32 SetOffsetZeta; /* b0-31 is Z-buffer (zeta buffer) offset */ } cmd_nv4_context_surfaces_argb_zs; /* nv10_context_surfaces_argb_zs is identical */ +//fixme: let's loose this one if possible as we don't support NV3 anyway ... +// (checkout if we can re-setup 2D surfaces (after using 3D) without this command) +typedef struct { + uint32 reserved00[0x0004]; + uint16 FifoFree; /* little endian (FIFO internal register) */ + uint16 Nop; /* little endian (FIFO internal register) */ + uint32 reserved01[0x00bd]; /* fixme? there's more here that's not used apparantly */ + uint32 Pitch; /* b0-15 is buffer pitch */ + uint32 SetOffset; /* b0-22 is buffer offset (so just 1st 8Mb adressable!) */ +} cmd_nv3_surface_x; /* x = 0, 1, 2 or 3: selects buffer to be setup; + * 0,1 is 2D surfaces, 2,3 is 3D surfaces */ + +//fixme: fill these out... +typedef struct { +} cmd_nv_render_d3d0_triangle_zeta; + +typedef struct { +} cmd_nv4_dx6_multi_texture_triangle;/* nv10_dx6_multi_texture_triangle is identical? */ + #endif