Create gl_renderchain_add_lut

This commit is contained in:
twinaphex 2016-08-02 00:31:04 +02:00
parent ec91878187
commit 188dd9bd69
1 changed files with 37 additions and 29 deletions

View File

@ -3636,20 +3636,9 @@ unsigned *height_p, size_t *pitch_p)
}
#endif
bool gl_load_luts(const struct video_shader *shader,
GLuint *textures_lut)
static bool gl_renderchain_add_lut(const struct video_shader *shader,
unsigned i, GLuint *textures_lut)
{
unsigned i;
unsigned num_luts = MIN(shader->luts, GFX_MAX_TEXTURES);
if (!shader->luts)
return true;
glGenTextures(num_luts, textures_lut);
for (i = 0; i < num_luts; i++)
{
struct texture_image img = {0};
enum texture_filter_type filter_type = TEXTURE_FILTER_LINEAR;
@ -3680,6 +3669,25 @@ bool gl_load_luts(const struct video_shader *shader,
img.width, img.height,
img.pixels, sizeof(uint32_t));
image_texture_free(&img);
return true;
}
bool gl_load_luts(const struct video_shader *shader,
GLuint *textures_lut)
{
unsigned i;
unsigned num_luts = MIN(shader->luts, GFX_MAX_TEXTURES);
if (!shader->luts)
return true;
glGenTextures(num_luts, textures_lut);
for (i = 0; i < num_luts; i++)
{
if (!gl_renderchain_add_lut(shader, i, textures_lut))
return false;
}
glBindTexture(GL_TEXTURE_2D, 0);