MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / copy_vector_field

Function copy_vector_field

src/backend/cpu/vector_field.cpp:26–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24
25template<typename T>
26void copy_vector_field(const Array<T> &points, const Array<T> &directions,
27 fg_vector_field vfield) {
28 ForgeModule &_ = forgePlugin();
29 points.eval();
30 directions.eval();
31 getQueue().sync();
32
33 CheckGL("Before CopyArrayToVBO");
34
35 unsigned size1 = 0, size2 = 0;
36 unsigned buff1 = 0, buff2 = 0;
37 FG_CHECK(_.fg_get_vector_field_vertex_buffer_size(&size1, vfield));
38 FG_CHECK(_.fg_get_vector_field_direction_buffer_size(&size2, vfield));
39 FG_CHECK(_.fg_get_vector_field_vertex_buffer(&buff1, vfield));
40 FG_CHECK(_.fg_get_vector_field_direction_buffer(&buff2, vfield));
41
42 glBindBuffer(GL_ARRAY_BUFFER, buff1);
43 glBufferSubData(GL_ARRAY_BUFFER, 0, size1, points.get());
44 glBindBuffer(GL_ARRAY_BUFFER, 0);
45
46 glBindBuffer(GL_ARRAY_BUFFER, buff2);
47 glBufferSubData(GL_ARRAY_BUFFER, 0, size2, directions.get());
48 glBindBuffer(GL_ARRAY_BUFFER, 0);
49
50 CheckGL("In CopyArrayToVBO");
51}
52
53#define INSTANTIATE(T) \
54 template void copy_vector_field<T>(const Array<T> &, const Array<T> &, \

Callers

nothing calls this directly

Calls 4

getQueueFunction · 0.50
evalMethod · 0.45
syncMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected