diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llrender/llagpmempool.h | 121 |
1 files changed, 0 insertions, 121 deletions
diff --git a/linden/indra/llrender/llagpmempool.h b/linden/indra/llrender/llagpmempool.h deleted file mode 100644 index f992876..0000000 --- a/linden/indra/llrender/llagpmempool.h +++ /dev/null | |||
@@ -1,121 +0,0 @@ | |||
1 | /** | ||
2 | * @file llagpmempool.h | ||
3 | * @brief LLAGPMemPool base class | ||
4 | * | ||
5 | * Copyright (c) 2001-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | #ifndef LL_LLAGPMEMPOOL_H | ||
29 | #define LL_LLAGPMEMPOOL_H | ||
30 | |||
31 | #include "stdtypes.h" | ||
32 | #include "lldlinked.h" | ||
33 | |||
34 | // Raw memory handling abstraction, which handles interaction with | ||
35 | // the nVidia and ATI AGP extensions. | ||
36 | |||
37 | // Minimum size we allow allocation for, in order to allow AGP usage... | ||
38 | const S32 MIN_AGP_SIZE = 8000000; | ||
39 | |||
40 | class LLAGPMemBlock; | ||
41 | |||
42 | class LLAGPMemPool | ||
43 | { | ||
44 | public: | ||
45 | LLAGPMemPool(); | ||
46 | virtual ~LLAGPMemPool(); | ||
47 | |||
48 | virtual LLAGPMemBlock *allocBlock(const S32 size); | ||
49 | virtual void freeBlock(LLAGPMemBlock *blockp); | ||
50 | |||
51 | virtual void flush() = 0; | ||
52 | virtual void dump() = 0; | ||
53 | virtual void enable() = 0; | ||
54 | virtual void disable() = 0; | ||
55 | virtual void bind() = 0; | ||
56 | |||
57 | virtual S32 getSize() { return mSize; } | ||
58 | |||
59 | S32 getTotalAllocated() const { return mTotalAllocated; } | ||
60 | static LLAGPMemPool *createPool(const U32 size, const BOOL use_vbo); | ||
61 | |||
62 | struct LLFreeBlock: public LLDLinked<LLFreeBlock> | ||
63 | { | ||
64 | S32 mOffset; | ||
65 | S32 mSize; | ||
66 | LLFreeBlock(const S32 offset, const S32 size) { mOffset = offset; mSize = size; sNumBlocks++; } | ||
67 | ~LLFreeBlock() { sNumBlocks--; } | ||
68 | |||
69 | static S32 sNumBlocks; | ||
70 | }; | ||
71 | |||
72 | // Fencing (for nVidia and Apple) - default is to do nothing (ATI, ARB do not need fencing) | ||
73 | virtual U32 createFence() { return 0; } | ||
74 | virtual void deleteFence(const U32 fence) {} | ||
75 | virtual void sendFence(U32 fence) {} | ||
76 | virtual void waitFence(U32 fence) {} | ||
77 | |||
78 | void printFreeList(); | ||
79 | protected: | ||
80 | |||
81 | void coalesce(LLFreeBlock *free_block); | ||
82 | virtual LLAGPMemBlock *createBlock(const U32 offset, const U32 size) = 0; | ||
83 | LLDLinked<LLFreeBlock> mFreeList; | ||
84 | |||
85 | S32 mSize; | ||
86 | S32 mTotalAllocated; | ||
87 | }; | ||
88 | |||
89 | // An AGP memory block, which contains all the info needed to | ||
90 | // copy data in/out. | ||
91 | class LLAGPMemBlock | ||
92 | { | ||
93 | public: | ||
94 | LLAGPMemBlock(LLAGPMemPool *mem_poolp) : mMemPoolp(mem_poolp) {} | ||
95 | virtual ~LLAGPMemBlock() {} | ||
96 | virtual void copy (void *source, const U32 size_bytes) = 0; | ||
97 | virtual void copyColor(void *source, const U32 size_bytes) = 0; | ||
98 | |||
99 | virtual void bindGLVertexPointer(const U32 stride, const U32 offset) = 0; | ||
100 | virtual void bindGLNormalPointer(const U32 stride, const U32 offset) = 0; | ||
101 | virtual void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset) = 0; | ||
102 | virtual void bindGLColorPointer(const U32 stride, const U32 offset) = 0; | ||
103 | virtual void bindGLTexCoordPointer(const U32 stride, const U32 offset) = 0; | ||
104 | virtual void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset) = 0; | ||
105 | virtual void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset) = 0; | ||
106 | |||
107 | virtual BOOL hasMappedMem() const = 0; | ||
108 | virtual U8* getMappedMem() = 0; | ||
109 | |||
110 | virtual U32 createFence() = 0; | ||
111 | virtual void deleteFence(const U32 fence) = 0; | ||
112 | virtual void sendFence(U32 fence) = 0; | ||
113 | virtual void waitFence(U32 fence) = 0; | ||
114 | |||
115 | virtual U32 getOffset() const = 0; | ||
116 | virtual U32 getSize() const = 0; | ||
117 | protected: | ||
118 | LLAGPMemPool *mMemPoolp; | ||
119 | }; | ||
120 | |||
121 | #endif // LL_LLAGPMEMPOOL_H | ||