"} \n";
cbcr_program_num = resource_pool->compile_glsl_program(cbcr_vert_shader, cbcr_frag_shader, frag_shader_outputs);
check_error();
+ cbcr_chroma_offset_0_location = get_uniform_location(cbcr_program_num, "foo", "chroma_offset_0");
+ check_error();
+ cbcr_chroma_offset_1_location = get_uniform_location(cbcr_program_num, "foo", "chroma_offset_1");
+ check_error();
cbcr_texture_sampler_uniform = glGetUniformLocation(cbcr_program_num, "cbcr_tex");
check_error();
uyvy_program_num = resource_pool->compile_glsl_program(uyvy_vert_shader, uyvy_frag_shader, frag_shader_outputs);
check_error();
+ uyvy_luma_offset_0_location = get_uniform_location(uyvy_program_num, "foo", "luma_offset_0");
+ check_error();
+ uyvy_luma_offset_1_location = get_uniform_location(uyvy_program_num, "foo", "luma_offset_1");
+ check_error();
+ uyvy_chroma_offset_0_location = get_uniform_location(uyvy_program_num, "foo", "chroma_offset_0");
+ check_error();
+ uyvy_chroma_offset_1_location = get_uniform_location(uyvy_program_num, "foo", "chroma_offset_1");
+ check_error();
uyvy_y_texture_sampler_uniform = glGetUniformLocation(uyvy_program_num, "y_tex");
check_error();
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
check_error();
- float chroma_offset_0[] = { -1.0f / width, 0.0f };
- float chroma_offset_1[] = { -0.0f / width, 0.0f };
- set_uniform_vec2(cbcr_program_num, "foo", "chroma_offset_0", chroma_offset_0);
- set_uniform_vec2(cbcr_program_num, "foo", "chroma_offset_1", chroma_offset_1);
-
+ glUniform2f(cbcr_chroma_offset_0_location, -1.0f / width, 0.0f);
+ check_error();
+ glUniform2f(cbcr_chroma_offset_1_location, -0.0f / width, 0.0f);
+ check_error();
glUniform1i(cbcr_texture_sampler_uniform, 0);
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
check_error();
- float y_offset_0[] = { -0.5f / width, 0.0f };
- float y_offset_1[] = { 0.5f / width, 0.0f };
- float cbcr_offset0[] = { -1.0f / width, 0.0f };
- float cbcr_offset1[] = { -0.0f / width, 0.0f };
- set_uniform_vec2(uyvy_program_num, "foo", "luma_offset_0", y_offset_0);
- set_uniform_vec2(uyvy_program_num, "foo", "luma_offset_1", y_offset_1);
- set_uniform_vec2(uyvy_program_num, "foo", "chroma_offset_0", cbcr_offset0);
- set_uniform_vec2(uyvy_program_num, "foo", "chroma_offset_1", cbcr_offset1);
+ glUniform2f(uyvy_luma_offset_0_location, -0.5f / width, 0.0f);
+ check_error();
+ glUniform2f(uyvy_luma_offset_1_location, 0.5f / width, 0.0f);
+ check_error();
+ glUniform2f(uyvy_chroma_offset_0_location, -1.0f / width, 0.0f);
+ check_error();
+ glUniform2f(uyvy_chroma_offset_1_location, -0.0f / width, 0.0f);
+ check_error();
glBindBuffer(GL_ARRAY_BUFFER, vbo);
check_error();
GLuint cbcr_program_num; // Owned by <resource_pool>.
GLuint cbcr_texture_sampler_uniform;
GLuint cbcr_position_attribute_index, cbcr_texcoord_attribute_index;
+ GLuint cbcr_chroma_offset_0_location, cbcr_chroma_offset_1_location;
GLuint uyvy_program_num; // Owned by <resource_pool>.
GLuint uyvy_y_texture_sampler_uniform, uyvy_cbcr_texture_sampler_uniform;
GLuint uyvy_position_attribute_index, uyvy_texcoord_attribute_index;
+ GLuint uyvy_luma_offset_0_location, uyvy_luma_offset_1_location;
+ GLuint uyvy_chroma_offset_0_location, uyvy_chroma_offset_1_location;
GLuint v210_program_num; // Compute shader, so owned by ourselves. Can be 0.
GLuint v210_in_y_pos, v210_in_cbcr_pos, v210_outbuf_pos;