mightymandel v16

GPU-based Mandelbrot set explorer

slice.c File Reference

(v16)

#include <assert.h>
#include <stdlib.h>
#include <GL/glew.h>
#include "slice.h"
#include "texture.h"
#include "config.glsl"
+ Include dependency graph for slice.c:

Go to the source code of this file.

Data Structures

struct  slice_coord
struct  slice_table

Macros

#define FILL(next, from)
#define INVERT(next)
#define UPLOAD(n)   glTexImage2D(GL_TEXTURE_2D, SLICE_MAX - n, GL_R16UI, 1 << n, 1 << n, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, &t->s##n[0][0])
#define UPLOAD(n)   glTexImage2D(GL_TEXTURE_2D, SLICE_MAX - n, GL_RG8UI, 1 << n, 1 << n, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, &t->c##n[0][0].i)
#define CASE(k)   case k: *i = t->c##k[ii][jj].i; *j = t->c##k[ii][jj].j; break

Functions

struct slice_tableslice_table_new ()
void slice_table_delete (struct slice_table *t)
void slice_table_coords (struct slice_table *t, int slice, int n, int *i, int *j)

Data Structure Documentation

struct slice_coord

Definition at line 13 of file slice.c.

Data Fields
GLubyte i
GLubyte j
struct slice_table

Definition at line 18 of file slice.c.

+ Collaboration diagram for slice_table:
Data Fields
struct slice_coord c0
struct slice_coord c1
struct slice_coord c2
struct slice_coord c3
struct slice_coord c4
struct slice_coord c5
struct slice_coord c6
struct slice_coord c7
struct slice_coord c8
GLuint c_tex
GLushort s0
GLushort s1
GLushort s2
GLushort s3
GLushort s4
GLushort s5
GLushort s6
GLushort s7
GLushort s8
GLuint s_tex

Macro Definition Documentation

#define CASE (   k)    case k: *i = t->c##k[ii][jj].i; *j = t->c##k[ii][jj].j; break

Referenced by slice_table_coords().

#define FILL (   next,
  from 
)
Value:
do{ \
for (int i = 0; i < (1 << next); ++i) { \
for (int j = 0; j < (1 << next); ++j) { \
int k = t->s##from[i >> 1][j >> 1]; \
int n = t->s1[i & 1][j & 1]; \
t->s##next[i][j] = k + n * (1 << (from << 1)); \
} \
} \
}while(0)

Referenced by slice_table_new().

#define INVERT (   next)
Value:
do{ \
for (int i = 0; i < (1 << next); ++i) { \
for (int j = 0; j < (1 << next); ++j) { \
int k = t->s##next[i][j]; \
int ii = k >> next; \
int jj = k - (ii << next); \
t->c##next[ii][jj].i = i; \
t->c##next[ii][jj].j = j; \
} \
} \
}while(0)

Referenced by slice_table_new().

#define UPLOAD (   n)    glTexImage2D(GL_TEXTURE_2D, SLICE_MAX - n, GL_R16UI, 1 << n, 1 << n, 0, GL_RED_INTEGER, GL_UNSIGNED_SHORT, &t->s##n[0][0])

Referenced by slice_table_new().

#define UPLOAD (   n)    glTexImage2D(GL_TEXTURE_2D, SLICE_MAX - n, GL_RG8UI, 1 << n, 1 << n, 0, GL_RG_INTEGER, GL_UNSIGNED_BYTE, &t->c##n[0][0].i)

Function Documentation

void slice_table_coords ( struct slice_table t,
int  slice,
int  n,
int *  i,
int *  j 
)

Definition at line 138 of file slice.c.

References CASE, and SLICE_MAX.

Referenced by fp32_start(), fp64_start(), and fpxx_start().

+ Here is the caller graph for this function:

void slice_table_delete ( struct slice_table t)

Definition at line 127 of file slice.c.

References slice_table::c_tex, slice_table::s_tex, TEX_SLICE_COORDS, and TEX_SLICE_NUMBER.

Referenced by render_end().

+ Here is the caller graph for this function:

struct slice_table* slice_table_new ( )
read

Definition at line 44 of file slice.c.

References slice_table::c_tex, FILL, INVERT, slice_table::s0, slice_table::s1, slice_table::s_tex, TEX_SLICE_COORDS, TEX_SLICE_NUMBER, and UPLOAD.

Referenced by render_begin().

+ Here is the caller graph for this function: