rs_structs.h revision 3ff0fe77fdba8ad4a920dc27157d8c1786bb3661
15a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#ifndef _RS_STRUCTS_H_
25a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#define _RS_STRUCTS_H_
35a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
45a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
55a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
65a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
75a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
85a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class Allocation owned by librs. Unfortunately,
95a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
105a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
115a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
125a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsAllocation.h is modified.
135a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
145a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
155a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsAllocationGetDimX(). Without this
165a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
175a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
185a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * allocations.
195a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
205a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
215a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef enum {
225a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    RS_ALLOCATION_MIPMAP_NONE = 0,
235a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    RS_ALLOCATION_MIPMAP_FULL = 1,
245a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    RS_ALLOCATION_MIPMAP_ON_SYNC_TO_TEXTURE = 2
255a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} rs_allocation_mipmap_control;
265a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
275a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct Allocation {
285a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[32];
295a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
305a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        void * drv;
315a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
325a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            const void *type;
335a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t usageFlags;
345a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_allocation_mipmap_control mipmapControl;
355a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t yuv;
365a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t elementSizeBytes;
375a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool hasMipmaps;
385a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool hasFaces;
395a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool hasReferences;
405a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            void * usrPtr;
415a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            int32_t surfaceTextureID;
42ddceab9a001f07a3395226c5e06e3b420720af0fJason Sams            void * nativeBuffer;
43ddceab9a001f07a3395226c5e06e3b420720af0fJason Sams            int64_t timestamp;
445a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
455a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
465a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct DrvState {
475a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            struct LodState {
485a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines                void * mallocPtr;
495a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines                size_t stride;
505a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines                uint32_t dimX;
515a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines                uint32_t dimY;
525a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines                uint32_t dimZ;
535a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            } lod[16/*android::renderscript::Allocation::MAX_LOD*/];
545a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            size_t faceOffset;
555a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t lodCount;
565a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t faceCount;
5761656a7c6fc13421679d0a1cdf8b5b861e286892Jason Sams
5861656a7c6fc13421679d0a1cdf8b5b861e286892Jason Sams            struct YuvState {
5961656a7c6fc13421679d0a1cdf8b5b861e286892Jason Sams                uint32_t shift;
6061656a7c6fc13421679d0a1cdf8b5b861e286892Jason Sams                uint32_t step;
6161656a7c6fc13421679d0a1cdf8b5b861e286892Jason Sams            } yuv;
625a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } drvState;
635a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
645a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} Allocation_t;
655a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
663ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams#ifndef __LP64__
675a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
685a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
695a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
705a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
715a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class ProgramStore owned by librs. Unfortunately,
725a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
735a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
745a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
755a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsProgramStore.h is modified.
765a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
775a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
785a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsgProgramStoreGetDepthFunc(). Without this
795a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
805a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
815a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * program store.
825a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
835a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
845a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct ProgramStore {
855a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[40];
865a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
875a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
885a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool ditherEnable;
895a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool colorRWriteEnable;
905a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool colorGWriteEnable;
915a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool colorBWriteEnable;
925a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool colorAWriteEnable;
935a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_blend_src_func blendSrc;
945a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_blend_dst_func blendDst;
955a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool depthWriteEnable;
965a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_depth_func depthFunc;
975a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
985a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
995a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} ProgramStore_t;
1005a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
1015a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
1025a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
1035a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1045a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
1055a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class ProgramRaster owned by librs. Unfortunately,
1065a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
1075a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
1085a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
1095a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsProgramRaster.h is modified.
1105a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1115a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
1125a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsgProgramRasterGetCullMode(). Without this
1135a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
1145a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
1155a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * program raster.
1165a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1175a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
1185a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct ProgramRaster {
1195a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[36];
1205a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
1215a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        void * drv;
1225a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
1235a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool pointSprite;
1245a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_cull_mode cull;
1255a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
1265a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
1275a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} ProgramRaster_t;
1283ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams#endif //__LP64__
1295a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
1305a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
1315a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
1325a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1335a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
1345a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class Sampler owned by librs. Unfortunately,
1355a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
1365a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
1375a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
1385a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsSampler.h is modified.
1395a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1405a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
1415a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsgProgramRasterGetMagFilter(). Without this
1425a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
1435a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
1445a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * samplers.
1455a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1465a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
1475a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct Sampler {
1485a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[32];
1495a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
1505a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        void *drv;
1515a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
1525a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_sampler_value magFilter;
1535a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_sampler_value minFilter;
1545a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_sampler_value wrapS;
1555a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_sampler_value wrapT;
1565a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_sampler_value wrapR;
1575a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            float aniso;
1585a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
1595a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
1605a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} Sampler_t;
1615a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
1625a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
1635a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
1645a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1655a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
1665a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class Element owned by librs. Unfortunately,
1675a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
1685a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
1695a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
1705a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsElement.h is modified.
1715a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1725a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
1735a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsElementGetSubElementCount(). Without this
1745a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
1755a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
1765a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * elements.
1775a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
1785a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
1795a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct Element {
1805a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[32];
1815a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
1825a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        void *drv;
1835a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
1845a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_data_type dataType;
1855a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_data_kind dataKind;
1865a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t vectorSize;
1875a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t elementSizeBytes;
1885a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
1895a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            // Subelements
1905a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            const void **fields;
1915a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *fieldArraySizes;
1925a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            const char **fieldNames;
1935a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *fieldNameLengths;
1945a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *fieldOffsetBytes;
1955a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t fieldsCount;
1965a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
1975a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
1985a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} Element_t;
1995a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
2005a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
2015a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
2025a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
2035a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
2045a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class Type owned by librs. Unfortunately,
2055a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
2065a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
2075a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
2085a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsType.h is modified.
2095a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
2105a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
2115a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsAllocationGetElement(). Without this
2125a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
2135a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
2145a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * types.
2155a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
2165a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
2175a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct Type {
2185a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[32];
2195a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
2205a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        void *drv;
2215a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
2225a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            const void * element;
2235a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t dimX;
2245a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t dimY;
2255a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t dimZ;
2265a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *lodDimX;
2275a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *lodDimY;
2285a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *lodDimZ;
2295a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t *lodOffset;
2305a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t lodCount;
2315a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            bool faces;
2325a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
2335a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
2345a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} Type_t;
2355a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
2363ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams#ifndef __LP64__
2375a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines/*****************************************************************************
2385a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * CAUTION
2395a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
2405a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * The following structure layout provides a more efficient way to access
2415a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * internal members of the C++ class Mesh owned by librs. Unfortunately,
2425a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * since this class has virtual members, we can't simply use offsetof() or any
2435a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * other compiler trickery to dynamically get the appropriate values at
2445a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * build-time. This layout may need to be updated whenever
2455a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * frameworks/base/libs/rs/rsMesh.h is modified.
2465a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
2475a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * Having the layout information available in this file allows us to
2485a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * accelerate functionality like rsMeshGetVertexAllocationCount(). Without this
2495a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * information, we would not be able to inline the bitcode, thus resulting in
2505a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * potential runtime performance penalties for tight loops operating on
2515a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines * meshes.
2525a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *
2535a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines *****************************************************************************/
2545a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hinestypedef struct Mesh {
2555a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    char __pad[32];
2565a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    struct {
2575a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        void *drv;
2585a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        struct {
2595a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            void **vertexBuffers;
2605a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t vertexBuffersCount;
2615a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines
2625a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            // indexBuffers[i] could be NULL, in which case only primitives[i] is used
2635a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            void **indexBuffers;
2645a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t indexBuffersCount;
2655a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            rs_primitive *primitives;
2665a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines            uint32_t primitivesCount;
2675a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines        } state;
2685a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines    } mHal;
2695a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines} Mesh_t;
2703ff0fe77fdba8ad4a920dc27157d8c1786bb3661Jason Sams#endif //__LP64__
2715a47020542c52af3e879c1cd67674ca979ff0a18Stephen Hines#endif // _RS_CORE_H_
272