Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/blender/blender_gpu_display.h
| Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | protected: | ||||
| /* Cached values of various OpenGL resources. */ | /* Cached values of various OpenGL resources. */ | ||||
| uint shader_program_ = 0; | uint shader_program_ = 0; | ||||
| }; | }; | ||||
| /* GPU display implementation which is specific for Blender viewport integration. */ | /* GPU display implementation which is specific for Blender viewport integration. */ | ||||
| class BlenderGPUDisplay : public GPUDisplay { | class BlenderGPUDisplay : public GPUDisplay { | ||||
| public: | public: | ||||
| BlenderGPUDisplay(BL::RenderEngine &b_engine, BL::Scene &b_scene); | BlenderGPUDisplay(BL::RenderEngine &b_engine, BL::Scene &b_scene, bool background); | ||||
| ~BlenderGPUDisplay(); | ~BlenderGPUDisplay(); | ||||
| protected: | protected: | ||||
| virtual bool do_update_begin(int texture_width, int texture_height) override; | virtual bool do_update_begin(int texture_width, int texture_height) override; | ||||
| virtual void do_update_end() override; | virtual void do_update_end() override; | ||||
| virtual void do_copy_pixels_to_texture(const half4 *rgba_pixels, | virtual void do_copy_pixels_to_texture(const half4 *rgba_pixels, | ||||
| int texture_x, | int texture_x, | ||||
| Show All 27 Lines | protected: | ||||
| void texture_update_if_needed(); | void texture_update_if_needed(); | ||||
| /* Update vetrex buffer with new coordinates of vertex positions and texture coordinates. | /* Update vetrex buffer with new coordinates of vertex positions and texture coordinates. | ||||
| * This buffer is used to render texture in the viewport. | * This buffer is used to render texture in the viewport. | ||||
| * | * | ||||
| * NOTE: The buffer needs to be bound. */ | * NOTE: The buffer needs to be bound. */ | ||||
| void vertex_buffer_update(); | void vertex_buffer_update(); | ||||
| /* The GPUDisplay is used for non-iteractive background render. */ | |||||
brecht: sued -> used | |||||
| bool background_; | |||||
| /* OpenGL context created by Blender's Window Manager. | /* OpenGL context created by Blender's Window Manager. | ||||
| * This context is used to perform texture update from the render thread, asynchronously from the | * This context is used to perform texture update from the render thread, asynchronously from the | ||||
| * main thread which draws the viewport. */ | * main thread which draws the viewport. */ | ||||
| void *gl_context_ = nullptr; | void *gl_context_ = nullptr; | ||||
| /* Texture which contains pixels of the render result. */ | /* Texture which contains pixels of the render result. */ | ||||
| struct { | struct { | ||||
| /* Indicates whether texture creation was attempted and succeeded. | /* Indicates whether texture creation was attempted and succeeded. | ||||
| ▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines | |||||
sued -> used