From c8a38bd8ad66eb0b35f08a4733fdee37a888b83c Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Sat, 27 Jan 2018 02:03:31 +0100 Subject: OpenCL rendering added, not working properly --- src/render_opencl.h | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'src/render_opencl.h') diff --git a/src/render_opencl.h b/src/render_opencl.h index aaa9df6..b995c4d 100644 --- a/src/render_opencl.h +++ b/src/render_opencl.h @@ -11,10 +11,24 @@ #include "defs.h" #include #include +#include +#include "sets.h" +#include + +#define OPENCL_FPU_32 0 +#define OPENCL_FPU_64 1 +#define OPENCL_FPU_128 2 + +#define MAX_SOURCE_SIZE 0xFFFF // 64 KiB +#define MAX_DEVICES 4 typedef struct config_opencl { + u8 fpu; + u8 fma; + GLuint tex; + d64 (*zoom_func)(d64, d64); + u8 set_func; // id, not pointer! u32 *arr; - u32 (*set_func)(d64, d64, u32); u32 iterations; u32 colorFrom; u32 colorTo; @@ -28,6 +42,32 @@ typedef struct config_opencl { OpenCLConfig *config_opencl; +d64 x_min, x_max, y_min, y_max; +d64 x_min_s, x_max_s, y_min_s, y_max_s; + +float cl_ft; +cl_uint *output; +cl_device_id device_id; +cl_context context; +cl_int ret; +cl_kernel kernel_vector[MAX_DEVICES]; +cl_uint num_devices; +cl_device_id *devices; +cl_command_queue commandQueue[MAX_DEVICES]; +cl_mem outputBuffer[MAX_DEVICES]; + +double xpos; +double ypos; +double xsize; +double ysize; +double xstep; +double ystep; +double leftx; +double topy; +double topy0; + +d64 zoom_func(d64 ft, d64 s); + void init_opencl(OpenCLConfig *config); void render_opencl(void); void idle_opencl(void); -- cgit v1.2.1