Cleanup: Remove unused method from image_engine.
`get_gpu_textures` was created when the image engine didn't support texture streaming and used the gpu textures that were stored in the image buffer itself.
This commit is contained in:
parent
5ee116d448
commit
50ef008c61
|
@ -61,16 +61,6 @@ class AbstractSpaceAccessor {
|
|||
virtual void get_shader_parameters(ShaderParameters &r_shader_parameters,
|
||||
ImBuf *image_buffer) = 0;
|
||||
|
||||
/**
|
||||
* Retrieve the gpu textures to draw.
|
||||
*/
|
||||
virtual void get_gpu_textures(Image *image,
|
||||
ImageUser *iuser,
|
||||
ImBuf *image_buffer,
|
||||
GPUTexture **r_gpu_texture,
|
||||
bool *r_owns_texture,
|
||||
GPUTexture **r_tex_tile_data) = 0;
|
||||
|
||||
/** \brief Is (wrap) repeat option enabled in the space. */
|
||||
virtual bool use_tile_drawing() const = 0;
|
||||
|
||||
|
|
|
@ -82,77 +82,6 @@ class SpaceImageAccessor : public AbstractSpaceAccessor {
|
|||
}
|
||||
}
|
||||
|
||||
void get_gpu_textures(Image *image,
|
||||
ImageUser *iuser,
|
||||
ImBuf *image_buffer,
|
||||
GPUTexture **r_gpu_texture,
|
||||
bool *r_owns_texture,
|
||||
GPUTexture **r_tex_tile_data) override
|
||||
{
|
||||
if (image->rr != nullptr) {
|
||||
/* Update multi-index and pass for the current eye. */
|
||||
BKE_image_multilayer_index(image->rr, iuser);
|
||||
}
|
||||
else {
|
||||
BKE_image_multiview_index(image, iuser);
|
||||
}
|
||||
|
||||
if (image_buffer == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (image_buffer->rect == nullptr && image_buffer->rect_float == nullptr) {
|
||||
/* This code-path is only supposed to happen when drawing a lazily-allocatable render result.
|
||||
* In all the other cases the `ED_space_image_acquire_buffer()` is expected to return nullptr
|
||||
* as an image buffer when it has no pixels. */
|
||||
|
||||
BLI_assert(image->type == IMA_TYPE_R_RESULT);
|
||||
|
||||
float zero[4] = {0, 0, 0, 0};
|
||||
*r_gpu_texture = GPU_texture_create_2d_ex(
|
||||
__func__, 1, 1, 0, GPU_RGBA16F, GPU_TEXTURE_USAGE_SHADER_READ, zero);
|
||||
*r_owns_texture = true;
|
||||
return;
|
||||
}
|
||||
|
||||
const int sima_flag = sima->flag & ED_space_image_get_display_channel_mask(image_buffer);
|
||||
if (sima_flag & SI_SHOW_ZBUF &&
|
||||
(image_buffer->zbuf || image_buffer->zbuf_float || (image_buffer->channels == 1))) {
|
||||
if (image_buffer->zbuf) {
|
||||
BLI_assert_msg(0, "Integer based depth buffers not supported");
|
||||
}
|
||||
else if (image_buffer->zbuf_float) {
|
||||
*r_gpu_texture = GPU_texture_create_2d_ex(__func__,
|
||||
image_buffer->x,
|
||||
image_buffer->y,
|
||||
0,
|
||||
GPU_R16F,
|
||||
GPU_TEXTURE_USAGE_SHADER_READ,
|
||||
image_buffer->zbuf_float);
|
||||
*r_owns_texture = true;
|
||||
}
|
||||
else if (image_buffer->rect_float && image_buffer->channels == 1) {
|
||||
*r_gpu_texture = GPU_texture_create_2d_ex(__func__,
|
||||
image_buffer->x,
|
||||
image_buffer->y,
|
||||
0,
|
||||
GPU_R16F,
|
||||
GPU_TEXTURE_USAGE_SHADER_READ,
|
||||
image_buffer->rect_float);
|
||||
*r_owns_texture = true;
|
||||
}
|
||||
}
|
||||
else if (image->source == IMA_SRC_TILED) {
|
||||
*r_gpu_texture = BKE_image_get_gpu_tiles(image, iuser, image_buffer);
|
||||
*r_tex_tile_data = BKE_image_get_gpu_tilemap(image, iuser, nullptr);
|
||||
*r_owns_texture = false;
|
||||
}
|
||||
else {
|
||||
*r_gpu_texture = BKE_image_get_gpu_texture(image, iuser, image_buffer);
|
||||
*r_owns_texture = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool use_tile_drawing() const override
|
||||
{
|
||||
return (sima->flag & SI_DRAW_TILE) != 0;
|
||||
|
|
|
@ -77,18 +77,6 @@ class SpaceNodeAccessor : public AbstractSpaceAccessor {
|
|||
}
|
||||
}
|
||||
|
||||
void get_gpu_textures(Image *image,
|
||||
ImageUser *iuser,
|
||||
ImBuf *ibuf,
|
||||
GPUTexture **r_gpu_texture,
|
||||
bool *r_owns_texture,
|
||||
GPUTexture **r_tex_tile_data) override
|
||||
{
|
||||
*r_gpu_texture = BKE_image_get_gpu_texture(image, iuser, ibuf);
|
||||
*r_owns_texture = false;
|
||||
*r_tex_tile_data = nullptr;
|
||||
}
|
||||
|
||||
bool use_tile_drawing() const override
|
||||
{
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue