aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llrender/llagpmempoolati.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/llrender/llagpmempoolati.cpp')
-rw-r--r--linden/indra/llrender/llagpmempoolati.cpp160
1 files changed, 0 insertions, 160 deletions
diff --git a/linden/indra/llrender/llagpmempoolati.cpp b/linden/indra/llrender/llagpmempoolati.cpp
deleted file mode 100644
index f29db95..0000000
--- a/linden/indra/llrender/llagpmempoolati.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
1/**
2 * @file llagpmempoolati.cpp
3 * @brief LLAGPMemPoolATI 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#include "linden_common.h"
29
30#include "llagpmempoolati.h"
31#include "llgl.h"
32
33#include "llglheaders.h"
34
35LLAGPMemPoolATI::LLAGPMemPoolATI(S32 request) : LLAGPMemPool()
36{
37 llinfos << "Creating LLAGPMemPoolATI" << llendl;
38 stop_glerror();
39 if (!gGLManager.mHasATIVAO)
40 {
41 llerrs << "No ATI AGI memory extension!" << llendl;
42 }
43
44 mName = 0;
45
46 // More than 4MB of agp available
47 while (!mName && (request > 0))
48 {
49 mName = glNewObjectBufferATI(request, NULL, GL_DYNAMIC_ATI);
50 mSize = request;
51 request >>= 1;
52 }
53
54 if (mName)
55 {
56 mFreeList.append(*(new LLFreeBlock(0, mSize)));
57 }
58 else
59 {
60 llinfos << "Unable to allocate AGP memory!" << llendl;
61 mSize = 0;
62 }
63 flush_glerror();
64}
65
66
67LLAGPMemPoolATI::~LLAGPMemPoolATI()
68{
69 if (mName)
70 {
71 glFreeObjectBufferATI(mName);
72 }
73}
74
75
76LLAGPMemBlock *LLAGPMemPoolATI::createBlock(const U32 offset, const U32 size)
77{
78 return new LLAGPMemBlockATI(this, mName, offset, size);
79}
80
81
82void LLAGPMemPoolATI::dump()
83{
84}
85
86
87/////////////////////////////
88//
89// LLAGPMemBlockATI
90//
91// ATI Implementation of an AGP memory block
92//
93
94LLAGPMemBlockATI::LLAGPMemBlockATI(LLAGPMemPool *mem_poolp, const U32 name, const U32 offset, const U32 size) :
95 LLAGPMemBlock(mem_poolp)
96{
97 mName = name;
98 mOffset = offset;
99 mSize = size;
100}
101
102
103void LLAGPMemBlockATI::bindGLVertexPointer(const U32 stride, const U32 offset)
104{
105 glArrayObjectATI(GL_VERTEX_ARRAY, 3, GL_FLOAT, stride, mName, mOffset + offset);
106}
107
108
109void LLAGPMemBlockATI::bindGLNormalPointer(const U32 stride, const U32 offset)
110{
111 glArrayObjectATI(GL_NORMAL_ARRAY, 3, GL_FLOAT, stride, mName, mOffset + offset);
112}
113
114
115void LLAGPMemBlockATI::bindGLColorPointer(const U32 stride, const U32 offset)
116{
117 glArrayObjectATI(GL_COLOR_ARRAY, 4, GL_UNSIGNED_BYTE, stride, mName, mOffset + offset);
118}
119
120
121void LLAGPMemBlockATI::bindGLTexCoordPointer(const U32 stride, const U32 offset)
122{
123 glArrayObjectATI(GL_TEXTURE_COORD_ARRAY, 2, GL_FLOAT, stride, mName, mOffset + offset);
124}
125
126
127void LLAGPMemBlockATI::bindGLBinormalPointer(const S32 index, const U32 stride, const U32 offset)
128{
129 glVertexAttribArrayObjectATI(index, 3, GL_FLOAT, FALSE, stride, mName, mOffset + offset);
130}
131
132
133void LLAGPMemBlockATI::bindGLVertexWeightPointer(const S32 index, const U32 stride, const U32 offset)
134{
135 //glArrayObjectATI(GL_WEIGHT_ARRAY_ARB, 1, GL_FLOAT, stride, mName, mOffset + offset);
136 glVertexAttribArrayObjectATI(index, 1, GL_FLOAT, FALSE, stride, mName, mOffset + offset);
137}
138
139void LLAGPMemBlockATI::bindGLVertexClothingWeightPointer(const S32 index, const U32 stride, const U32 offset)
140{
141 glVertexAttribArrayObjectATI(index, 4, GL_FLOAT, FALSE, stride, mName, mOffset + offset);
142}
143
144U8* LLAGPMemBlockATI::getMappedMem()
145{
146 return NULL;
147}
148
149void LLAGPMemBlockATI::copy(void *mem, const U32 size)
150{
151 llassert(size <= mSize);
152 glUpdateObjectBufferATI(mName, mOffset, size, mem, GL_PRESERVE_ATI);
153}
154
155void LLAGPMemBlockATI::copyColor(void *mem, const U32 size)
156{
157 llassert(size <= mSize);
158 glUpdateObjectBufferATI(mName, mOffset, size, mem, GL_PRESERVE_ATI);
159}
160