c++ - Qt 5.5 QOpenGLTexture copying data issue -


i'm working qt 5.5 opengl wrapper classes. trying qopengltexture working. here creating 1x1 2d white texture masking purposes. works:

void renderer::inittextures() {         qimage white(1, 1, qimage::format_rgba8888);     white.fill(qt::white);     m_whitetexture.reset(new qopengltexture(qopengltexture::target2d));     m_whitetexture->setsize(1, 1);     m_whitetexture->setdata(white);     //m_whitetexture->allocatestorage(qopengltexture::rgba, qopengltexture::uint32);     //m_whitetexture->setdata(qopengltexture::rgba, qopengltexture::uint8, white.bits());      // print errors     qlist<qopengldebugmessage> messages = m_logger->loggedmessages();     if (messages.size())     {         qdebug() << "start of texture errors";         foreach (const qopengldebugmessage &message, messages)             qdebug() << message;         qdebug() << "end of texture errors";     } } 

however trying 2 things:

  1. use allocate + setdata sequence separate commands (the commented out lines), e.g.

    m_whitetexture->allocatestorage(qopengltexture::rgba, qopengltexture::uint32); m_whitetexture->setdata(qopengltexture::rgba, qopengltexture::uint8, white.bits()); 

for purpose of more complicated rendering later update part of data , not reallocate. related (2) want move target2darray , push/pop textures in array.

  1. create target2darray texture , populate layers using qimages. pushing/popping textures max size available on hardware.

regarding (1), these errors qopengldebugmessage logger:

start of texture errors qopengldebugmessage("apisource", 1280, "error has been generated. gl error gl_invalid_enum in textureimage2dext: (id: 2663136273) non-integer <format> 0 has been provided.", "highseverity", "errortype") qopengldebugmessage("apisource", 1280, "error has been generated. gl error gl_invalid_enum in textureimage2dext: (id: 1978056088) generic error", "highseverity", "errortype") qopengldebugmessage("apisource", 1281, "error has been generated. gl error gl_invalid_value in textureimage2dext: (id: 1978056088) generic error", "highseverity", "errortype") qopengldebugmessage("apisource", 1281, "error has been generated. gl error gl_invalid_value in texturesubimage2dext: (id: 1163869712) generic error", "highseverity", "errortype") end of texture errors 

my mask works original code, can't work in either (1) , (2) scenarios. (2) change target target2darray, change size include depth of 1, adjust shaders use vec3 texture coordinates , sampler3d sampling, etc. can post more complete (2) example if helps. don't understand these error codes , difficult debug on gpu if going wrong. i've tried sorts of pixeltype , pixelformat combinations.

thanks!


Comments

Popular posts from this blog

java - Checkbox item adds to spinner -

php - mySQL problems with this code? -

C# MVC AngularJS -