diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-04-28 20:25:57 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-04-28 20:25:57 +0300 |
commit | b868f43fd382c0497b82f29685f6280d9692a0fb (patch) | |
tree | 7fac681bd1e08283cd3168a30b5362f250bf6da2 /intern/cycles/device/device.h | |
parent | ba4f47ce8eb00284da7d6b17bf9c3f02506617e3 (diff) |
Cycles support for preview on viewport with core profile
This upgrade the drawing code to use latest opengl calls.
Also, it adds a fallback shader for opencolorio.
Reviewers: sergey, brecht
Subscribers: merwin, fclem
Differential Revision: https://developer.blender.org/D2652
Diffstat (limited to 'intern/cycles/device/device.h')
-rw-r--r-- | intern/cycles/device/device.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/intern/cycles/device/device.h b/intern/cycles/device/device.h index 6051dd8b3eb..21d29a801ae 100644 --- a/intern/cycles/device/device.h +++ b/intern/cycles/device/device.h @@ -229,13 +229,26 @@ struct DeviceDrawParams { class Device { protected: - Device(DeviceInfo& info_, Stats &stats_, bool background) : background(background), vertex_buffer(0), info(info_), stats(stats_) {} + enum { + FALLBACK_SHADER_STATUS_NONE = 0, + FALLBACK_SHADER_STATUS_ERROR, + FALLBACK_SHADER_STATUS_SUCCESS, + }; + + Device(DeviceInfo& info_, Stats &stats_, bool background) : background(background), + vertex_buffer(0), + fallback_status(FALLBACK_SHADER_STATUS_NONE), fallback_shader_program(0), + info(info_), stats(stats_) {} bool background; string error_msg; /* used for real time display */ unsigned int vertex_buffer; + int fallback_status, fallback_shader_program; + int image_texture_location, fullscreen_location; + + bool bind_fallback_display_space_shader(const float width, const float height); public: virtual ~Device(); @@ -300,9 +313,10 @@ public: virtual void task_cancel() = 0; /* opengl drawing */ - virtual void draw_pixels(device_memory& mem, int y, int w, int h, - int dx, int dy, int width, int height, bool transparent, - const DeviceDrawParams &draw_params); + virtual void draw_pixels(device_memory& mem, int y, + int w, int h, int width, int height, + int dx, int dy, int dw, int dh, + bool transparent, const DeviceDrawParams &draw_params); #ifdef WITH_NETWORK /* networking */ |