]> git.sesse.net Git - movit/commitdiff
Merge branch 'epoxy'
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 28 Mar 2014 20:15:05 +0000 (21:15 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 28 Mar 2014 20:17:41 +0000 (21:17 +0100)
Conflicts:
effect_chain.cpp
resource_pool.cpp

1  2 
Makefile.in
effect_chain.cpp
effect_chain.h
fft_pass_effect.cpp
fft_pass_effect.frag
fft_pass_effect.h
fft_pass_effect_test.cpp
luma_mix_effect_test.cpp
resource_pool.cpp
resource_pool.h

diff --cc Makefile.in
Simple merge
index c6f1e89af7b2cbef25919ff922f9bc6c1bc2258c,7bce60fa21c1e076c3082d69ff2e409cc342750a..0a01bd356e6066261910a60e4ee2af2813d428f5
@@@ -279,9 -288,31 +279,10 @@@ void EffectChain::compile_glsl_program(
                frag_shader += "\n";
        }
        frag_shader += string("#define INPUT ") + phase->effect_ids[phase->effects.back()] + "\n";
-       frag_shader.append(read_file("footer.frag"));
+       frag_shader.append(read_version_dependent_file("footer", "frag"));
  
-       phase->glsl_program_num = resource_pool->compile_glsl_program(read_file("vs.vert"), frag_shader);
+       string vert_shader = read_version_dependent_file("vs", "vert");
+       phase->glsl_program_num = resource_pool->compile_glsl_program(vert_shader, frag_shader);
 -
 -      // Prepare the geometry for the fullscreen quad used in this phase.
 -      // (We have separate VAOs per shader, since the bindings can in theory
 -      // be different.)
 -      float vertices[] = {
 -              0.0f, 1.0f,
 -              0.0f, 0.0f,
 -              1.0f, 1.0f,
 -              1.0f, 0.0f
 -      };
 -
 -      glGenVertexArrays(1, &phase->vao);
 -      check_error();
 -      glBindVertexArray(phase->vao);
 -      check_error();
 -
 -      phase->position_vbo = fill_vertex_attribute(phase->glsl_program_num, "position", 2, GL_FLOAT, sizeof(vertices), vertices);
 -      phase->texcoord_vbo = fill_vertex_attribute(phase->glsl_program_num, "texcoord", 2, GL_FLOAT, sizeof(vertices), vertices);  // Same as vertices.
 -
 -      glBindVertexArray(0);
 -      check_error();
  }
  
  // Construct GLSL programs, starting at the given effect and following
diff --cc effect_chain.h
index 2b959bda68bfc2f5502f743c9ccb9435e79f9794,e7d99d54821928c1248f6456c461ba1f63525eed..593232cf01e036f47728ae1fd3d2c756bf6d3d85
  // but if so, the threads' contexts need to be set up to share resources, since
  // the EffectChain holds textures and other OpenGL objects that are tied to the
  // context.
 +//
 +// Memory management (only relevant if you use multiple contexts):
 +// See corresponding comment in resource_pool.h. This holds even if you don't
 +// allocate your own ResourcePool, but let EffectChain hold its own.
  
- #include <GL/glew.h>
+ #include <epoxy/gl.h>
  #include <stdio.h>
  #include <map>
  #include <set>
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc resource_pool.h
index aad95c959ad235dc7cdc504f82e066b717322279,7029fbfd5e795cbd405a099ddd0b1450ccf187c2..a331f4f1708c823a076216c0023a81cf099bd802
  // Thread-safety: All functions except the constructor and destructor can be
  // safely called from multiple threads at the same time, provided they have
  // separate (but sharing) OpenGL contexts.
 +//
 +// Memory management (only relevant if you use multiple contexts): Some objects,
 +// like FBOs, are not shareable across contexts, and can only be deleted from
 +// the context they were created in. Thus, you will need to tell the
 +// ResourcePool explicitly if you delete a context, or they will leak (and the
 +// ResourcePool destructor will assert-fail). See clean_context().
  
- #include <GL/glew.h>
+ #include <epoxy/gl.h>
  #include <pthread.h>
  #include <stddef.h>
  #include <list>