From cc884ee71f017d9493da22565fc33e6828da123d Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Sun, 28 Jan 2018 22:26:04 +0100 Subject: Added point and click functionality --- Release/cl/mandelbrot64.cl | 34 +----- Release/glade/settings.glade | 263 +++++++++++++++++++++++++------------------ 2 files changed, 160 insertions(+), 137 deletions(-) (limited to 'Release') diff --git a/Release/cl/mandelbrot64.cl b/Release/cl/mandelbrot64.cl index be38b4a..c89f17c 100644 --- a/Release/cl/mandelbrot64.cl +++ b/Release/cl/mandelbrot64.cl @@ -1,11 +1,15 @@ +#define native_log2 log2 +#define native_cos cos + #ifdef KHR_DP_EXTENSION #pragma OPENCL EXTENSION cl_khr_fp64 : enable #else #pragma OPENCL EXTENSION cl_amd_fp64 : enable #endif -__kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, const double posy, const double stepSizeX, const double stepSizeY, const uint maxIterations, const uint width) +__kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, const double posy, const double stepSizeX, const double stepSizeY, const uint maxIterations, const int width) { +//printf("%f, %f, %f, %f, %u, %d", posx, posy, stepSizeX, stepSizeY, maxIterations, width); int tid = get_global_id(0); int i = tid % (width / 4); @@ -162,13 +166,6 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[0].s1 = 0; color[0].s2 = 0; } - if (bench) - { - color[0].s0 = ccount.s0 & 0xff; - color[0].s1 = (ccount.s0 & 0xff00) >> 8; - color[0].s2 = (ccount.s0 & 0xff0000) >> 16; - color[0].s3 = (ccount.s0 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid] = color[0]; c = fc.s1 * 2.0 * 3.1416 / 256.0; color[1].s0 = ((1.0 + native_cos(c)) * 0.5) * 255; @@ -181,13 +178,6 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[1].s1 = 0; color[1].s2 = 0; } - if (bench) - { - color[1].s0 = ccount.s1 & 0xff; - color[1].s1 = (ccount.s1 & 0xff00) >> 8; - color[1].s2 = (ccount.s1 & 0xff0000) >> 16; - color[1].s3 = (ccount.s1 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid + 1] = color[1]; c = fc.s2 * 2.0 * 3.1416 / 256.0; color[2].s0 = ((1.0 + native_cos(c)) * 0.5) * 255; @@ -200,13 +190,6 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[2].s1 = 0; color[2].s2 = 0; } - if (bench) - { - color[2].s0 = ccount.s2 & 0xff; - color[2].s1 = (ccount.s2 & 0xff00) >> 8; - color[2].s2 = (ccount.s2 & 0xff0000) >> 16; - color[2].s3 = (ccount.s2 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid + 2] = color[2]; c = fc.s3 * 2.0 * 3.1416 / 256.0; color[3].s0 = ((1.0 + native_cos(c)) * 0.5) * 255; @@ -219,12 +202,5 @@ __kernel void calculate(__global uchar4 * mandelbrotImage, const double posx, co color[3].s1 = 0; color[3].s2 = 0; } - if (bench) - { - color[3].s0 = ccount.s3 & 0xff; - color[3].s1 = (ccount.s3 & 0xff00) >> 8; - color[3].s2 = (ccount.s3 & 0xff0000) >> 16; - color[3].s3 = (ccount.s3 & 0xff000000) >> 24; - } mandelbrotImage[4 * tid + 3] = color[3]; } \ No newline at end of file diff --git a/Release/glade/settings.glade b/Release/glade/settings.glade index ff11a2c..8029d00 100644 --- a/Release/glade/settings.glade +++ b/Release/glade/settings.glade @@ -95,7 +95,6 @@ False 6 2 - True True @@ -219,107 +218,6 @@ 3 - - - True - False - Zoom to (temp) - - - 3 - 4 - - - - - True - False - - - True - False - - - True - False - X - - - True - True - 0 - - - - - True - True - - False - False - True - True - - - True - True - 1 - - - - - True - True - 0 - - - - - True - False - - - True - False - Y - - - True - True - 0 - - - - - True - True - - False - False - True - True - - - True - True - 1 - - - - - True - True - 1 - - - - - 1 - 2 - 3 - 4 - - True @@ -420,6 +318,132 @@ 2 + + + True + False + Zoom + + + 3 + 4 + + + + + True + False + 0 + + + True + False + 12 + + + True + False + + + Zoom to specific coordinates + True + True + False + True + + + True + True + 0 + + + + + True + False + + + True + False + X + + + True + True + 0 + + + + + True + True + + False + False + True + True + + + True + True + 1 + + + + + True + False + Y + + + True + True + 2 + + + + + True + True + + False + False + True + True + + + True + True + 3 + + + + + True + True + 1 + + + + + + + + + True + False + Zoom precision + True + + + + + 1 + 2 + 3 + 4 + + @@ -521,7 +545,7 @@ True False - FPU float depth + FPU float precision True @@ -863,26 +887,37 @@ True False - 2 + 3 2 True False - Zoom in + Start zoom - + True False - Zoom out + Increase iterations 1 2 + + + True + False + Decrease iterations + + + 2 + 3 + + True @@ -894,7 +929,7 @@ - + True False @@ -905,6 +940,18 @@ 2 + + + True + False + + + 1 + 2 + 2 + 3 + + -- cgit v1.2.1