- glGenTextures(1, &gl_surfaces[i].y_tex);
- glGenTextures(1, &gl_surfaces[i].cbcr_tex);
-
- if (!use_zerocopy) {
- // Create Y image.
- glBindTexture(GL_TEXTURE_2D, gl_surfaces[i].y_tex);
- glTexStorage2D(GL_TEXTURE_2D, 1, GL_R8, frame_width, frame_height);
-
- // Create CbCr image.
- glBindTexture(GL_TEXTURE_2D, gl_surfaces[i].cbcr_tex);
- glTexStorage2D(GL_TEXTURE_2D, 1, GL_RG8, frame_width / 2, frame_height / 2);
+ if (use_zerocopy) {
+ gl_surfaces[i].y_tex = resource_pool->create_2d_texture(GL_R8, 1, 1);
+ gl_surfaces[i].cbcr_tex = resource_pool->create_2d_texture(GL_RG8, 1, 1);
+ } else {
+ gl_surfaces[i].y_tex = resource_pool->create_2d_texture(GL_R8, frame_width, frame_height);
+ gl_surfaces[i].cbcr_tex = resource_pool->create_2d_texture(GL_RG8, frame_width / 2, frame_height / 2);