From 1c3ea27064257d8cf7b9f36b0388b8cf2e94ab08 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Fri, 26 Jan 2018 01:12:49 +0100 Subject: Skeleton for OpenCL rendering, cleaned up alot, WIP and crashing --- src/render_cpu.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/render_cpu.h (limited to 'src/render_cpu.h') diff --git a/src/render_cpu.h b/src/render_cpu.h new file mode 100644 index 0000000..6926687 --- /dev/null +++ b/src/render_cpu.h @@ -0,0 +1,58 @@ +/* + * render_cpu.h + * + * Created on: 25.01.2018 + * Author: Superleo1810 + */ + +#ifndef RENDER_CPU_H_ +#define RENDER_CPU_H_ + +#include "defs.h" +#include +#include +#include +#include + +typedef struct config_cpu { + u8 threads; + u32 *arr; + u32 (*set_func)(d64, d64, u32); + u32 iterations; + u32 colorFrom; + u32 colorTo; + d64 to_x; + d64 to_y; + d64 speed; + u16 width; + u16 height; + u8 renderFPS; +} CpuConfig; + +typedef struct t_args { + u8 tc; + u8 tid; + d64 x_min; + d64 x_max; + d64 y_min; + d64 y_max; + u32 (*sfunc) (d64, d64, u32); + u32 *arr; +} ThreadArgs; + + +CpuConfig *config_cpu; +GLuint tex; +u32 rendercnt; +d64 x_min, x_max, y_min, y_max; +d64 x_min_s, x_max_s, y_min_s, y_max_s; +int delta; +d64 dt, ft; + +void init_cpu(CpuConfig *config); +void render_cpu(void); +void idle_cpu(void); +void calculate(d64 x_min, d64 y_min, d64 x_max, d64 y_max, u32 (*sfunc) (d64, d64, u32), u32 *arr); +void calculate_t(void *args); + +#endif /* RENDER_CPU_H_ */ -- cgit v1.2.1 From 3d162bbcc92b22e6b00ee80194214c393770adb7 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Fri, 26 Jan 2018 15:34:06 +0100 Subject: fixed crash --- src/render_cpu.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/render_cpu.h') diff --git a/src/render_cpu.h b/src/render_cpu.h index 6926687..b4141ae 100644 --- a/src/render_cpu.h +++ b/src/render_cpu.h @@ -14,6 +14,8 @@ #include #include +#define COORDS(x, y, width) ((y)*(width)+(x)) + typedef struct config_cpu { u8 threads; u32 *arr; -- cgit v1.2.1 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_cpu.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/render_cpu.h') diff --git a/src/render_cpu.h b/src/render_cpu.h index b4141ae..7abbdc4 100644 --- a/src/render_cpu.h +++ b/src/render_cpu.h @@ -12,13 +12,16 @@ #include #include #include +#include #include #define COORDS(x, y, width) ((y)*(width)+(x)) typedef struct config_cpu { u8 threads; + GLuint tex; u32 *arr; + d64 (*zoom_func)(d64, d64); u32 (*set_func)(d64, d64, u32); u32 iterations; u32 colorFrom; @@ -42,14 +45,12 @@ typedef struct t_args { u32 *arr; } ThreadArgs; - CpuConfig *config_cpu; -GLuint tex; u32 rendercnt; +float ft; + d64 x_min, x_max, y_min, y_max; d64 x_min_s, x_max_s, y_min_s, y_max_s; -int delta; -d64 dt, ft; void init_cpu(CpuConfig *config); void render_cpu(void); -- cgit v1.2.1