Set supports_rgba before calling image_texture_load

This commit is contained in:
twinaphex 2017-01-08 21:49:23 +01:00
parent ccca4c303d
commit 68d484bf60
3 changed files with 14 additions and 6 deletions

View File

@ -957,8 +957,10 @@ bool gl_renderchain_add_lut(const struct video_shader *shader,
struct texture_image img;
enum texture_filter_type filter_type = TEXTURE_FILTER_LINEAR;
img.width = img.height = 0;
img.pixels = NULL;
img.width = 0;
img.height = 0;
img.pixels = NULL;
img.supports_rgba = video_driver_supports_rgba();
if (!image_texture_load(&img, shader->lut[i].path))
{

View File

@ -2651,6 +2651,7 @@ static unique_ptr<StaticTexture> vulkan_filter_chain_load_lut(VkCommandBuffer cm
const video_shader_lut *shader)
{
texture_image image;
unique_ptr<Buffer> buffer;
VkMemoryRequirements mem_reqs;
VkImageCreateInfo image_info = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
VkImageViewCreateInfo view_info = { VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO };
@ -2660,7 +2661,11 @@ static unique_ptr<StaticTexture> vulkan_filter_chain_load_lut(VkCommandBuffer cm
VkImageView view = VK_NULL_HANDLE;
VkBufferImageCopy region = {};
void *ptr = nullptr;
unique_ptr<Buffer> buffer;
image.width = 0;
image.height = 0;
image.pixels = NULL;
image.supports_rgba = video_driver_supports_rgba();
if (!image_texture_load(&image, shader->path))
return {};

View File

@ -49,9 +49,10 @@ struct nk_image nk_common_image_load(const char *filename)
struct texture_image ti;
uintptr_t tex;
ti.width = 0;
ti.height = 0;
ti.pixels = NULL;
ti.width = 0;
ti.height = 0;
ti.pixels = NULL;
ti.supports_rgba = video_driver_supports_rgba();
image_texture_load(&ti, filename);