X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fglformats.c;h=4f240206ff45d221e94ca867976f8b669c23c1a9;hb=edd50828618ed2efe799013c2723d67c407d86b4;hp=85d00af487fe4dd580808fec05962ffb6a1e4c69;hpb=36347c8d6f265fb9b8ebcd598b189d3b43d6b513;p=mesa.git diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c index 85d00af487f..4f240206ff4 100644 --- a/src/mesa/main/glformats.c +++ b/src/mesa/main/glformats.c @@ -546,6 +546,7 @@ _mesa_bytes_per_vertex_attrib(GLint comps, GLenum type) case GL_FLOAT: return comps * sizeof(GLfloat); case GL_HALF_FLOAT_ARB: + case GL_HALF_FLOAT_OES: return comps * sizeof(GLhalfARB); case GL_DOUBLE: return comps * sizeof(GLdouble); @@ -3631,6 +3632,21 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type) unreachable("Unsupported format"); } +uint32_t +_mesa_tex_format_from_format_and_type(const struct gl_context *ctx, + GLenum gl_format, GLenum type) +{ + mesa_format format = _mesa_format_from_format_and_type(gl_format, type); + + if (_mesa_format_is_mesa_array_format(format)) + format = _mesa_format_from_array_format(format); + + if (format == MESA_FORMAT_NONE || !ctx->TextureFormatSupported[format]) + return MESA_FORMAT_NONE; + + return format; +} + /** * Returns true if \p internal_format is a sized internal format that * is marked "Color Renderable" in Table 8.10 of the ES 3.2 specification.