Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/intern/DRW_gpu_wrapper.hh
| Show First 20 Lines • Show All 232 Lines • ▼ Show 20 Lines | void push_update() | ||||
| GPU_storagebuf_update(ssbo_, this->data_); | GPU_storagebuf_update(ssbo_, this->data_); | ||||
| } | } | ||||
| void clear_to_zero() | void clear_to_zero() | ||||
| { | { | ||||
| GPU_storagebuf_clear_to_zero(ssbo_); | GPU_storagebuf_clear_to_zero(ssbo_); | ||||
| } | } | ||||
| void read() | |||||
| { | |||||
| GPU_storagebuf_read(ssbo_, this->data_); | |||||
| } | |||||
| operator GPUStorageBuf *() const | operator GPUStorageBuf *() const | ||||
| { | { | ||||
| return ssbo_; | return ssbo_; | ||||
| } | } | ||||
| /* To be able to use it with DRW_shgroup_*_ref(). */ | /* To be able to use it with DRW_shgroup_*_ref(). */ | ||||
| GPUStorageBuf **operator&() | GPUStorageBuf **operator&() | ||||
| { | { | ||||
| return &ssbo_; | return &ssbo_; | ||||
| ▲ Show 20 Lines • Show All 596 Lines • ▼ Show 20 Lines | public: | ||||
| bool ensure_cube_array(int, int, int, eGPUTextureFormat, float *) = delete; | bool ensure_cube_array(int, int, int, eGPUTextureFormat, float *) = delete; | ||||
| void filter_mode(bool) = delete; | void filter_mode(bool) = delete; | ||||
| void free() = delete; | void free() = delete; | ||||
| GPUTexture *mip_view(int) = delete; | GPUTexture *mip_view(int) = delete; | ||||
| GPUTexture *layer_view(int) = delete; | GPUTexture *layer_view(int) = delete; | ||||
| GPUTexture *stencil_view() = delete; | GPUTexture *stencil_view() = delete; | ||||
| }; | }; | ||||
| /** | |||||
| * Dummy type to bind texture as image. | |||||
| * It is just a GPUTexture in disguise. | |||||
| */ | |||||
| class Image {}; | |||||
| static inline Image *as_image(GPUTexture *tex) | |||||
| { | |||||
| return reinterpret_cast<Image *>(tex); | |||||
| } | |||||
| static inline Image **as_image(GPUTexture **tex) | |||||
| { | |||||
| return reinterpret_cast<Image **>(tex); | |||||
| } | |||||
| static inline GPUTexture *as_texture(Image *img) | |||||
| { | |||||
| return reinterpret_cast<GPUTexture *>(img); | |||||
| } | |||||
| static inline GPUTexture **as_texture(Image **img) | |||||
| { | |||||
| return reinterpret_cast<GPUTexture **>(img); | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Framebuffer | /** \name Framebuffer | ||||
| * \{ */ | * \{ */ | ||||
| class Framebuffer : NonCopyable { | class Framebuffer : NonCopyable { | ||||
| private: | private: | ||||
| ▲ Show 20 Lines • Show All 108 Lines • Show Last 20 Lines | |||||