Fix up twiddled formats with alpha

This commit is contained in:
Luke Benstead 2018-08-28 17:51:33 +01:00
parent 963eeb54da
commit 55b3aa4ddd
2 changed files with 13 additions and 3 deletions

View File

@ -72,6 +72,10 @@ static inline void interpolateColour(const uint8_t* v1, const uint8_t* v2, const
const uint32_t VERTEX_CMD_EOL = 0xf0000000;
const uint32_t VERTEX_CMD = 0xe0000000;
void clipTriangleStrip2(const ClipVertex* vertices, const unsigned int count, AlignedVector* outBuffer) {
}
void clipTriangleStrip(const ClipVertex* vertices, const unsigned int count, AlignedVector* outBuffer) __attribute__((optimize("fast-math")));
void clipTriangleStrip(const ClipVertex* vertices, const unsigned int count, AlignedVector* outBuffer) {

View File

@ -412,9 +412,15 @@ static GLuint _determinePVRFormat(GLint internalFormat, GLenum type) {
/* OK so if we have something that requires alpha, we return 4444 unless
* the type was already 1555 (1-bit alpha) in which case we return that
*/
return (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) ?
PVR_TXRFMT_ARGB1555 | PVR_TXRFMT_NONTWIDDLED :
PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_NONTWIDDLED;
if(type == GL_UNSIGNED_SHORT_1_5_5_5_REV) {
return PVR_TXRFMT_ARGB1555 | PVR_TXRFMT_NONTWIDDLED;
} else if(type == GL_UNSIGNED_SHORT_1_5_5_5_REV_TWID_KOS) {
return PVR_TXRFMT_ARGB1555 | PVR_TXRFMT_TWIDDLED;
} else if(type == GL_UNSIGNED_SHORT_4_4_4_4_REV_TWID_KOS) {
return PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_TWIDDLED;
} else {
return PVR_TXRFMT_ARGB4444 | PVR_TXRFMT_NONTWIDDLED;
}
case GL_RED:
case GL_RGB:
/* No alpha? Return RGB565 which is the best we can do without using palettes */