diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/llrender/llagpmempoolarb.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/linden/indra/llrender/llagpmempoolarb.h b/linden/indra/llrender/llagpmempoolarb.h new file mode 100644 index 0000000..7358862 --- /dev/null +++ b/linden/indra/llrender/llagpmempoolarb.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /** | ||
2 | * @file llagpmempoolarb.h | ||
3 | * @brief LLAGPMemPoolARB 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_LLAGPMEMPOOLARB_H | ||
29 | #define LL_LLAGPMEMPOOLARB_H | ||
30 | |||
31 | #include "llagpmempool.h" | ||
32 | |||
33 | class LLAGPMemPoolARB : public LLAGPMemPool | ||
34 | { | ||
35 | public: | ||
36 | LLAGPMemPoolARB(S32 request); | ||
37 | virtual ~LLAGPMemPoolARB(); | ||
38 | |||
39 | /*virtual*/ LLAGPMemBlock* allocBlock(const S32 size); | ||
40 | LLAGPMemBlock *allocBlock(const S32 size, U32 target); | ||
41 | /*virtual*/ void freeBlock(LLAGPMemBlock *blockp); | ||
42 | |||
43 | void bind() {} | ||
44 | |||
45 | void enable() {} | ||
46 | |||
47 | /*virtual*/ void disable(); | ||
48 | |||
49 | void flush() {} | ||
50 | |||
51 | // No point in these being inline, is there? They're virtual functions anyway... | ||
52 | /*virtual*/ inline LLAGPMemBlock *alloc(S32 size); | ||
53 | /*virtual*/ inline void free(LLAGPMemBlock *block); | ||
54 | /*virtual*/ inline void dump(); | ||
55 | protected: | ||
56 | /*virtual*/ LLAGPMemBlock *createBlock(const U32 offset, const U32 size); | ||
57 | LLAGPMemBlock *createBlock(const U32 offset, const U32 size, const U32 target); | ||
58 | |||
59 | protected: | ||
60 | U32 mName; | ||
61 | }; | ||
62 | |||
63 | class LLAGPMemBlockARB : public LLAGPMemBlock | ||
64 | { | ||
65 | public: | ||
66 | LLAGPMemBlockARB(LLAGPMemPool *mem_poolp, const U32 name, const U32 offset, const U32 size, U32 target); | ||
67 | virtual ~LLAGPMemBlockARB() { mMemPoolp->freeBlock(this); }; | ||
68 | |||
69 | /*virtual*/ void copy (void *source, const U32 size_bytes); | ||
70 | /*virtual*/ void copyColor(void *source, const U32 size_bytes); | ||
71 | /*virtual*/ void free(); | ||
72 | |||
73 | /*virtual*/ void bind(); | ||
74 | /*virtual*/ void unbind(); | ||
75 | |||
76 | /*virtual*/ void bindGLVertexPointer(const U32 stride, const U32 offset); | ||
77 | /*virtual*/ void bindGLNormalPointer(const U32 stride, const U32 offset); | ||
78 | /*virtual*/ void bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset); | ||
79 | /*virtual*/ void bindGLColorPointer(const U32 stride, const U32 offset); | ||
80 | /*virtual*/ void bindGLTexCoordPointer(const U32 stride, const U32 offset); | ||
81 | /*virtual*/ void bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset); | ||
82 | /*virtual*/ void bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset); | ||
83 | |||
84 | /*virtual*/ U32 getOffset() const { return 0; } | ||
85 | /*virtual*/ U32 getSize() const { return mSize; } | ||
86 | |||
87 | /*virtual*/ BOOL hasMappedMem() const { return FALSE; } | ||
88 | /*virtual*/ U8* getMappedMem(); | ||
89 | /*virtual*/ U32 createFence() { return 0; } | ||
90 | /*virtual*/ void deleteFence(const U32 fence) {} | ||
91 | /*virtual*/ void sendFence(U32 fence) { } | ||
92 | /*virtual*/ void waitFence(U32 fence) { } | ||
93 | |||
94 | U32 getName() const { return mName; } | ||
95 | private: | ||
96 | U32 mName; | ||
97 | U32 mSize; | ||
98 | U32 mTarget; | ||
99 | |||
100 | friend class LLAGPMemPoolARB; | ||
101 | }; | ||
102 | |||
103 | #endif // LL_LLAGPMEMPOOLARB_H | ||