24 glGenTextures(1, &s->
zdz0t);
D;
26 glBindTexture(GL_TEXTURE_2D, s->
zdz0t);
D;
27 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
D;
28 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
D;
29 glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI_EXT,
FPXX_STEP_ITERS,
DE ? 2 : 1, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, 0);
D;
30 mpfr_inits2(53, s->
cx, s->
cy, s->
zx, s->
zy, s->
dzx, s->
dzy, s->
t1, s->
t2, s->
t3, s->
t4, (mpfr_ptr) 0);
31 glGenVertexArrays(1, &s->
vao);
D;
39 glDeleteTextures(1, &s->
zdz0t);
D;
41 mpfr_clears(s->
cx, s->
cy, s->
zx, s->
zy, s->
dzx, s->
dzy, s->
t1, s->
t2, s->
t3, s->
t4, (mpfr_ptr) 0);
42 glDeleteVertexArrays(1, &s->
vao);
D;
55 void fpxx_step_start(
struct fpxx_step *s, GLuint vbo,
double escaperadius2,
const mpfr_t zx,
const mpfr_t zy,
const mpfr_t dzx,
const mpfr_t dzy,
const mpfr_t refx,
const mpfr_t refy,
bool initial_slice) {
67 mpfr_prec_t p = mpfr_get_prec(refx);
68 mpfr_set_prec(s->
cx, p); mpfr_set(s->
cx, refx, MPFR_RNDN);
69 mpfr_set_prec(s->
cy, p); mpfr_set(s->
cy, refy, MPFR_RNDN);
70 mpfr_set_prec(s->
zx, p); mpfr_set(s->
zx, zx, MPFR_RNDN);
71 mpfr_set_prec(s->
zy, p); mpfr_set(s->
zy, zy, MPFR_RNDN);
72 mpfr_set_prec(s->
dzx, p); mpfr_set(s->
dzx, dzx, MPFR_RNDN);
73 mpfr_set_prec(s->
dzy, p); mpfr_set(s->
dzy, dzy, MPFR_RNDN);
74 mpfr_set_prec(s->
t1, p);
75 mpfr_set_prec(s->
t2, p);
76 mpfr_set_prec(s->
t3, p);
77 mpfr_set_prec(s->
t4, p);
80 glUniform1d(s->
er2, escaperadius2);
D;
84 glBindVertexArray(s->
vao);
D;
85 glBindBuffer(GL_ARRAY_BUFFER, vbo);
D;
86 glEnableVertexAttribArray(s->
cne0);
D;
87 glEnableVertexAttribArray(s->
zdz0);
D;
88 glEnableVertexAttribArray(s->
err0);
D;
89 glVertexAttribLPointer(s->
cne0, 4, GL_DOUBLE, (
DE ? 9 : 7) *
sizeof(GLdouble), 0);
D;
90 glVertexAttribLPointer(s->
zdz0,
DE ? 4 : 2, GL_DOUBLE, (
DE ? 9 : 7) *
sizeof(GLdouble), ((GLbyte *)0)+(4*
sizeof(GLdouble)));
D;
91 glVertexAttribLPointer(s->
err0, 1, GL_DOUBLE, (
DE ? 9 : 7) *
sizeof(GLdouble), ((GLbyte *)0)+((
DE ? 8 : 6)*
sizeof(GLdouble)));
D;
92 glBindBuffer(GL_ARRAY_BUFFER, 0);
D;
93 glBindVertexArray(0);
D;
103 x.
d = mpfr_get_d(i, MPFR_RNDN);
122 mpfr_mul(s->
t1, s->
zx, s->
dzx, MPFR_RNDN);
123 mpfr_mul(s->
t2, s->
zy, s->
dzy, MPFR_RNDN);
124 mpfr_sub(s->
t3, s->
t1, s->
t2, MPFR_RNDN);
125 mpfr_mul(s->
t1, s->
zx, s->
dzy, MPFR_RNDN);
126 mpfr_mul(s->
t2, s->
zy, s->
dzx, MPFR_RNDN);
127 mpfr_mul_2ui(s->
dzx, s->
t3, 1, MPFR_RNDN);
128 mpfr_add_ui(s->
dzx, s->
dzx, 1, MPFR_RNDN);
129 mpfr_add(s->
dzy, s->
t1, s->
t2, MPFR_RNDN);
130 mpfr_mul_2ui(s->
dzy, s->
dzy, 1, MPFR_RNDN);
133 mpfr_sqr(s->
t1, s->
zx, MPFR_RNDN);
134 mpfr_sqr(s->
t2, s->
zy, MPFR_RNDN);
135 mpfr_mul(s->
zy, s->
zx, s->
zy, MPFR_RNDN);
136 mpfr_mul_2ui(s->
zy, s->
zy, 1, MPFR_RNDN);
137 mpfr_sub(s->
zx, s->
t1, s->
t2, MPFR_RNDN);
138 mpfr_add(s->
zx, s->
zx, s->
cx, MPFR_RNDN);
139 mpfr_add(s->
zy, s->
zy, s->
cy, MPFR_RNDN);
158 glBindVertexArray(s->
vao);
D;
161 glEnable(GL_RASTERIZER_DISCARD);
D;
162 glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, vbo);
D;
163 glBeginQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, query);
D;
164 glBeginTransformFeedback(GL_POINTS);
D;
165 glDrawArrays(GL_POINTS, 0, *active_count);
D;
166 glEndTransformFeedback();
D;
167 glEndQuery(GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN);
D;
168 int before = *active_count;
169 glGetQueryObjectuiv(query, GL_QUERY_RESULT, active_count);
D;
170 int after = *active_count;
171 debug_message(
"step active_count: %d -> %d\n", before, after);
172 glBindBufferBase(GL_TRANSFORM_FEEDBACK_BUFFER, 0, 0);
D;
173 glDisable(GL_RASTERIZER_DISCARD);
D;
175 glBindVertexArray(0);
D;