Git Product home page Git Product logo

Comments (7)

sasmaster avatar sasmaster commented on July 20, 2024

I really wonder how nobody got on these before.Like,no one loads anything but textures 2D ? :P

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

Thank you for the bug report. Please send me a PR with the fixes.

really wonder how nobody got on these before.Like,no one loads anything but textures 2D ? :P

The GL loadtests only test 2D textures but it is surprising nobody else spotted these errors. I'd be happy to accept a PR with additional tests.

The tests for the new Vulkan loader (WIP over on https://github.com/msc-/KTX) include array and cube texture tests.

from ktx-software.

sasmaster avatar sasmaster commented on July 20, 2024

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

I can drop the whole loader.c here if you wish.

If you have a fix for #1, please drop those lines here. No need for the whole thing.

from ktx-software.

sasmaster avatar sasmaster commented on July 20, 2024

`
texnameUser = pTexture && *pTexture;
if (texnameUser) {
texname = *pTexture;
} else {
glGenTextures(1, &texname);
}

/* load as 2D texture if 1D textures are not supported */
if (texinfo.textureDimensions == 1 &&
    ((texinfo.compressed && (pfGlCompressedTexImage1D == NULL)) ||
     (!texinfo.compressed && (pfGlTexImage1D == NULL))))
{
    texinfo.textureDimensions = 2;
    texinfo.glTarget = GL_TEXTURE_2D;
    header.pixelHeight = 1;
}

if (header.numberOfArrayElements > 0)
{
    if (texinfo.glTarget == GL_TEXTURE_1D)
    {
        texinfo.glTarget = GL_TEXTURE_1D_ARRAY_EXT;
    }
    else if (texinfo.glTarget == GL_TEXTURE_2D)
    {
        texinfo.glTarget = GL_TEXTURE_2D_ARRAY;
    }
    else if (texinfo.glTarget == GL_TEXTURE_CUBE_MAP)
    {
        texinfo.glTarget = GL_TEXTURE_CUBE_MAP_ARRAY;
    }
    else
    {
        /* No API for 3D arrays yet */
        return KTX_UNSUPPORTED_TEXTURE_TYPE;
    }
    texinfo.textureDimensions++;
}
errorTmp = glGetError();
assert(errorTmp == 0);
glBindTexture(texinfo.glTarget, texname);
errorTmp = glGetError();
assert(errorTmp == 0);

`
Before that,the glBindTexture was at the top.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

This is fixed in the new code in branch incoming. I'll backport the fix to master soon.

from ktx-software.

MarkCallow avatar MarkCallow commented on July 20, 2024

Item #1 is now fixed in master. #2 was already fixed in master.

Both are also fixed in incoming.

from ktx-software.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.