Commit 71fe9437 authored by Mark Mueller's avatar Mark Mueller
Browse files

mesa: change gl_format to mesa_format

s/\bgl_format\b/mesa_format/g. Use better name for Mesa Formats enum
parent bc0ed682
......@@ -81,7 +81,7 @@ const __DRIconfigOptionsExtension gallium_config_options = {
static const __DRIconfig **
dri_fill_in_modes(struct dri_screen *screen)
{
static const gl_format mesa_formats[3] = {
static const mesa_format mesa_formats[3] = {
MESA_FORMAT_ARGB8888,
MESA_FORMAT_XRGB8888,
MESA_FORMAT_RGB565,
......@@ -91,7 +91,7 @@ dri_fill_in_modes(struct dri_screen *screen)
PIPE_FORMAT_BGRX8888_UNORM,
PIPE_FORMAT_B5G6R5_UNORM,
};
gl_format format;
mesa_format format;
__DRIconfig **configs = NULL;
uint8_t depth_bits_array[5];
uint8_t stencil_bits_array[5];
......
......@@ -3814,7 +3814,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
* ReadPixels() and passed to Tex[Sub]Image().
*/
static GLenum
get_temp_image_type(struct gl_context *ctx, gl_format format)
get_temp_image_type(struct gl_context *ctx, mesa_format format)
{
GLenum baseFormat;
......
......@@ -806,7 +806,7 @@ driUpdateFramebufferSize(struct gl_context *ctx, const __DRIdrawable *dPriv)
}
uint32_t
driGLFormatToImageFormat(gl_format format)
driGLFormatToImageFormat(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGB565:
......@@ -836,7 +836,7 @@ driGLFormatToImageFormat(gl_format format)
}
}
gl_format
mesa_format
driImageFormatToGLFormat(uint32_t image_format)
{
switch (image_format) {
......
......@@ -281,9 +281,9 @@ struct __DRIdrawableRec {
};
extern uint32_t
driGLFormatToImageFormat(gl_format format);
driGLFormatToImageFormat(mesa_format format);
extern gl_format
extern mesa_format
driImageFormatToGLFormat(uint32_t image_format);
extern void
......
......@@ -151,7 +151,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
* If the function fails and returns \c GL_FALSE, this
* value will be unmodified, but some elements in the
* linked list may be modified.
* \param format Mesa gl_format enum describing the pixel format
* \param format Mesa mesa_format enum describing the pixel format
* \param depth_bits Array of depth buffer sizes to be exposed.
* \param stencil_bits Array of stencil buffer sizes to be exposed.
* \param num_depth_stencil_bits Number of entries in both \c depth_bits and
......@@ -176,7 +176,7 @@ driGetRendererString( char * buffer, const char * hardware_name,
* \c format).
*/
__DRIconfig **
driCreateConfigs(gl_format format,
driCreateConfigs(mesa_format format,
const uint8_t * depth_bits, const uint8_t * stencil_bits,
unsigned num_depth_stencil_bits,
const GLenum * db_modes, unsigned num_db_modes,
......
......@@ -48,7 +48,7 @@ struct __DRIconfigRec {
};
extern __DRIconfig **
driCreateConfigs(gl_format format,
driCreateConfigs(mesa_format format,
const uint8_t * depth_bits, const uint8_t * stencil_bits,
unsigned num_depth_stencil_bits,
const GLenum * db_modes, unsigned num_db_modes,
......
......@@ -593,7 +593,7 @@ static bool
i830_render_target_supported(struct intel_context *intel,
struct gl_renderbuffer *rb)
{
gl_format format = rb->Format;
mesa_format format = rb->Format;
if (format == MESA_FORMAT_S8_Z24 ||
format == MESA_FORMAT_X8_Z24 ||
......
......@@ -39,7 +39,7 @@
static GLuint
translate_texture_format(gl_format mesa_format, GLenum DepthMode)
translate_texture_format(mesa_format mesa_format, GLenum DepthMode)
{
switch (mesa_format) {
case MESA_FORMAT_L8:
......
......@@ -560,7 +560,7 @@ static bool
i915_render_target_supported(struct intel_context *intel,
struct gl_renderbuffer *rb)
{
gl_format format = rb->Format;
mesa_format format = rb->Format;
if (format == MESA_FORMAT_S8_Z24 ||
format == MESA_FORMAT_X8_Z24 ||
......
......@@ -120,8 +120,8 @@ intel_miptree_blit(struct intel_context *intel,
* consistent with what we want in the callers (glCopyTexSubImage(),
* glBlitFramebuffer(), texture validation, etc.).
*/
gl_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
gl_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
mesa_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
mesa_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
/* The blitter doesn't support doing any format conversions. We do also
* support blitting ARGB8888 to XRGB8888 (trivial, the values dropped into
......
......@@ -303,7 +303,7 @@ intel_nop_alloc_storage(struct gl_context * ctx, struct gl_renderbuffer *rb,
* not a user-created renderbuffer.
*/
struct intel_renderbuffer *
intel_create_renderbuffer(gl_format format)
intel_create_renderbuffer(mesa_format format)
{
struct intel_renderbuffer *irb;
struct gl_renderbuffer *rb;
......@@ -338,7 +338,7 @@ intel_create_renderbuffer(gl_format format)
* may be called at intel_update_renderbuffers() time.
*/
struct intel_renderbuffer *
intel_create_private_renderbuffer(gl_format format)
intel_create_private_renderbuffer(mesa_format format)
{
struct intel_renderbuffer *irb;
......@@ -682,8 +682,8 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
return mask;
}
gl_format src_format = _mesa_get_srgb_format_linear(src_rb->Format);
gl_format dst_format = _mesa_get_srgb_format_linear(dst_rb->Format);
mesa_format src_format = _mesa_get_srgb_format_linear(src_rb->Format);
mesa_format dst_format = _mesa_get_srgb_format_linear(dst_rb->Format);
if (src_format != dst_format) {
perf_debug("glBlitFramebuffer(): unsupported blit from %s to %s. "
"Falling back to software rendering.\n",
......
......@@ -121,22 +121,22 @@ intel_get_renderbuffer(struct gl_framebuffer *fb, gl_buffer_index attIndex)
}
static INLINE gl_format
static INLINE mesa_format
intel_rb_format(const struct intel_renderbuffer *rb)
{
return rb->Base.Base.Format;
}
extern struct intel_renderbuffer *
intel_create_renderbuffer(gl_format format);
intel_create_renderbuffer(mesa_format format);
struct intel_renderbuffer *
intel_create_private_renderbuffer(gl_format format);
intel_create_private_renderbuffer(mesa_format format);
struct gl_renderbuffer*
intel_create_wrapped_renderbuffer(struct gl_context * ctx,
int width, int height,
gl_format format);
mesa_format format);
extern void
intel_fbo_init(struct intel_context *intel);
......
......@@ -68,7 +68,7 @@ target_to_target(GLenum target)
struct intel_mipmap_tree *
intel_miptree_create_layout(struct intel_context *intel,
GLenum target,
gl_format format,
mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
......@@ -130,7 +130,7 @@ intel_miptree_create_layout(struct intel_context *intel,
*/
static uint32_t
intel_miptree_choose_tiling(struct intel_context *intel,
gl_format format,
mesa_format format,
uint32_t width0,
enum intel_miptree_tiling_mode requested,
struct intel_mipmap_tree *mt)
......@@ -166,7 +166,7 @@ intel_miptree_choose_tiling(struct intel_context *intel,
struct intel_mipmap_tree *
intel_miptree_create(struct intel_context *intel,
GLenum target,
gl_format format,
mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
......@@ -236,7 +236,7 @@ intel_miptree_create(struct intel_context *intel,
struct intel_mipmap_tree *
intel_miptree_create_for_bo(struct intel_context *intel,
drm_intel_bo *bo,
gl_format format,
mesa_format format,
uint32_t offset,
uint32_t width,
uint32_t height,
......@@ -295,7 +295,7 @@ intel_miptree_create_for_bo(struct intel_context *intel,
struct intel_mipmap_tree*
intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
unsigned dri_attachment,
gl_format format,
mesa_format format,
struct intel_region *region)
{
struct intel_mipmap_tree *mt = NULL;
......@@ -334,7 +334,7 @@ intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
struct intel_mipmap_tree*
intel_miptree_create_for_image_buffer(struct intel_context *intel,
enum __DRIimageBufferMask buffer_type,
gl_format format,
mesa_format format,
uint32_t num_samples,
struct intel_region *region)
{
......@@ -359,7 +359,7 @@ intel_miptree_create_for_image_buffer(struct intel_context *intel,
struct intel_mipmap_tree*
intel_miptree_create_for_renderbuffer(struct intel_context *intel,
gl_format format,
mesa_format format,
uint32_t width,
uint32_t height)
{
......@@ -449,7 +449,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
*/
assert(target_to_target(image->TexObject->Target) == mt->target);
gl_format mt_format = mt->format;
mesa_format mt_format = mt->format;
if (image->TexFormat != mt_format)
return false;
......@@ -629,7 +629,7 @@ intel_miptree_copy_slice(struct intel_context *intel,
int depth)
{
gl_format format = src_mt->format;
mesa_format format = src_mt->format;
uint32_t width = src_mt->level[level].width;
uint32_t height = src_mt->level[level].height;
int slice;
......
......@@ -149,7 +149,7 @@ struct intel_mipmap_tree
* This is just the same as the gl_texture_image->TexFormat or
* gl_renderbuffer->Format.
*/
gl_format format;
mesa_format format;
/**
* The X offset of each image in the miptree must be aligned to this. See
......@@ -223,7 +223,7 @@ enum intel_miptree_tiling_mode {
struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
GLenum target,
gl_format format,
mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
......@@ -235,7 +235,7 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
struct intel_mipmap_tree *
intel_miptree_create_layout(struct intel_context *intel,
GLenum target,
gl_format format,
mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
......@@ -246,7 +246,7 @@ intel_miptree_create_layout(struct intel_context *intel,
struct intel_mipmap_tree *
intel_miptree_create_for_bo(struct intel_context *intel,
drm_intel_bo *bo,
gl_format format,
mesa_format format,
uint32_t offset,
uint32_t width,
uint32_t height,
......@@ -256,13 +256,13 @@ intel_miptree_create_for_bo(struct intel_context *intel,
struct intel_mipmap_tree*
intel_miptree_create_for_dri2_buffer(struct intel_context *intel,
unsigned dri_attachment,
gl_format format,
mesa_format format,
struct intel_region *region);
struct intel_mipmap_tree*
intel_miptree_create_for_image_buffer(struct intel_context *intel,
enum __DRIimageBufferMask buffer_type,
gl_format format,
mesa_format format,
uint32_t num_samples,
struct intel_region *region);
......@@ -275,7 +275,7 @@ intel_miptree_create_for_image_buffer(struct intel_context *intel,
*/
struct intel_mipmap_tree*
intel_miptree_create_for_renderbuffer(struct intel_context *intel,
gl_format format,
mesa_format format,
uint32_t width,
uint32_t height);
......
......@@ -844,7 +844,7 @@ intelCreateBuffer(__DRIscreen * driScrnPriv,
const struct gl_config * mesaVis, GLboolean isPixmap)
{
struct intel_renderbuffer *rb;
gl_format rgbFormat;
mesa_format rgbFormat;
struct gl_framebuffer *fb;
if (isPixmap)
......@@ -1042,7 +1042,7 @@ intel_detect_swizzling(struct intel_screen *screen)
static __DRIconfig**
intel_screen_make_configs(__DRIscreen *dri_screen)
{
static const gl_format formats[] = {
static const mesa_format formats[] = {
MESA_FORMAT_RGB565,
MESA_FORMAT_ARGB8888
};
......
......@@ -219,7 +219,7 @@ intel_set_texture_image_region(struct gl_context *ctx,
struct intel_region *region,
GLenum target,
GLenum internalFormat,
gl_format format,
mesa_format format,
uint32_t offset,
GLuint width,
GLuint height,
......@@ -287,7 +287,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
int level = 0, internalFormat = 0;
gl_format texFormat = MESA_FORMAT_NONE;
mesa_format texFormat = MESA_FORMAT_NONE;
texObj = _mesa_get_current_tex_object(ctx, target);
intelObj = intel_texture_object(texObj);
......
......@@ -39,7 +39,7 @@
static unsigned int
intel_horizontal_texture_alignment_unit(struct intel_context *intel,
gl_format format)
mesa_format format)
{
/**
* From the "Alignment Unit Size" section of various specs, namely:
......@@ -79,7 +79,7 @@ intel_horizontal_texture_alignment_unit(struct intel_context *intel,
static unsigned int
intel_vertical_texture_alignment_unit(struct intel_context *intel,
gl_format format)
mesa_format format)
{
/**
* From the "Alignment Unit Size" section of various specs, namely:
......@@ -114,7 +114,7 @@ intel_vertical_texture_alignment_unit(struct intel_context *intel,
void
intel_get_texture_alignment_unit(struct intel_context *intel,
gl_format format,
mesa_format format,
unsigned int *w, unsigned int *h)
{
*w = intel_horizontal_texture_alignment_unit(intel, format);
......
......@@ -36,5 +36,5 @@ extern void i945_miptree_layout_2d(struct intel_mipmap_tree *mt);
void
intel_get_texture_alignment_unit(struct intel_context *intel,
gl_format format,
mesa_format format,
unsigned int *w, unsigned int *h);
......@@ -115,7 +115,7 @@ brw_blorp_surface_info::set(struct brw_context *brw,
this->brw_surfaceformat = BRW_SURFACEFORMAT_R16_UNORM;
break;
default: {
gl_format linear_format = _mesa_get_srgb_format_linear(mt->format);
mesa_format linear_format = _mesa_get_srgb_format_linear(mt->format);
if (is_render_target) {
assert(brw->format_supported_as_render_target[linear_format]);
this->brw_surfaceformat = brw->render_target_format[linear_format];
......
......@@ -197,10 +197,10 @@ do_blorp_blit(struct brw_context *brw, GLbitfield buffer_bit,
}
static bool
color_formats_match(gl_format src_format, gl_format dst_format)
color_formats_match(mesa_format src_format, mesa_format dst_format)
{
gl_format linear_src_format = _mesa_get_srgb_format_linear(src_format);
gl_format linear_dst_format = _mesa_get_srgb_format_linear(dst_format);
mesa_format linear_src_format = _mesa_get_srgb_format_linear(src_format);
mesa_format linear_dst_format = _mesa_get_srgb_format_linear(dst_format);
/* Normally, we require the formats to be equal. However, we also support
* blitting from ARGB to XRGB (discarding alpha), and from XRGB to ARGB
......@@ -222,8 +222,8 @@ formats_match(GLbitfield buffer_bit, struct intel_renderbuffer *src_irb,
* example MESA_FORMAT_X8_Z24 and MESA_FORMAT_S8_Z24), and we can blit
* between those formats.
*/
gl_format src_format = find_miptree(buffer_bit, src_irb)->format;
gl_format dst_format = find_miptree(buffer_bit, dst_irb)->format;
mesa_format src_format = find_miptree(buffer_bit, src_irb)->format;
mesa_format dst_format = find_miptree(buffer_bit, dst_irb)->format;
return color_formats_match(src_format, dst_format);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment