* Translate Mesa format to Gallium format.
*/
enum pipe_format
-st_mesa_format_to_pipe_format(const struct st_context *st, mesa_format mesaFormat)
+st_mesa_format_to_pipe_format(const struct st_context *st,
+ mesa_format mesaFormat)
{
switch (mesaFormat) {
case MESA_FORMAT_A8B8G8R8_UNORM:
{ PIPE_FORMAT_R8G8B8A8_SINT, 0 }
},
{
- { GL_RGB_INTEGER_EXT,
+ { GL_RGB_INTEGER_EXT,
GL_BGR_INTEGER_EXT,
GL_RGB8I_EXT,
GL_BLUE_INTEGER_EXT, 0 },
return PIPE_FORMAT_NONE;
}
+
struct exact_format_mapping
{
GLenum format;
{ 0, 0, 0 }
};
+
/**
* For unsized/base internal formats, we may choose a convenient effective
* internal format for {format, type}. If one exists, return that, otherwise
return PIPE_FORMAT_NONE;
}
+
/**
* Given an OpenGL internalFormat value for a texture or surface, return
* the best matching PIPE_FORMAT_x, or PIPE_FORMAT_NONE if there's no match.
*/
enum pipe_format
st_choose_matching_format(struct st_context *st, unsigned bind,
- GLenum format, GLenum type, GLboolean swapBytes)
+ GLenum format, GLenum type, GLboolean swapBytes)
{
struct pipe_screen *screen = st->pipe->screen;
mesa_format mesa_format;
internalFormat == GL_RGBA16F ||
internalFormat == GL_RGB32F ||
internalFormat == GL_RGBA32F)
- bindings |= PIPE_BIND_RENDER_TARGET;
+ bindings |= PIPE_BIND_RENDER_TARGET;
/* GLES allows the driver to choose any format which matches
* the format+type combo, because GLES only supports unsized internal
return st_pipe_format_to_mesa_format(pFormat);
if (!is_renderbuffer) {
- /* try choosing format again, this time without render target bindings */
+ /* try choosing format again, this time without render
+ * target bindings.
+ */
pFormat = st_choose_matching_format(st, PIPE_BIND_SAMPLER_VIEW,
format, type,
ctx->Unpack.SwapBytes);
return num_sample_counts;
}
+
/**
* ARB_internalformat_query2 driver hook.
*/
}
}
+
/**
* This is used for translating texture border color and the clear
* color. For example, the clear color is interpreted according to