1 /****************************************************************************
3 * Copyright (C) 2005 - 2011 by Vivante Corp.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the license, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 *****************************************************************************/
24 #ifndef __gc_hal_engine_h_
25 #define __gc_hal_engine_h_
28 #include "gc_hal_types.h"
29 #include "gc_hal_enum.h"
32 #include "gc_hal_engine_vg.h"
39 /******************************************************************************\
40 ****************************** Object Declarations *****************************
41 \******************************************************************************/
43 typedef struct _gcoSTREAM
* gcoSTREAM
;
44 typedef struct _gcoVERTEX
* gcoVERTEX
;
45 typedef struct _gcoTEXTURE
* gcoTEXTURE
;
46 typedef struct _gcoINDEX
* gcoINDEX
;
47 typedef struct _gcsVERTEX_ATTRIBUTES
* gcsVERTEX_ATTRIBUTES_PTR
;
48 typedef struct _gcoVERTEXARRAY
* gcoVERTEXARRAY
;
50 #define gcdATTRIBUTE_COUNT 16
52 /******************************************************************************\
53 ********************************* Enumerations *********************************
54 \******************************************************************************/
57 typedef enum _gceSHADING
61 gcvSHADING_FLAT_OPENGL
,
84 typedef enum _gceCOMPARE
89 gcvCOMPARE_LESS_OR_EQUAL
,
92 gcvCOMPARE_GREATER_OR_EQUAL
,
94 gcvCOMPARE_INVALID
= -1
99 typedef enum _gceSTENCIL_MODE
102 gcvSTENCIL_SINGLE_SIDED
,
103 gcvSTENCIL_DOUBLE_SIDED
,
107 /* Stencil operations. */
108 typedef enum _gceSTENCIL_OPERATION
114 gcvSTENCIL_INCREMENT
,
115 gcvSTENCIL_DECREMENT
,
116 gcvSTENCIL_INCREMENT_SATURATE
,
117 gcvSTENCIL_DECREMENT_SATURATE
,
118 gcvSTENCIL_OPERATION_INVALID
= -1
120 gceSTENCIL_OPERATION
;
122 /* Stencil selection. */
123 typedef enum _gceSTENCIL_WHERE
130 /* Texture addressing selection. */
131 typedef enum _gceTEXTURE_WHICH
139 /* Texture addressing modes. */
140 typedef enum _gceTEXTURE_ADDRESSING
146 gcvTEXTURE_MIRROR_ONCE
,
148 gceTEXTURE_ADDRESSING
;
150 /* Texture filters. */
151 typedef enum _gceTEXTURE_FILTER
156 gcvTEXTURE_ANISOTROPIC
,
160 /* Primitive types. */
161 typedef enum _gcePRIMITIVE
163 gcvPRIMITIVE_POINT_LIST
,
164 gcvPRIMITIVE_LINE_LIST
,
165 gcvPRIMITIVE_LINE_STRIP
,
166 gcvPRIMITIVE_LINE_LOOP
,
167 gcvPRIMITIVE_TRIANGLE_LIST
,
168 gcvPRIMITIVE_TRIANGLE_STRIP
,
169 gcvPRIMITIVE_TRIANGLE_FAN
,
174 typedef enum _gceINDEX_TYPE
182 /******************************************************************************\
183 ********************************* gcoHAL Object *********************************
184 \******************************************************************************/
186 /* Query the target capabilities. */
188 gcoHAL_QueryTargetCaps(
190 OUT gctUINT
* MaxWidth
,
191 OUT gctUINT
* MaxHeight
,
192 OUT gctUINT
* MultiTargetCount
,
193 OUT gctUINT
* MaxSamples
203 gcoHAL_QueryShaderCaps(
205 OUT gctUINT
* VertexUniforms
,
206 OUT gctUINT
* FragmentUniforms
,
207 OUT gctUINT
* Varyings
211 gcoHAL_QueryTextureCaps(
213 OUT gctUINT
* MaxWidth
,
214 OUT gctUINT
* MaxHeight
,
215 OUT gctUINT
* MaxDepth
,
217 OUT gctBOOL
* NonPowerOfTwo
,
218 OUT gctUINT
* VertexSamplers
,
219 OUT gctUINT
* PixelSamplers
223 gcoHAL_QueryTextureMaxAniso(
225 OUT gctUINT
* MaxAnisoValue
229 gcoHAL_QueryStreamCaps(
231 OUT gctUINT32
* MaxAttributes
,
232 OUT gctUINT32
* MaxStreamSize
,
233 OUT gctUINT32
* NumberOfStreams
,
234 OUT gctUINT32
* Alignment
237 /******************************************************************************\
238 ********************************* gcoSURF Object ********************************
239 \******************************************************************************/
241 /*----------------------------------------------------------------------------*/
242 /*--------------------------------- gcoSURF 3D --------------------------------*/
258 /* Set number of samples for a gcoSURF object. */
265 /* Get the number of samples per pixel. */
269 OUT gctUINT_PTR Samples
272 /* Clear rectangular surface. */
285 depr_gcoSURF_Resolve(
286 IN gcoSURF SrcSurface
,
287 IN gcoSURF DestSurface
,
288 IN gctUINT32 DestAddress
,
289 IN gctPOINTER DestBits
,
290 IN gctINT DestStride
,
291 IN gceSURF_TYPE DestType
,
292 IN gceSURF_FORMAT DestFormat
,
293 IN gctUINT DestWidth
,
294 IN gctUINT DestHeight
298 depr_gcoSURF_ResolveRect(
299 IN gcoSURF SrcSurface
,
300 IN gcoSURF DestSurface
,
301 IN gctUINT32 DestAddress
,
302 IN gctPOINTER DestBits
,
303 IN gctINT DestStride
,
304 IN gceSURF_TYPE DestType
,
305 IN gceSURF_FORMAT DestFormat
,
306 IN gctUINT DestWidth
,
307 IN gctUINT DestHeight
,
308 IN gcsPOINT_PTR SrcOrigin
,
309 IN gcsPOINT_PTR DestOrigin
,
310 IN gcsPOINT_PTR RectSize
313 /* Resample surface. */
316 IN gcoSURF SrcSurface
,
317 IN gcoSURF DestSurface
320 /* Resolve surface. */
323 IN gcoSURF SrcSurface
,
324 IN gcoSURF DestSurface
327 /* Export the render target */
329 gcoSURF_ExportRenderTarget(
330 IN gcoSURF SrcSurface
333 /* Import the render target */
335 gcoSURF_ImportRenderTarget(
337 IN gcoSURF SrcSurface
340 /* Save the Resolve info to kernel. */
342 gcoSURF_PrepareRemoteResolveRect(
343 IN gcoSURF SrcSurface
,
344 IN gcsPOINT_PTR SrcOrigin
,
345 IN gcsPOINT_PTR DestOrigin
,
346 IN gcsPOINT_PTR RectSize
349 /* Using the info that Process Pid saved to do resolve. */
351 gcoSURF_RemoteResolveRect(
352 IN gcoSURF SrcSurface
,
353 IN gcoSURF DestSurface
357 Return the "resolve submitted indicator" signal. */
360 IN gcoSURF RTSurface
,
361 OUT gctSIGNAL
* resolveSubmittedSignal
364 /* Resolve rectangular area of a surface. */
367 IN gcoSURF SrcSurface
,
368 IN gcoSURF DestSurface
,
369 IN gcsPOINT_PTR SrcOrigin
,
370 IN gcsPOINT_PTR DestOrigin
,
371 IN gcsPOINT_PTR RectSize
374 /* Set surface resolvability. */
376 gcoSURF_SetResolvability(
378 IN gctBOOL Resolvable
381 /* Perform CPU cache operation on surface */
383 gcoSURF_CPUCacheOperation(
385 IN gceCACHEOPERATION Operation
390 IN gcsSURF_NODE_PTR Node
,
391 IN gctPOINTER Logical
,
393 IN gceCACHEOPERATION Operation
396 /******************************************************************************\
397 ******************************** gcoINDEX Object *******************************
398 \******************************************************************************/
400 /* Construct a new gcoINDEX object. */
407 /* Destroy a gcoINDEX object. */
413 /* Lock index in memory. */
417 OUT gctUINT32
* Address
,
418 OUT gctPOINTER
* Memory
421 /* Unlock index that was previously locked with gcoINDEX_Lock. */
427 /* Upload index data into the memory. */
431 IN gceINDEX_TYPE IndexType
,
432 IN gctUINT32 IndexCount
,
433 IN gctPOINTER IndexBuffer
436 /* Bind an index object to the hardware. */
440 IN gceINDEX_TYPE Type
443 /* Bind an index object to the hardware. */
447 IN gceINDEX_TYPE Type
,
451 /* Free existing index buffer. */
457 /* Upload data into an index buffer. */
461 IN gctCONST_POINTER Buffer
,
465 /* Upload data into an index buffer starting at an offset. */
467 gcoINDEX_UploadOffset(
470 IN gctCONST_POINTER Buffer
,
474 /* Query the index capabilities. */
477 OUT gctBOOL
* Index8
,
478 OUT gctBOOL
* Index16
,
479 OUT gctBOOL
* Index32
,
480 OUT gctUINT
* MaxIndex
483 /* Determine the index range in the current index buffer. */
485 gcoINDEX_GetIndexRange(
487 IN gceINDEX_TYPE Type
,
490 OUT gctUINT32
* MinimumIndex
,
491 OUT gctUINT32
* MaximumIndex
494 /* Dynamic buffer management. */
503 gcoINDEX_UploadDynamic(
505 IN gctCONST_POINTER Data
,
509 /******************************************************************************\
510 ********************************** gco3D Object *********************************
511 \******************************************************************************/
514 typedef enum _gceCLEAR
516 gcvCLEAR_COLOR
= 0x1,
517 gcvCLEAR_DEPTH
= 0x2,
518 gcvCLEAR_STENCIL
= 0x4,
520 gcvCLEAR_HAS_VAA
= 0x10,
524 /* Blending targets. */
525 typedef enum _gceBLEND_UNIT
532 /* Construct a new gco3D object. */
539 /* Destroy an gco3D object. */
545 /* Set 3D API type. */
552 /* Set render target. */
559 /* Unset render target. */
566 /* Set depth buffer. */
573 /* Unset depth buffer. */
600 /* Set clear color. */
610 /* Set fixed point clear color. */
612 gco3D_SetClearColorX(
614 IN gctFIXED_POINT Red
,
615 IN gctFIXED_POINT Green
,
616 IN gctFIXED_POINT Blue
,
617 IN gctFIXED_POINT Alpha
620 /* Set floating point clear color. */
622 gco3D_SetClearColorF(
630 /* Set fixed point clear depth. */
632 gco3D_SetClearDepthX(
634 IN gctFIXED_POINT Depth
637 /* Set floating point clear depth. */
639 gco3D_SetClearDepthF(
644 /* Set clear stencil. */
646 gco3D_SetClearStencil(
651 /* Clear a Rect sub-surface. */
655 IN gctUINT32 Address
,
656 IN gctPOINTER Memory
,
658 IN gceSURF_FORMAT Format
,
672 IN gctUINT32 Address
,
674 IN gceSURF_FORMAT Format
,
681 /* Clear tile status. */
683 gco3D_ClearTileStatus(
685 IN gcsSURF_INFO_PTR Surface
,
686 IN gctUINT32 TileStatusAddress
,
690 /* Set shading mode. */
694 IN gceSHADING Shading
697 /* Set blending mode. */
699 gco3D_EnableBlending(
704 /* Set blending function. */
706 gco3D_SetBlendFunction(
708 IN gceBLEND_UNIT Unit
,
709 IN gceBLEND_FUNCTION FunctionRGB
,
710 IN gceBLEND_FUNCTION FunctionAlpha
713 /* Set blending mode. */
717 IN gceBLEND_MODE ModeRGB
,
718 IN gceBLEND_MODE ModeAlpha
721 /* Set blending color. */
731 /* Set fixed point blending color. */
733 gco3D_SetBlendColorX(
735 IN gctFIXED_POINT Red
,
736 IN gctFIXED_POINT Green
,
737 IN gctFIXED_POINT Blue
,
738 IN gctFIXED_POINT Alpha
741 /* Set floating point blending color. */
743 gco3D_SetBlendColorF(
751 /* Set culling mode. */
758 /* Enable point size */
760 gco3D_SetPointSizeEnable(
765 /* Set point sprite */
767 gco3D_SetPointSprite(
779 /* Set depth compare mode. */
781 gco3D_SetDepthCompare(
783 IN gceCOMPARE Compare
786 /* Enable depth writing. */
788 gco3D_EnableDepthWrite(
793 /* Set depth mode. */
797 IN gceDEPTH_MODE Mode
800 /* Set depth range. */
802 gco3D_SetDepthRangeX(
804 IN gceDEPTH_MODE Mode
,
805 IN gctFIXED_POINT Near
,
806 IN gctFIXED_POINT Far
809 /* Set depth range. */
811 gco3D_SetDepthRangeF(
813 IN gceDEPTH_MODE Mode
,
818 /* Set last pixel enable */
820 gco3D_SetLastPixelEnable(
825 /* Set depth Bias and Scale */
827 gco3D_SetDepthScaleBiasX(
829 IN gctFIXED_POINT DepthScale
,
830 IN gctFIXED_POINT DepthBias
834 gco3D_SetDepthScaleBiasF(
836 IN gctFLOAT DepthScale
,
837 IN gctFLOAT DepthBias
840 /* Enable or disable dithering. */
847 /* Set color write enable bits. */
854 /* Enable or disable early depth. */
861 /* Enable or disable all early depth operations. */
863 gco3D_SetAllEarlyDepthModes(
868 /* Enable or disable depth-only mode. */
875 typedef struct _gcsSTENCIL_INFO
* gcsSTENCIL_INFO_PTR
;
876 typedef struct _gcsSTENCIL_INFO
878 gceSTENCIL_MODE mode
;
883 gctUINT8 referenceFront
;
885 gceCOMPARE compareFront
;
886 gceSTENCIL_OPERATION passFront
;
887 gceSTENCIL_OPERATION failFront
;
888 gceSTENCIL_OPERATION depthFailFront
;
890 gctUINT8 referenceBack
;
891 gceCOMPARE compareBack
;
892 gceSTENCIL_OPERATION passBack
;
893 gceSTENCIL_OPERATION failBack
;
894 gceSTENCIL_OPERATION depthFailBack
;
898 /* Set stencil mode. */
900 gco3D_SetStencilMode(
902 IN gceSTENCIL_MODE Mode
905 /* Set stencil mask. */
907 gco3D_SetStencilMask(
912 /* Set stencil write mask. */
914 gco3D_SetStencilWriteMask(
919 /* Set stencil reference. */
921 gco3D_SetStencilReference(
923 IN gctUINT8 Reference
,
927 /* Set stencil compare. */
929 gco3D_SetStencilCompare(
931 IN gceSTENCIL_WHERE Where
,
932 IN gceCOMPARE Compare
935 /* Set stencil operation on pass. */
937 gco3D_SetStencilPass(
939 IN gceSTENCIL_WHERE Where
,
940 IN gceSTENCIL_OPERATION Operation
943 /* Set stencil operation on fail. */
945 gco3D_SetStencilFail(
947 IN gceSTENCIL_WHERE Where
,
948 IN gceSTENCIL_OPERATION Operation
951 /* Set stencil operation on depth fail. */
953 gco3D_SetStencilDepthFail(
955 IN gceSTENCIL_WHERE Where
,
956 IN gceSTENCIL_OPERATION Operation
959 /* Set all stencil states in one blow. */
963 IN gcsSTENCIL_INFO_PTR Info
966 typedef struct _gcsALPHA_INFO
* gcsALPHA_INFO_PTR
;
967 typedef struct _gcsALPHA_INFO
969 /* Alpha test states. */
974 /* Alpha blending states. */
977 gceBLEND_FUNCTION srcFuncColor
;
978 gceBLEND_FUNCTION srcFuncAlpha
;
979 gceBLEND_FUNCTION trgFuncColor
;
980 gceBLEND_FUNCTION trgFuncAlpha
;
982 gceBLEND_MODE modeColor
;
983 gceBLEND_MODE modeAlpha
;
989 /* Enable or disable alpha test. */
996 /* Set alpha test compare. */
998 gco3D_SetAlphaCompare(
1000 IN gceCOMPARE Compare
1003 /* Set alpha test reference in unsigned integer. */
1005 gco3D_SetAlphaReference(
1007 IN gctUINT8 Reference
1010 /* Set alpha test reference in fixed point. */
1012 gco3D_SetAlphaReferenceX(
1014 IN gctFIXED_POINT Reference
1017 /* Set alpha test reference in floating point. */
1019 gco3D_SetAlphaReferenceF(
1021 IN gctFLOAT Reference
1024 /* Enable/Disable anti-alias line. */
1026 gco3D_SetAntiAliasLine(
1031 /* Set texture slot for anti-alias line. */
1033 gco3D_SetAALineTexSlot(
1038 /* Set anti-alias line width scale. */
1040 gco3D_SetAALineWidth(
1045 /* Draw a number of primitives. */
1047 gco3D_DrawPrimitives(
1049 IN gcePRIMITIVE Type
,
1050 IN gctINT StartVertex
,
1051 IN gctSIZE_T PrimitiveCount
1055 gco3D_DrawPrimitivesCount(
1057 IN gcePRIMITIVE Type
,
1058 IN gctINT
* StartVertex
,
1059 IN gctSIZE_T
* VertexCount
,
1060 IN gctSIZE_T PrimitiveCount
1064 /* Draw a number of primitives using offsets. */
1066 gco3D_DrawPrimitivesOffset(
1068 IN gcePRIMITIVE Type
,
1069 IN gctINT32 StartOffset
,
1070 IN gctSIZE_T PrimitiveCount
1073 /* Draw a number of indexed primitives. */
1075 gco3D_DrawIndexedPrimitives(
1077 IN gcePRIMITIVE Type
,
1078 IN gctINT BaseVertex
,
1079 IN gctINT StartIndex
,
1080 IN gctSIZE_T PrimitiveCount
1083 /* Draw a number of indexed primitives using offsets. */
1085 gco3D_DrawIndexedPrimitivesOffset(
1087 IN gcePRIMITIVE Type
,
1088 IN gctINT32 BaseOffset
,
1089 IN gctINT32 StartOffset
,
1090 IN gctSIZE_T PrimitiveCount
1093 /* Enable or disable anti-aliasing. */
1100 /* Write data into the command buffer. */
1104 IN gctCONST_POINTER Data
,
1109 /* Send sempahore and stall until sempahore is signalled. */
1117 /* Set the subpixels center. */
1122 IN gctPOINTER Centroids
1131 /* OCL thread walker information. */
1132 typedef struct _gcsTHREAD_WALKER_INFO
* gcsTHREAD_WALKER_INFO_PTR
;
1133 typedef struct _gcsTHREAD_WALKER_INFO
1135 gctUINT32 dimensions
;
1136 gctUINT32 traverseOrder
;
1137 gctUINT32 enableSwathX
;
1138 gctUINT32 enableSwathY
;
1139 gctUINT32 enableSwathZ
;
1140 gctUINT32 swathSizeX
;
1141 gctUINT32 swathSizeY
;
1142 gctUINT32 swathSizeZ
;
1143 gctUINT32 valueOrder
;
1145 gctUINT32 globalSizeX
;
1146 gctUINT32 globalOffsetX
;
1147 gctUINT32 globalSizeY
;
1148 gctUINT32 globalOffsetY
;
1149 gctUINT32 globalSizeZ
;
1150 gctUINT32 globalOffsetZ
;
1152 gctUINT32 workGroupSizeX
;
1153 gctUINT32 workGroupCountX
;
1154 gctUINT32 workGroupSizeY
;
1155 gctUINT32 workGroupCountY
;
1156 gctUINT32 workGroupSizeZ
;
1157 gctUINT32 workGroupCountZ
;
1159 gctUINT32 threadAllocation
;
1161 gcsTHREAD_WALKER_INFO
;
1163 /* Start OCL thread walker. */
1165 gco3D_InvokeThreadWalker(
1167 IN gcsTHREAD_WALKER_INFO_PTR Info
1170 /*----------------------------------------------------------------------------*/
1171 /*-------------------------- gco3D Fragment Processor ------------------------*/
1173 /* Set the fragment processor configuration. */
1175 gco3D_SetFragmentConfiguration(
1177 IN gctBOOL ColorFromStream
,
1178 IN gctBOOL EnableFog
,
1179 IN gctBOOL EnableSmoothPoint
,
1180 IN gctUINT32 ClipPlanes
1183 /* Enable/disable texture stage operation. */
1185 gco3D_EnableTextureStage(
1191 /* Program the channel enable masks for the color texture function. */
1193 gco3D_SetTextureColorMask(
1196 IN gctBOOL ColorEnabled
,
1197 IN gctBOOL AlphaEnabled
1200 /* Program the channel enable masks for the alpha texture function. */
1202 gco3D_SetTextureAlphaMask(
1205 IN gctBOOL ColorEnabled
,
1206 IN gctBOOL AlphaEnabled
1209 /* Program the constant fragment color. */
1211 gco3D_SetFragmentColorX(
1213 IN gctFIXED_POINT Red
,
1214 IN gctFIXED_POINT Green
,
1215 IN gctFIXED_POINT Blue
,
1216 IN gctFIXED_POINT Alpha
1220 gco3D_SetFragmentColorF(
1228 /* Program the constant fog color. */
1232 IN gctFIXED_POINT Red
,
1233 IN gctFIXED_POINT Green
,
1234 IN gctFIXED_POINT Blue
,
1235 IN gctFIXED_POINT Alpha
1247 /* Program the constant texture color. */
1249 gco3D_SetTetxureColorX(
1252 IN gctFIXED_POINT Red
,
1253 IN gctFIXED_POINT Green
,
1254 IN gctFIXED_POINT Blue
,
1255 IN gctFIXED_POINT Alpha
1259 gco3D_SetTetxureColorF(
1268 /* Configure color texture function. */
1270 gco3D_SetColorTextureFunction(
1273 IN gceTEXTURE_FUNCTION Function
,
1274 IN gceTEXTURE_SOURCE Source0
,
1275 IN gceTEXTURE_CHANNEL Channel0
,
1276 IN gceTEXTURE_SOURCE Source1
,
1277 IN gceTEXTURE_CHANNEL Channel1
,
1278 IN gceTEXTURE_SOURCE Source2
,
1279 IN gceTEXTURE_CHANNEL Channel2
,
1283 /* Configure alpha texture function. */
1285 gco3D_SetAlphaTextureFunction(
1288 IN gceTEXTURE_FUNCTION Function
,
1289 IN gceTEXTURE_SOURCE Source0
,
1290 IN gceTEXTURE_CHANNEL Channel0
,
1291 IN gceTEXTURE_SOURCE Source1
,
1292 IN gceTEXTURE_CHANNEL Channel1
,
1293 IN gceTEXTURE_SOURCE Source2
,
1294 IN gceTEXTURE_CHANNEL Channel2
,
1298 /* Invoke OCL thread walker. */
1300 gcoHARDWARE_InvokeThreadWalker(
1301 IN gcsTHREAD_WALKER_INFO_PTR Info
1304 /******************************************************************************\
1305 ******************************* gcoTEXTURE Object *******************************
1306 \******************************************************************************/
1309 typedef enum _gceTEXTURE_FACE
1321 typedef struct _gcsTEXTURE
1323 /* Addressing modes. */
1324 gceTEXTURE_ADDRESSING s
;
1325 gceTEXTURE_ADDRESSING t
;
1326 gceTEXTURE_ADDRESSING r
;
1332 gceTEXTURE_FILTER minFilter
;
1333 gceTEXTURE_FILTER magFilter
;
1334 gceTEXTURE_FILTER mipFilter
;
1335 gctUINT anisoFilter
;
1337 /* Level of detail. */
1338 gctFIXED_POINT lodBias
;
1339 gctFIXED_POINT lodMin
;
1340 gctFIXED_POINT lodMax
;
1342 gcsTEXTURE
, * gcsTEXTURE_PTR
;
1344 /* Construct a new gcoTEXTURE object. */
1346 gcoTEXTURE_Construct(
1348 OUT gcoTEXTURE
* Texture
1351 /* Construct a new sized gcoTEXTURE object. */
1353 gcoTEXTURE_ConstructSized(
1355 IN gceSURF_FORMAT Format
,
1360 IN gctUINT MipMapCount
,
1362 OUT gcoTEXTURE
* Texture
1365 /* Destroy an gcoTEXTURE object. */
1368 IN gcoTEXTURE Texture
1371 /* Upload data to an gcoTEXTURE object. */
1374 IN gcoTEXTURE Texture
,
1375 IN gceTEXTURE_FACE Face
,
1379 IN gctCONST_POINTER Memory
,
1381 IN gceSURF_FORMAT Format
1384 /* Upload data to an gcoTEXTURE object. */
1386 gcoTEXTURE_UploadSub(
1387 IN gcoTEXTURE Texture
,
1389 IN gceTEXTURE_FACE Face
,
1395 IN gctCONST_POINTER Memory
,
1397 IN gceSURF_FORMAT Format
1400 /* Upload compressed data to an gcoTEXTURE object. */
1402 gcoTEXTURE_UploadCompressed(
1403 IN gcoTEXTURE Texture
,
1404 IN gceTEXTURE_FACE Face
,
1408 IN gctCONST_POINTER Memory
,
1412 /* Get gcoSURF object for a mipmap level. */
1414 gcoTEXTURE_GetMipMap(
1415 IN gcoTEXTURE Texture
,
1417 OUT gcoSURF
* Surface
1420 /* Get gcoSURF object for a mipmap level and face offset. */
1422 gcoTEXTURE_GetMipMapFace(
1423 IN gcoTEXTURE Texture
,
1425 IN gceTEXTURE_FACE Face
,
1426 OUT gcoSURF
* Surface
,
1427 OUT gctUINT32_PTR Offset
1431 gcoTEXTURE_AddMipMap(
1432 IN gcoTEXTURE Texture
,
1434 IN gceSURF_FORMAT Format
,
1440 OUT gcoSURF
* Surface
1444 gcoTEXTURE_AddMipMapFromClient(
1445 IN gcoTEXTURE Texture
,
1451 gcoTEXTURE_AddMipMapFromSurface(
1452 IN gcoTEXTURE Texture
,
1458 gcoTEXTURE_SetEndianHint(
1459 IN gcoTEXTURE Texture
,
1460 IN gceENDIAN_HINT EndianHint
1471 IN gcoTEXTURE Texture
1475 gcoTEXTURE_QueryCaps(
1477 OUT gctUINT
* MaxWidth
,
1478 OUT gctUINT
* MaxHeight
,
1479 OUT gctUINT
* MaxDepth
,
1480 OUT gctBOOL
* Cubic
,
1481 OUT gctBOOL
* NonPowerOfTwo
,
1482 OUT gctUINT
* VertexSamplers
,
1483 OUT gctUINT
* PixelSamplers
1487 gcoTEXTURE_GetClosestFormat(
1489 IN gceSURF_FORMAT InFormat
,
1490 OUT gceSURF_FORMAT
* OutFormat
1494 gcoTEXTURE_RenderIntoMipMap(
1495 IN gcoTEXTURE Texture
,
1500 gcoTEXTURE_IsRenderable(
1501 IN gcoTEXTURE Texture
,
1506 gcoTEXTURE_IsComplete(
1507 IN gcoTEXTURE Texture
,
1512 gcoTEXTURE_BindTexture(
1513 IN gcoTEXTURE Texture
,
1516 IN gcsTEXTURE_PTR Info
1519 /******************************************************************************\
1520 ******************************* gcoSTREAM Object ******************************
1521 \******************************************************************************/
1523 typedef enum _gceVERTEX_FORMAT
1526 gcvVERTEX_UNSIGNED_BYTE
,
1528 gcvVERTEX_UNSIGNED_SHORT
,
1530 gcvVERTEX_UNSIGNED_INT
,
1534 gcvVERTEX_UNSIGNED_INT_10_10_10_2
,
1535 gcvVERTEX_INT_10_10_10_2
,
1540 gcoSTREAM_Construct(
1542 OUT gcoSTREAM
* Stream
1552 IN gcoSTREAM Stream
,
1553 IN gctCONST_POINTER Buffer
,
1554 IN gctUINT32 Offset
,
1560 gcoSTREAM_SetStride(
1561 IN gcoSTREAM Stream
,
1567 IN gcoSTREAM Stream
,
1568 OUT gctPOINTER
* Logical
,
1569 OUT gctUINT32
* Physical
1579 IN gcoSTREAM Stream
,
1588 /* Dynamic buffer API. */
1590 gcoSTREAM_SetDynamic(
1591 IN gcoSTREAM Stream
,
1596 typedef struct _gcsSTREAM_INFO
1599 gceVERTEX_FORMAT format
;
1603 gctCONST_POINTER data
;
1606 gcsSTREAM_INFO
, * gcsSTREAM_INFO_PTR
;
1609 gcoSTREAM_UploadDynamic(
1610 IN gcoSTREAM Stream
,
1611 IN gctUINT VertexCount
,
1612 IN gctUINT InfoCount
,
1613 IN gcsSTREAM_INFO_PTR Info
,
1618 gcoSTREAM_CPUCacheOperation(
1619 IN gcoSTREAM Stream
,
1620 IN gceCACHEOPERATION Operation
1623 /******************************************************************************\
1624 ******************************** gcoVERTEX Object ******************************
1625 \******************************************************************************/
1627 typedef struct _gcsVERTEX_ATTRIBUTES
1629 gceVERTEX_FORMAT format
;
1631 gctUINT32 components
;
1637 gcsVERTEX_ATTRIBUTES
;
1640 gcoVERTEX_Construct(
1642 OUT gcoVERTEX
* Vertex
1656 gcoVERTEX_EnableAttribute(
1657 IN gcoVERTEX Vertex
,
1659 IN gceVERTEX_FORMAT Format
,
1660 IN gctBOOL Normalized
,
1661 IN gctUINT32 Components
,
1662 IN gcoSTREAM Stream
,
1663 IN gctUINT32 Offset
,
1668 gcoVERTEX_DisableAttribute(
1669 IN gcoVERTEX Vertex
,
1678 /*******************************************************************************
1679 ***** gcoVERTEXARRAY Object ***************************************************/
1681 typedef struct _gcsVERTEXARRAY
1686 /* Number of components. */
1689 /* Attribute format. */
1690 gceVERTEX_FORMAT format
;
1692 /* Flag whether the attribute is normalized or not. */
1695 /* Stride of the component. */
1698 /* Pointer to the attribute data. */
1699 gctCONST_POINTER pointer
;
1701 /* Stream object owning the attribute data. */
1704 /* Generic values for attribute. */
1705 gctFLOAT genericValue
[4];
1707 /* Vertex shader linkage. */
1711 * gcsVERTEXARRAY_PTR
;
1714 gcoVERTEXARRAY_Construct(
1716 OUT gcoVERTEXARRAY
* Vertex
1720 gcoVERTEXARRAY_Destroy(
1721 IN gcoVERTEXARRAY Vertex
1725 gcoVERTEXARRAY_Bind(
1726 IN gcoVERTEXARRAY Vertex
,
1727 IN gctUINT32 EnableBits
,
1728 IN gcsVERTEXARRAY_PTR VertexArray
,
1731 IN gceINDEX_TYPE IndexType
,
1732 IN gcoINDEX IndexObject
,
1733 IN gctPOINTER IndexMemory
,
1734 IN OUT gcePRIMITIVE
* PrimitiveType
,
1735 IN OUT gctUINT
* PrimitiveCount
1738 /*******************************************************************************
1739 ***** Composition *************************************************************/
1741 typedef enum _gceCOMPOSITION
1743 gcvCOMPOSE_CLEAR
= 1,
1750 typedef struct _gcsCOMPOSITION
* gcsCOMPOSITION_PTR
;
1751 typedef struct _gcsCOMPOSITION
1753 /* Structure size. */
1756 /* Composition operation. */
1757 gceCOMPOSITION operation
;
1759 /* Layer to be composed. */
1762 /* Rotation angle. */
1763 gceSURF_ROTATION rotation
;
1765 /* Source and target coordinates. */
1769 /* Blending parameters. */
1770 gctBOOL enableBlending
;
1771 gctBOOL premultiplied
;
1772 gctUINT8 alphaValue
;
1783 gco3D_ProbeComposition(
1784 gctBOOL ResetIfEmpty
1788 gco3D_CompositionBegin(
1794 IN gcsCOMPOSITION_PTR Layer
1798 gco3D_CompositionSignals(
1799 IN gctHANDLE Process
,
1800 IN gctSIGNAL Signal1
,
1801 IN gctSIGNAL Signal2
1805 gco3D_CompositionEnd(
1807 IN gctBOOL Synchronous
1810 /* Frame Database */
1818 gctCONST_STRING Filename OPTIONAL
1822 gcoHAL_GetSharedInfo(
1824 IN gctUINT32 DataId
,
1825 OUT gctUINT8_PTR Data
,
1827 IN gcuVIDMEM_NODE_PTR Node
,
1828 OUT gctUINT8_PTR NodeData
1832 gcoHAL_SetSharedInfo(
1833 IN gctUINT32 DataId
,
1834 IN gctUINT8_PTR Data
,
1836 IN gcuVIDMEM_NODE_PTR Node
,
1837 IN gctUINT8_PTR NodeData
1844 #endif /* VIVANTE_NO_3D */
1845 #endif /* __gc_hal_engine_h_ */