Create gl_renderchain_add_lut
This commit is contained in:
parent
ec91878187
commit
188dd9bd69
|
@ -3636,20 +3636,9 @@ unsigned *height_p, size_t *pitch_p)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static bool gl_renderchain_add_lut(const struct video_shader *shader,
|
||||||
bool gl_load_luts(const struct video_shader *shader,
|
unsigned i, GLuint *textures_lut)
|
||||||
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};
|
struct texture_image img = {0};
|
||||||
enum texture_filter_type filter_type = TEXTURE_FILTER_LINEAR;
|
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.width, img.height,
|
||||||
img.pixels, sizeof(uint32_t));
|
img.pixels, sizeof(uint32_t));
|
||||||
image_texture_free(&img);
|
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);
|
glBindTexture(GL_TEXTURE_2D, 0);
|
||||||
|
|
Loading…
Reference in New Issue