@@ -2064,41 +2064,11 @@ void SoftwareGLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum for
2064
2064
{
2065
2065
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED (gl_draw_pixels, width, height, format, type, data);
2066
2066
2067
- RETURN_WITH_ERROR_IF (!(format == GL_COLOR_INDEX
2068
- || format == GL_STENCIL_INDEX
2069
- || format == GL_DEPTH_COMPONENT
2070
- || format == GL_RGBA
2071
- || format == GL_BGRA
2072
- || format == GL_RED
2073
- || format == GL_GREEN
2074
- || format == GL_BLUE
2075
- || format == GL_ALPHA
2076
- || format == GL_RGB
2077
- || format == GL_BGR
2078
- || format == GL_LUMINANCE
2079
- || format == GL_LUMINANCE_ALPHA),
2080
- GL_INVALID_ENUM);
2067
+ RETURN_WITH_ERROR_IF (format < GL_COLOR_INDEX || format > GL_BGRA, GL_INVALID_ENUM);
2081
2068
2082
- RETURN_WITH_ERROR_IF (!(type == GL_UNSIGNED_BYTE
2083
- || type == GL_BYTE
2084
- || type == GL_BITMAP
2085
- || type == GL_UNSIGNED_SHORT
2086
- || type == GL_SHORT
2087
- || type == GL_UNSIGNED_INT
2088
- || type == GL_INT
2089
- || type == GL_FLOAT
2090
- || type == GL_UNSIGNED_BYTE_3_3_2
2091
- || type == GL_UNSIGNED_BYTE_2_3_3_REV
2092
- || type == GL_UNSIGNED_SHORT_5_6_5
2093
- || type == GL_UNSIGNED_SHORT_5_6_5_REV
2094
- || type == GL_UNSIGNED_SHORT_4_4_4_4
2095
- || type == GL_UNSIGNED_SHORT_4_4_4_4_REV
2096
- || type == GL_UNSIGNED_SHORT_5_5_5_1
2097
- || type == GL_UNSIGNED_SHORT_1_5_5_5_REV
2098
- || type == GL_UNSIGNED_INT_8_8_8_8
2099
- || type == GL_UNSIGNED_INT_8_8_8_8_REV
2100
- || type == GL_UNSIGNED_INT_10_10_10_2
2101
- || type == GL_UNSIGNED_INT_2_10_10_10_REV),
2069
+ RETURN_WITH_ERROR_IF ((type < GL_BYTE || type > GL_FLOAT)
2070
+ && (type < GL_UNSIGNED_BYTE_3_3_2 || type > GL_UNSIGNED_INT_10_10_10_2)
2071
+ && (type < GL_UNSIGNED_BYTE_2_3_3_REV || type > GL_UNSIGNED_INT_2_10_10_10_REV),
2102
2072
GL_INVALID_ENUM);
2103
2073
2104
2074
RETURN_WITH_ERROR_IF (type == GL_BITMAP && !(format == GL_COLOR_INDEX || format == GL_STENCIL_INDEX), GL_INVALID_ENUM);
@@ -2139,8 +2109,11 @@ void SoftwareGLContext::gl_draw_pixels(GLsizei width, GLsizei height, GLenum for
2139
2109
RETURN_WITH_ERROR_IF (m_in_draw_state, GL_INVALID_OPERATION);
2140
2110
2141
2111
// FIXME: we only support RGBA + GL_UNSIGNED_BYTE, implement all the others!
2142
- if (format != GL_RGBA || type != GL_UNSIGNED_BYTE) {
2143
- dbgln (" gl_draw_pixels: unsupported format {:#x} or type {:#x}" , format, type);
2112
+ if (format != GL_RGBA) {
2113
+ dbgln_if (GL_DEBUG, " gl_draw_pixels(): support for format {:#x} not implemented" , format);
2114
+ return ;
2115
+ } else if (type != GL_UNSIGNED_BYTE) {
2116
+ dbgln_if (GL_DEBUG, " gl_draw_pixels(): support for type {:#x} not implemented" , type);
2144
2117
return ;
2145
2118
}
2146
2119
0 commit comments