Page 1 of 1

TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE] error

Posted: 16 Sep 2021, 00:38
by nside
Hi

I'm trying to display an image loaded from a PNG file. Image spec from imagemagick:
Icon.png PNG 20x20 20x20+0+0 8-bit sRGB 212c 1798B 0.000u 0:00.000
I'm using the embedded texture loader in C++ on iOS:
    NoesisApp::EmbeddedTexture textures[] =
    {
        { "Icon.png", Icon_png }
    };
    
    auto tp =  new NoesisApp::EmbeddedTextureProvider(textures);
    
    // Setup theme
    NoesisApp::SetThemeProviders();
    Noesis::GUI::LoadApplicationResources("Theme/NoesisTheme.DarkBlue.xaml");
    Noesis::GUI::SetTextureProvider(tp);
At the time of rendering the image in a <Image src="Icon.png" /> XAML tag I get the following error:

TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE]

I loaded the texture with the bin2h tool.
I tried with the example texture from the NineSlice example and I'm getting the same error. Any pointers?

Re: TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE] error

Posted: 16 Sep 2021, 14:51
by jsantos
We were thinking about deprecating GL on iOS, right now it is a path we are not testing as extensively as the rest of implementations. Have you considered switching to Metal? in fact, for Apple TV (recently added) we are only supporting Metal.

If this is critical for you, please create a ticket in the tracker.

Re: TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE] error

Posted: 18 Sep 2021, 01:41
by nside
I'd rather have it work in my current environment. Can you think of a workaround? Different texture format? Different way to load the file?

Re: TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE] error

Posted: 20 Sep 2021, 16:42
by jsantos
This is probably related to TexStorage implementation on iOS. Could you try disabling it by commenting the following lines in GLRenderDevice.cpp:
    ////////////////
    // TexStorage //
    ////////////////
    if (IsSupported(Extension::ARB_texture_storage))
    {
        TexStorage2D_ = glTexStorage2D;
    }
    else if (IsSupported(Extension::EXT_texture_storage))
    {
      #if GL_EXT_texture_storage
        TexStorage2D_ = glTexStorage2DEXT;
      #else
        NS_ASSERT_UNREACHABLE;
      #endif
    }

Re: TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE] error

Posted: 22 Sep 2021, 13:59
by nside
Sounds promising. I'm currently linking against the static library. Do you have a pointer on building the library?

Re: TexStorage2D_(target, levels, internalformat, width, height) [GL_INVALID_VALUE] error

Posted: 23 Sep 2021, 12:42
by jsantos
There is a XCode solution available at $NoesisSDK/Build/NoesisGUI-ios.xcworkspace. GLRenderer is part of the App framework, with source code included.