Good catch. The test is only for debugging, so there should be little harm
in disabling it on OpenGL ES. In fact, the best solution will probably be
to do this test conditionally, depending on whether or not
GetTexLevelParameteriv() is available.


On Mon, May 5, 2014 at 11:57 PM, Steven Johnson <notifications@github.com>wrote:

> In src/runtime/opengl.cpp:
>
> > +
> > +    if (!buf) {
> > +        halide_error(user_context, "Invalid buffer");
> > +        return;
> > +    }
> > +
> > +    // If the texture was already created by the host application, check that
> > +    // it has the correct format. Otherwise, allocate and set up an
> > +    // appropriate texture.
> > +    GLuint tex = get_texture_id(buf);
> > +    bool halide_allocated = false;
> > +    GLint format = 0;
> > +    GLint width, height;
> > +    if (tex != 0) {
> > +        ST.BindTexture(GL_TEXTURE_2D, tex);
> > +        ST.GetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &width);
>
> glGetTextLevelParameteriv() isn't available on OpenGL ES 2.0. (I don't
> know of a good, portable way to read texture width/height under ES2.)
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/halide/Halide/pull/278/files#r12302161>
> .
>



-- 


Daniel Heck | Software Engineer | dheck@google.com | +49(451)37089-285

Google Germany GmbH
Maria-Goeppert-Str.3
23560 Lübeck
Deutschland

Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores