diff options
author | Leonard Kugis <leonardkugis@gmail.com> | 2018-01-28 22:26:04 +0100 |
---|---|---|
committer | Leonard Kugis <leonardkugis@gmail.com> | 2018-01-28 22:26:04 +0100 |
commit | cc884ee71f017d9493da22565fc33e6828da123d (patch) | |
tree | 33f97802d7f1461155d34fed0da2cfe1fe657945 /Release | |
parent | da4b72ea58e97d14306cfd322a8ef7a40337645d (diff) |
Added point and click functionality
Diffstat (limited to 'Release')
-rw-r--r-- | Release/cl/mandelbrot64.cl | 34 | ||||
-rw-r--r-- | Release/glade/settings.glade | 263 |
2 files changed, 160 insertions, 137 deletions
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 @@ <property name="can_focus">False</property> <property name="n_rows">6</property> <property name="n_columns">2</property> - <property name="homogeneous">True</property> <child> <object class="GtkLabel" id="iterationsLbl"> <property name="visible">True</property> @@ -220,107 +219,6 @@ </packing> </child> <child> - <object class="GtkLabel" id="zoomLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Zoom to (temp)</property> - </object> - <packing> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkHBox" id="hbox6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkLabel" id="zoomToXLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">X</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="zoomToXEntry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkHBox" id="hbox7"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <child> - <object class="GtkLabel" id="zoomToYLbl"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes">Y</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkEntry" id="zoomToYEntry"> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="invisible_char">●</property> - <property name="primary_icon_activatable">False</property> - <property name="secondary_icon_activatable">False</property> - <property name="primary_icon_sensitive">True</property> - <property name="secondary_icon_sensitive">True</property> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="expand">True</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">3</property> - <property name="bottom_attach">4</property> - </packing> - </child> - <child> <object class="GtkLabel" id="speedLbl"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -420,6 +318,132 @@ <property name="right_attach">2</property> </packing> </child> + <child> + <object class="GtkLabel" id="zoomLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Zoom</property> + </object> + <packing> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + </packing> + </child> + <child> + <object class="GtkFrame" id="zoomFrame"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label_xalign">0</property> + <child> + <object class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="left_padding">12</property> + <child> + <object class="GtkVBox" id="vbox3"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkCheckButton" id="zoomSpecificCb"> + <property name="label" translatable="yes">Zoom to specific coordinates</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <child> + <object class="GtkLabel" id="zoomToXLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">X</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="zoomToXEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="zoomToYLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Y</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> + <child> + <object class="GtkEntry" id="zoomToYEntry"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="invisible_char">●</property> + <property name="primary_icon_activatable">False</property> + <property name="secondary_icon_activatable">False</property> + <property name="primary_icon_sensitive">True</property> + <property name="secondary_icon_sensitive">True</property> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + </object> + <packing> + <property name="expand">True</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + </object> + </child> + </object> + </child> + <child type="label"> + <object class="GtkLabel" id="zoomLbl1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Zoom precision</property> + <property name="use_markup">True</property> + </object> + </child> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + </packing> + </child> </object> </child> </object> @@ -521,7 +545,7 @@ <object class="GtkLabel" id="fpuLbl"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">FPU float depth</property> + <property name="label" translatable="yes">FPU float precision</property> </object> <packing> <property name="expand">True</property> @@ -863,20 +887,20 @@ <object class="GtkTable" id="table1"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="n_rows">2</property> + <property name="n_rows">3</property> <property name="n_columns">2</property> <child> <object class="GtkLabel" id="inLbl"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Zoom in</property> + <property name="label" translatable="yes">Start zoom</property> </object> </child> <child> - <object class="GtkLabel" id="outLbl"> + <object class="GtkLabel" id="incIterLbl"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="label" translatable="yes">Zoom out</property> + <property name="label" translatable="yes">Increase iterations</property> </object> <packing> <property name="top_attach">1</property> @@ -884,6 +908,17 @@ </packing> </child> <child> + <object class="GtkLabel" id="decIterLbl"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="label" translatable="yes">Decrease iterations</property> + </object> + <packing> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> + <child> <object class="GtkComboBoxText" id="inCombo"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -894,7 +929,7 @@ </packing> </child> <child> - <object class="GtkComboBoxText" id="outCombo"> + <object class="GtkComboBoxText" id="incIterCombo"> <property name="visible">True</property> <property name="can_focus">False</property> </object> @@ -905,6 +940,18 @@ <property name="bottom_attach">2</property> </packing> </child> + <child> + <object class="GtkComboBoxText" id="decIterCombo"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + </packing> + </child> </object> </child> </object> |