Code: Select all
if(flags & PVR_TXRLOAD_DMA) {
mutex_lock((mutex_t *)&pvr_state.dma_lock);
pvr_txr_load_dma(img->data, dst, img->byte_count,
(flags & PVR_TXRLOAD_NONBLOCK) ? 1 : 0, NULL, 0);
mutex_unlock((mutex_t *)&pvr_state.dma_lock);
}
else if(flags & PVR_TXRLOAD_SQ) {
sq_cpy(dst, img->data, img->byte_count);
}
else {
/* Store Queue usage here can screw things up if you're
loading textures while sending display lists. Enable the
PVR_TXRLOAD_SQ flag if you know you want it. */
memcpy4(dst, img->data, img->byte_count);
/* pvr_txr_load(img->data, dst, img->byte_count); */
}
Code: Select all
switch(internalFormat) {
case GL_RGB:
_glKosPixelConvertRGB(type, width, height, (void *)data, tex);
GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->color = (PVR_TXRFMT_RGB565 | PVR_TXRFMT_NONTWIDDLED);
sq_cpy(GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->data, tex, bytes);
break;
case GL_RGBA:
_glKosPixelConvertRGBA(type, width, height, (void *)data, tex);
GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->color = (PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_NONTWIDDLED);
sq_cpy(GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->data, tex, bytes);
break;
}
free(tex);
}
break;
case GL_UNSIGNED_SHORT_5_6_5: /* Texture Formats that do not need conversion */
case GL_UNSIGNED_SHORT_5_6_5_TWID:
case GL_UNSIGNED_SHORT_1_5_5_5:
case GL_UNSIGNED_SHORT_1_5_5_5_TWID:
case GL_UNSIGNED_SHORT_4_4_4_4:
case GL_UNSIGNED_SHORT_4_4_4_4_TWID:
sq_cpy(GL_KOS_TEXTURE_UNIT[GL_KOS_ACTIVE_TEXTURE]->data, data, bytes);
break;
But that's why the demos all work while the game didn't - different designs. The game can upload textures at any time, while the demos carefully upload apart from any other transfers. It's not a bug, which is why the thread title says 'design flaw'. Maybe pass the flag in the glKosInit()? Or maybe add them to the internal format passed to glTexImage2D()? The latter would be more flexible.