Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/image/image_instance_data.hh
| Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | struct { | ||||
| bool do_tile_drawing : 1; | bool do_tile_drawing : 1; | ||||
| } flags; | } flags; | ||||
| struct { | struct { | ||||
| DRWPass *image_pass; | DRWPass *image_pass; | ||||
| DRWPass *depth_pass; | DRWPass *depth_pass; | ||||
| } passes; | } passes; | ||||
| /** | |||||
| * Cache containing the float buffers when drawing byte images. | |||||
| */ | |||||
| FloatBufferCache float_buffers; | |||||
| /** \brief Transform matrix to convert a normalized screen space coordinates to texture space. */ | /** \brief Transform matrix to convert a normalized screen space coordinates to texture space. */ | ||||
| float ss_to_texture[4][4]; | float ss_to_texture[4][4]; | ||||
| TextureInfo texture_infos[SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN]; | TextureInfo texture_infos[SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN]; | ||||
| public: | public: | ||||
| virtual ~IMAGE_InstanceData() = default; | virtual ~IMAGE_InstanceData() = default; | ||||
| void clear_dirty_flag() | void clear_dirty_flag() | ||||
| Show All 40 Lines | public: | ||||
| } | } | ||||
| void update_image_usage(const ImageUser *image_user) | void update_image_usage(const ImageUser *image_user) | ||||
| { | { | ||||
| ImageUsage usage(image, image_user, flags.do_tile_drawing); | ImageUsage usage(image, image_user, flags.do_tile_drawing); | ||||
| if (last_usage != usage) { | if (last_usage != usage) { | ||||
| last_usage = usage; | last_usage = usage; | ||||
| reset_dirty_flag(true); | reset_dirty_flag(true); | ||||
| float_buffers.clear(); | |||||
| } | } | ||||
| } | } | ||||
| private: | private: | ||||
| /** \brief Set dirty flag of all texture slots to the given value. */ | /** \brief Set dirty flag of all texture slots to the given value. */ | ||||
| void reset_dirty_flag(bool new_value) | void reset_dirty_flag(bool new_value) | ||||
| { | { | ||||
| for (int i = 0; i < SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN; i++) { | for (int i = 0; i < SCREEN_SPACE_DRAWING_MODE_TEXTURE_LEN; i++) { | ||||
| texture_infos[i].dirty = new_value; | texture_infos[i].dirty = new_value; | ||||
| } | } | ||||
| } | } | ||||
| }; | }; | ||||