Lines Matching refs:vtx
69 if (exec->vtx.prim_count == 0) { in vbo_exec_wrap_buffers()
70 exec->vtx.copied.nr = 0; in vbo_exec_wrap_buffers()
71 exec->vtx.vert_count = 0; in vbo_exec_wrap_buffers()
72 exec->vtx.buffer_ptr = exec->vtx.buffer_map; in vbo_exec_wrap_buffers()
75 GLuint last_begin = exec->vtx.prim[exec->vtx.prim_count-1].begin; in vbo_exec_wrap_buffers()
79 GLint i = exec->vtx.prim_count - 1; in vbo_exec_wrap_buffers()
81 exec->vtx.prim[i].count = (exec->vtx.vert_count - in vbo_exec_wrap_buffers()
82 exec->vtx.prim[i].start); in vbo_exec_wrap_buffers()
85 last_count = exec->vtx.prim[exec->vtx.prim_count-1].count; in vbo_exec_wrap_buffers()
89 if (exec->vtx.vert_count) in vbo_exec_wrap_buffers()
92 exec->vtx.prim_count = 0; in vbo_exec_wrap_buffers()
93 exec->vtx.copied.nr = 0; in vbo_exec_wrap_buffers()
98 assert(exec->vtx.prim_count == 0); in vbo_exec_wrap_buffers()
101 exec->vtx.prim[0].mode = exec->ctx->Driver.CurrentExecPrimitive; in vbo_exec_wrap_buffers()
102 exec->vtx.prim[0].start = 0; in vbo_exec_wrap_buffers()
103 exec->vtx.prim[0].count = 0; in vbo_exec_wrap_buffers()
104 exec->vtx.prim_count++; in vbo_exec_wrap_buffers()
106 if (exec->vtx.copied.nr == last_count) in vbo_exec_wrap_buffers()
107 exec->vtx.prim[0].begin = last_begin; in vbo_exec_wrap_buffers()
119 GLfloat *data = exec->vtx.copied.buffer; in vbo_exec_vtx_wrap()
127 if (!exec->vtx.buffer_ptr) { in vbo_exec_vtx_wrap()
134 assert(exec->vtx.max_vert - exec->vtx.vert_count > exec->vtx.copied.nr); in vbo_exec_vtx_wrap()
136 for (i = 0 ; i < exec->vtx.copied.nr ; i++) { in vbo_exec_vtx_wrap()
137 memcpy( exec->vtx.buffer_ptr, data, in vbo_exec_vtx_wrap()
138 exec->vtx.vertex_size * sizeof(GLfloat)); in vbo_exec_vtx_wrap()
139 exec->vtx.buffer_ptr += exec->vtx.vertex_size; in vbo_exec_vtx_wrap()
140 data += exec->vtx.vertex_size; in vbo_exec_vtx_wrap()
141 exec->vtx.vert_count++; in vbo_exec_vtx_wrap()
144 exec->vtx.copied.nr = 0; in vbo_exec_vtx_wrap()
158 if (exec->vtx.attrsz[i]) { in vbo_exec_copy_to_current()
166 exec->vtx.attrsz[i], in vbo_exec_copy_to_current()
167 exec->vtx.attrptr[i], in vbo_exec_copy_to_current()
168 exec->vtx.attrtype[i]); in vbo_exec_copy_to_current()
170 if (exec->vtx.attrtype[i] != vbo->currval[i].Type || in vbo_exec_copy_to_current()
179 vbo->currval[i].Size = exec->vtx.attrsz[i]; in vbo_exec_copy_to_current()
181 vbo->currval[i].Type = exec->vtx.attrtype[i]; in vbo_exec_copy_to_current()
183 vbo_attrtype_to_integer_flag(exec->vtx.attrtype[i]); in vbo_exec_copy_to_current()
200 exec->vtx.attrsz[VBO_ATTRIB_COLOR0]) { in vbo_exec_copy_to_current()
219 switch (exec->vtx.attrsz[i]) { in vbo_exec_copy_from_current()
220 case 4: exec->vtx.attrptr[i][3] = current[3]; in vbo_exec_copy_from_current()
221 case 3: exec->vtx.attrptr[i][2] = current[2]; in vbo_exec_copy_from_current()
222 case 2: exec->vtx.attrptr[i][1] = current[1]; in vbo_exec_copy_from_current()
223 case 1: exec->vtx.attrptr[i][0] = current[0]; in vbo_exec_copy_from_current()
243 const GLint lastcount = exec->vtx.vert_count; in vbo_exec_wrap_upgrade_vertex()
245 const GLuint old_vtx_size = exec->vtx.vertex_size; /* floats per vertex */ in vbo_exec_wrap_upgrade_vertex()
246 const GLuint oldSize = exec->vtx.attrsz[attr]; in vbo_exec_wrap_upgrade_vertex()
254 if (unlikely(exec->vtx.copied.nr)) { in vbo_exec_wrap_upgrade_vertex()
259 memcpy(old_attrptr, exec->vtx.attrptr, sizeof(old_attrptr)); in vbo_exec_wrap_upgrade_vertex()
274 !oldSize && lastcount > 8 && exec->vtx.vertex_size) { in vbo_exec_wrap_upgrade_vertex()
281 exec->vtx.attrsz[attr] = newSize; in vbo_exec_wrap_upgrade_vertex()
282 exec->vtx.vertex_size += newSize - oldSize; in vbo_exec_wrap_upgrade_vertex()
283 exec->vtx.max_vert = ((VBO_VERT_BUFFER_SIZE - exec->vtx.buffer_used) / in vbo_exec_wrap_upgrade_vertex()
284 (exec->vtx.vertex_size * sizeof(GLfloat))); in vbo_exec_wrap_upgrade_vertex()
285 exec->vtx.vert_count = 0; in vbo_exec_wrap_upgrade_vertex()
286 exec->vtx.buffer_ptr = exec->vtx.buffer_map; in vbo_exec_wrap_upgrade_vertex()
291 GLfloat *tmp = exec->vtx.vertex; in vbo_exec_wrap_upgrade_vertex()
294 if (exec->vtx.attrsz[i]) { in vbo_exec_wrap_upgrade_vertex()
295 exec->vtx.attrptr[i] = tmp; in vbo_exec_wrap_upgrade_vertex()
296 tmp += exec->vtx.attrsz[i]; in vbo_exec_wrap_upgrade_vertex()
299 exec->vtx.attrptr[i] = NULL; /* will not be dereferenced */ in vbo_exec_wrap_upgrade_vertex()
309 exec->vtx.attrptr[attr] = exec->vtx.vertex + in vbo_exec_wrap_upgrade_vertex()
310 exec->vtx.vertex_size - newSize; in vbo_exec_wrap_upgrade_vertex()
318 if (unlikely(exec->vtx.copied.nr)) { in vbo_exec_wrap_upgrade_vertex()
319 GLfloat *data = exec->vtx.copied.buffer; in vbo_exec_wrap_upgrade_vertex()
320 GLfloat *dest = exec->vtx.buffer_ptr; in vbo_exec_wrap_upgrade_vertex()
323 assert(exec->vtx.buffer_ptr == exec->vtx.buffer_map); in vbo_exec_wrap_upgrade_vertex()
325 for (i = 0 ; i < exec->vtx.copied.nr ; i++) { in vbo_exec_wrap_upgrade_vertex()
327 GLuint sz = exec->vtx.attrsz[j]; in vbo_exec_wrap_upgrade_vertex()
330 GLint old_offset = old_attrptr[j] - exec->vtx.vertex; in vbo_exec_wrap_upgrade_vertex()
331 GLint new_offset = exec->vtx.attrptr[j] - exec->vtx.vertex; in vbo_exec_wrap_upgrade_vertex()
338 exec->vtx.attrtype[j]); in vbo_exec_wrap_upgrade_vertex()
352 dest += exec->vtx.vertex_size; in vbo_exec_wrap_upgrade_vertex()
355 exec->vtx.buffer_ptr = dest; in vbo_exec_wrap_upgrade_vertex()
356 exec->vtx.vert_count += exec->vtx.copied.nr; in vbo_exec_wrap_upgrade_vertex()
357 exec->vtx.copied.nr = 0; in vbo_exec_wrap_upgrade_vertex()
372 if (newSize > exec->vtx.attrsz[attr]) { in vbo_exec_fixup_vertex()
378 else if (newSize < exec->vtx.active_sz[attr]) { in vbo_exec_fixup_vertex()
381 vbo_get_default_vals_as_float(exec->vtx.attrtype[attr]); in vbo_exec_fixup_vertex()
386 for (i = newSize; i <= exec->vtx.attrsz[attr]; i++) in vbo_exec_fixup_vertex()
387 exec->vtx.attrptr[attr][i-1] = id[i-1]; in vbo_exec_fixup_vertex()
390 exec->vtx.active_sz[attr] = newSize; in vbo_exec_fixup_vertex()
412 if (unlikely(exec->vtx.active_sz[A] != N)) \
416 GLfloat *dest = exec->vtx.attrptr[A]; \
421 exec->vtx.attrtype[A] = T; \
428 for (i = 0; i < exec->vtx.vertex_size; i++) \
429 exec->vtx.buffer_ptr[i] = exec->vtx.vertex[i]; \
431 exec->vtx.buffer_ptr += exec->vtx.vertex_size; \
437 if (++exec->vtx.vert_count >= exec->vtx.max_vert) \
555 if (exec->vtx.vert_count || unmap) { in vbo_exec_FlushVertices_internal()
559 if (exec->vtx.vertex_size) { in vbo_exec_FlushVertices_internal()
583 if (exec->vtx.active_sz[i] != exec->eval.map1[i].sz) in vbo_exec_EvalCoord1f()
589 memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, in vbo_exec_EvalCoord1f()
590 exec->vtx.vertex_size * sizeof(GLfloat)); in vbo_exec_EvalCoord1f()
594 memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, in vbo_exec_EvalCoord1f()
595 exec->vtx.vertex_size * sizeof(GLfloat)); in vbo_exec_EvalCoord1f()
610 if (exec->vtx.active_sz[i] != exec->eval.map2[i].sz) in vbo_exec_EvalCoord2f()
615 if (exec->vtx.active_sz[VBO_ATTRIB_NORMAL] != 3) in vbo_exec_EvalCoord2f()
619 memcpy( exec->vtx.copied.buffer, exec->vtx.vertex, in vbo_exec_EvalCoord2f()
620 exec->vtx.vertex_size * sizeof(GLfloat)); in vbo_exec_EvalCoord2f()
624 memcpy( exec->vtx.vertex, exec->vtx.copied.buffer, in vbo_exec_EvalCoord2f()
625 exec->vtx.vertex_size * sizeof(GLfloat)); in vbo_exec_EvalCoord2f()
834 if (exec->vtx.vertex_size && !exec->vtx.attrsz[0]) in vbo_exec_Begin()
837 i = exec->vtx.prim_count++; in vbo_exec_Begin()
838 exec->vtx.prim[i].mode = mode; in vbo_exec_Begin()
839 exec->vtx.prim[i].begin = 1; in vbo_exec_Begin()
840 exec->vtx.prim[i].end = 0; in vbo_exec_Begin()
841 exec->vtx.prim[i].indexed = 0; in vbo_exec_Begin()
842 exec->vtx.prim[i].weak = 0; in vbo_exec_Begin()
843 exec->vtx.prim[i].pad = 0; in vbo_exec_Begin()
844 exec->vtx.prim[i].start = exec->vtx.vert_count; in vbo_exec_Begin()
845 exec->vtx.prim[i].count = 0; in vbo_exec_Begin()
846 exec->vtx.prim[i].num_instances = 1; in vbo_exec_Begin()
847 exec->vtx.prim[i].base_instance = 0; in vbo_exec_Begin()
867 if (exec->vtx.prim_count > 0) { in vbo_exec_End()
869 int idx = exec->vtx.vert_count; in vbo_exec_End()
870 int i = exec->vtx.prim_count - 1; in vbo_exec_End()
872 exec->vtx.prim[i].end = 1; in vbo_exec_End()
873 exec->vtx.prim[i].count = idx - exec->vtx.prim[i].start; in vbo_exec_End()
878 if (exec->vtx.prim_count == VBO_MAX_PRIM) in vbo_exec_End()
1150 assert(exec->vtx.bufferobj == ctx->Shared->NullBufferObj); in vbo_use_buffer_objects()
1151 if (exec->vtx.buffer_map) { in vbo_use_buffer_objects()
1152 _mesa_align_free(exec->vtx.buffer_map); in vbo_use_buffer_objects()
1153 exec->vtx.buffer_map = NULL; in vbo_use_buffer_objects()
1154 exec->vtx.buffer_ptr = NULL; in vbo_use_buffer_objects()
1158 _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL); in vbo_use_buffer_objects()
1159 exec->vtx.bufferobj = ctx->Driver.NewBufferObject(ctx, bufName, target); in vbo_use_buffer_objects()
1160 if (!ctx->Driver.BufferData(ctx, target, size, NULL, usage, exec->vtx.bufferobj)) { in vbo_use_buffer_objects()
1191 &exec->vtx.bufferobj, in vbo_exec_vtx_init()
1194 ASSERT(!exec->vtx.buffer_map); in vbo_exec_vtx_init()
1195 exec->vtx.buffer_map = (GLfloat *)_mesa_align_malloc(VBO_VERT_BUFFER_SIZE, 64); in vbo_exec_vtx_init()
1196 exec->vtx.buffer_ptr = exec->vtx.buffer_map; in vbo_exec_vtx_init()
1206 ASSERT(i < Elements(exec->vtx.attrsz)); in vbo_exec_vtx_init()
1207 exec->vtx.attrsz[i] = 0; in vbo_exec_vtx_init()
1208 ASSERT(i < Elements(exec->vtx.attrtype)); in vbo_exec_vtx_init()
1209 exec->vtx.attrtype[i] = GL_FLOAT; in vbo_exec_vtx_init()
1210 ASSERT(i < Elements(exec->vtx.active_sz)); in vbo_exec_vtx_init()
1211 exec->vtx.active_sz[i] = 0; in vbo_exec_vtx_init()
1214 ASSERT(i < Elements(exec->vtx.inputs)); in vbo_exec_vtx_init()
1215 ASSERT(i < Elements(exec->vtx.arrays)); in vbo_exec_vtx_init()
1216 exec->vtx.inputs[i] = &exec->vtx.arrays[i]; in vbo_exec_vtx_init()
1220 struct gl_client_array *arrays = exec->vtx.arrays; in vbo_exec_vtx_init()
1246 exec->vtx.vertex_size = 0; in vbo_exec_vtx_init()
1260 if (exec->vtx.buffer_map) { in vbo_exec_vtx_destroy()
1261 ASSERT(exec->vtx.bufferobj->Name == 0 || in vbo_exec_vtx_destroy()
1262 exec->vtx.bufferobj->Name == IMM_BUFFER_NAME); in vbo_exec_vtx_destroy()
1263 if (exec->vtx.bufferobj->Name == 0) { in vbo_exec_vtx_destroy()
1264 _mesa_align_free(exec->vtx.buffer_map); in vbo_exec_vtx_destroy()
1265 exec->vtx.buffer_map = NULL; in vbo_exec_vtx_destroy()
1266 exec->vtx.buffer_ptr = NULL; in vbo_exec_vtx_destroy()
1272 for (i = 0; i < Elements(exec->vtx.arrays); i++) { in vbo_exec_vtx_destroy()
1274 &exec->vtx.arrays[i].BufferObj, in vbo_exec_vtx_destroy()
1280 if (_mesa_bufferobj_mapped(exec->vtx.bufferobj)) { in vbo_exec_vtx_destroy()
1281 ctx->Driver.UnmapBuffer(ctx, exec->vtx.bufferobj); in vbo_exec_vtx_destroy()
1283 _mesa_reference_buffer_object(ctx, &exec->vtx.bufferobj, NULL); in vbo_exec_vtx_destroy()
1345 exec->vtx.attrsz[i] = 0; in reset_attrfv()
1346 exec->vtx.attrtype[i] = GL_FLOAT; in reset_attrfv()
1347 exec->vtx.active_sz[i] = 0; in reset_attrfv()
1350 exec->vtx.vertex_size = 0; in reset_attrfv()