mesa: Add PrimitiveRestartFixedIndex to gl_constants
[mesa.git] / src / mesa / main / glformats.c
index c450ffc8ed76a5c360cc0de984d62f66635aa9bd..dfff4a21f0418afa3652c1f25783fe3df08916b2 100644 (file)
@@ -2391,7 +2391,7 @@ _mesa_base_tex_format(const struct gl_context *ctx, GLint internalFormat)
         is_astc_3d_format(internalFormat)))
         return GL_RGBA;
 
-   if (!_mesa_has_MESA_ycbcr_texture(ctx)) {
+   if (_mesa_has_MESA_ycbcr_texture(ctx)) {
       if (internalFormat == GL_YCBCR_MESA)
          return GL_YCBCR_MESA;
    }
@@ -3566,6 +3566,9 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
    bool normalized = false, is_float = false, is_signed = false;
    int num_channels = 0, type_size = 0;
 
+   if (format == GL_COLOR_INDEX)
+      return MESA_FORMAT_NONE;
+
    /* Extract array format type information from the OpenGL data type */
    switch (type) {
    case GL_UNSIGNED_BYTE: