18 s->
c = glGetAttribLocation(s->
program,
"c");
19 glGenVertexArrays(1, &s->
vao);
23 glDeleteVertexArrays(1, &s->
vao);
27 void fp64_init_do(
struct fp64_init *s, GLuint *active_count, GLuint *vbo, GLuint query,
int width,
int height,
const mpfr_t centerx,
const mpfr_t centery,
const mpfr_t radius) {
28 *active_count = width * height;
29 glEnable(GL_RASTERIZER_DISCARD);
D;
30 glBindVertexArray(s->
vao);
D;
31 glBindBuffer(GL_ARRAY_BUFFER, vbo[1]);
D;
33 glUniform1d(s->
radius, mpfr_get_d(radius, MPFR_RNDN));
D;
34 glUniform2d(s->
center, mpfr_get_d(centerx, MPFR_RNDN), mpfr_get_d(centery, MPFR_RNDN));
D;
35 glVertexAttribPointer(s->
c, 4, GL_FLOAT, GL_FALSE, 0, 0);
D;
36 glEnableVertexAttribArray(s->
c);
D;
37 glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, vbo[0]);
D;
38 glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, query);
D;
39 glBeginTransformFeedback(GL_POINTS);
D;
40 glDrawArrays(GL_POINTS, 0, *active_count);
D;
41 glEndTransformFeedback();
D;
42 glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
D;
43 glGetQueryObjectuiv(query, GL_QUERY_RESULT, active_count);
D;
44 glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0);
D;
46 glBindBuffer(GL_ARRAY_BUFFER, 0);
D;
47 glBindVertexArray(0);
D;
48 glDisable(GL_RASTERIZER_DISCARD);
D;