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,
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];
* 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;
}
uint32_t
-driGLFormatToImageFormat(gl_format format)
+driGLFormatToImageFormat(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGB565:
}
}
-gl_format
+mesa_format
driImageFormatToGLFormat(uint32_t image_format)
{
switch (image_format) {
};
extern uint32_t
-driGLFormatToImageFormat(gl_format format);
+driGLFormatToImageFormat(mesa_format format);
-extern gl_format
+extern mesa_format
driImageFormatToGLFormat(uint32_t image_format);
extern void
* 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
* \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,
};
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,
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 ||
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:
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 ||
* 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
* 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;
* 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;
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",
}
-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);
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,
*/
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)
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,
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,
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;
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)
{
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)
{
*/
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;
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;
* 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
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,
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,
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,
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);
*/
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);
const struct gl_config * mesaVis, GLboolean isPixmap)
{
struct intel_renderbuffer *rb;
- gl_format rgbFormat;
+ mesa_format rgbFormat;
struct gl_framebuffer *fb;
if (isPixmap)
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
};
struct intel_region *region,
GLenum target,
GLenum internalFormat,
- gl_format format,
+ mesa_format format,
uint32_t offset,
GLuint width,
GLuint height,
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);
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:
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:
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);
void
intel_get_texture_alignment_unit(struct intel_context *intel,
- gl_format format,
+ mesa_format format,
unsigned int *w, unsigned int *h);
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];
}
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
* 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);
}
*/
static bool
is_color_fast_clear_compatible(struct brw_context *brw,
- gl_format format,
+ mesa_format format,
const union gl_color_union *color)
{
if (_mesa_is_format_integer_color(format))
dst.set(brw, irb->mt, irb->mt_level, layer, true);
/* Override the surface format according to the context's sRGB rules. */
- gl_format format = _mesa_get_render_format(ctx, irb->mt->format);
+ mesa_format format = _mesa_get_render_format(ctx, irb->mt->format);
dst.brw_surfaceformat = brw->render_target_format[format];
x0 = fb->_Xmin;
struct brw_stage_prog_data *prog_data);
/* brw_surface_formats.c */
-bool brw_is_hiz_depth_format(struct brw_context *ctx, gl_format format);
+bool brw_is_hiz_depth_format(struct brw_context *ctx, mesa_format format);
bool brw_render_target_supported(struct brw_context *brw,
struct gl_renderbuffer *rb);
uint32_t brw_get_surface_tiling_bits(uint32_t tiling);
uint32_t brw_get_surface_num_multisamples(unsigned num_samples);
-uint32_t brw_format_for_mesa_format(gl_format mesa_format);
+uint32_t brw_format_for_mesa_format(mesa_format mesa_format);
GLuint translate_tex_target(GLenum target);
GLuint translate_tex_format(struct brw_context *brw,
- gl_format mesa_format,
+ mesa_format mesa_format,
GLenum srgb_decode);
int brw_get_texture_swizzle(const struct gl_context *ctx,
#undef Y
uint32_t
-brw_format_for_mesa_format(gl_format mesa_format)
+brw_format_for_mesa_format(mesa_format mesa_format)
{
/* This table is ordered according to the enum ordering in formats.h. We do
* expect that enum to be extended without our explicit initialization
{
struct gl_context *ctx = &brw->ctx;
int gen;
- gl_format format;
+ mesa_format format;
memset(&ctx->TextureFormatSupported, 0, sizeof(ctx->TextureFormatSupported));
brw_render_target_supported(struct brw_context *brw,
struct gl_renderbuffer *rb)
{
- gl_format format = rb->Format;
+ mesa_format format = rb->Format;
/* Many integer formats are promoted to RGBA (like XRGB8888 is), which means
* we would consider them renderable even though we don't have surface
GLuint
translate_tex_format(struct brw_context *brw,
- gl_format mesa_format,
+ mesa_format mesa_format,
GLenum srgb_decode)
{
struct gl_context *ctx = &brw->ctx;
/** Can HiZ be enabled on a depthbuffer of the given format? */
bool
-brw_is_hiz_depth_format(struct brw_context *brw, gl_format format)
+brw_is_hiz_depth_format(struct brw_context *brw, mesa_format format)
{
if (!brw->has_hiz)
return false;
static unsigned int
intel_horizontal_texture_alignment_unit(struct brw_context *brw,
- gl_format format)
+ mesa_format format)
{
/**
* From the "Alignment Unit Size" section of various specs, namely:
static unsigned int
intel_vertical_texture_alignment_unit(struct brw_context *brw,
- gl_format format, bool multisampled)
+ mesa_format format, bool multisampled)
{
/**
* From the "Alignment Unit Size" section of various specs, namely:
intel_buffer_object(tObj->BufferObject);
uint32_t size = tObj->BufferSize;
drm_intel_bo *bo = NULL;
- gl_format format = tObj->_BufferObjectFormat;
+ mesa_format format = tObj->_BufferObjectFormat;
uint32_t brw_format = brw_format_for_mesa_format(format);
int texel_size = _mesa_get_format_bytes(format);
uint32_t tile_x, tile_y;
uint32_t format = 0;
/* _NEW_BUFFERS */
- gl_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
+ mesa_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
uint32_t surf_index =
brw->wm.prog_data->binding_table.render_target_start + unit;
struct intel_region *region = irb->mt->region;
uint32_t format;
/* _NEW_BUFFERS */
- gl_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
+ mesa_format rb_format = _mesa_get_render_format(ctx, intel_rb_format(irb));
uint32_t surftype;
bool is_array = false;
int depth = MAX2(rb->Depth, 1);
* 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
* \param num_samples must be quantized.
*/
struct intel_renderbuffer *
-intel_create_renderbuffer(gl_format format, unsigned num_samples)
+intel_create_renderbuffer(mesa_format format, unsigned num_samples)
{
struct intel_renderbuffer *irb;
struct gl_renderbuffer *rb;
* \param num_samples must be quantized.
*/
struct intel_renderbuffer *
-intel_create_private_renderbuffer(gl_format format, unsigned num_samples)
+intel_create_private_renderbuffer(mesa_format format, unsigned num_samples)
{
struct intel_renderbuffer *irb;
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",
}
-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, unsigned num_samples);
+intel_create_renderbuffer(mesa_format format, unsigned num_samples);
struct intel_renderbuffer *
-intel_create_private_renderbuffer(gl_format format, unsigned num_samples);
+intel_create_private_renderbuffer(mesa_format format, unsigned num_samples);
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 brw_context *brw);
* created, based on the chip generation and the surface type.
*/
static enum intel_msaa_layout
-compute_msaa_layout(struct brw_context *brw, gl_format format, GLenum target)
+compute_msaa_layout(struct brw_context *brw, mesa_format format, GLenum target)
{
/* Prior to Gen7, all MSAA surfaces used IMS layout. */
if (brw->gen < 7)
struct intel_mipmap_tree *
intel_miptree_create_layout(struct brw_context *brw,
GLenum target,
- gl_format format,
+ mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
*/
static uint32_t
intel_miptree_choose_tiling(struct brw_context *brw,
- gl_format format,
+ mesa_format format,
uint32_t width0,
uint32_t num_samples,
enum intel_miptree_tiling_mode requested,
struct intel_mipmap_tree *
intel_miptree_create(struct brw_context *brw,
GLenum target,
- gl_format format,
+ mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
enum intel_miptree_tiling_mode requested_tiling)
{
struct intel_mipmap_tree *mt;
- gl_format tex_format = format;
- gl_format etc_format = MESA_FORMAT_NONE;
+ mesa_format tex_format = format;
+ mesa_format etc_format = MESA_FORMAT_NONE;
GLuint total_width, total_height;
if (brw->gen < 8 && !brw->is_baytrail) {
struct intel_mipmap_tree *
intel_miptree_create_for_bo(struct brw_context *brw,
drm_intel_bo *bo,
- gl_format format,
+ mesa_format format,
uint32_t offset,
uint32_t width,
uint32_t height,
struct intel_mipmap_tree*
intel_miptree_create_for_dri2_buffer(struct brw_context *brw,
unsigned dri_attachment,
- gl_format format,
+ mesa_format format,
uint32_t num_samples,
struct intel_region *region)
{
struct intel_mipmap_tree*
intel_miptree_create_for_image_buffer(struct brw_context *intel,
enum __DRIimageBufferMask buffer_type,
- gl_format format,
+ mesa_format format,
uint32_t num_samples,
struct intel_region *region)
{
struct intel_mipmap_tree*
intel_miptree_create_for_renderbuffer(struct brw_context *brw,
- gl_format format,
+ mesa_format format,
uint32_t width,
uint32_t height,
uint32_t num_samples)
*/
assert(target_to_target(image->TexObject->Target) == mt->target);
- gl_format mt_format = mt->format;
+ mesa_format mt_format = mt->format;
if (mt->format == MESA_FORMAT_X8_Z24 && mt->stencil_mt)
mt_format = MESA_FORMAT_S8_Z24;
if (mt->format == MESA_FORMAT_Z32_FLOAT && mt->stencil_mt)
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;
* accessing this miptree using MCS-specific hardware mechanisms, which
* infer the correct format based on num_samples.
*/
- gl_format format;
+ mesa_format format;
switch (num_samples) {
case 4:
/* 8 bits/pixel are required for MCS data when using 4x MSAA (2 bits for
* we'll need to scale the height down by the block height and then a
* further factor of 8.
*/
- const gl_format format = MESA_FORMAT_R_UINT32;
+ const mesa_format format = MESA_FORMAT_R_UINT32;
unsigned block_width_px;
unsigned block_height;
intel_get_non_msrt_mcs_alignment(brw, mt, &block_width_px, &block_height);
* For ETC1/ETC2 textures, this is one of the uncompressed mesa texture
* formats if the hardware lacks support for ETC1/ETC2. See @ref wraps_etc.
*/
- gl_format format;
+ mesa_format format;
/** This variable stores the value of ETC compressed texture format */
- gl_format etc_format;
+ mesa_format etc_format;
/**
* The X offset of each image in the miptree must be aligned to this.
struct intel_mipmap_tree *intel_miptree_create(struct brw_context *brw,
GLenum target,
- gl_format format,
+ mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
struct intel_mipmap_tree *
intel_miptree_create_layout(struct brw_context *brw,
GLenum target,
- gl_format format,
+ mesa_format format,
GLuint first_level,
GLuint last_level,
GLuint width0,
struct intel_mipmap_tree *
intel_miptree_create_for_bo(struct brw_context *brw,
drm_intel_bo *bo,
- gl_format format,
+ mesa_format format,
uint32_t offset,
uint32_t width,
uint32_t height,
struct intel_mipmap_tree*
intel_miptree_create_for_dri2_buffer(struct brw_context *brw,
unsigned dri_attachment,
- gl_format format,
+ mesa_format format,
uint32_t num_samples,
struct intel_region *region);
struct intel_mipmap_tree*
intel_miptree_create_for_image_buffer(struct brw_context *intel,
enum __DRIimageBufferMask buffer_type,
- gl_format format,
+ mesa_format format,
uint32_t num_samples,
struct intel_region *region);
*/
struct intel_mipmap_tree*
intel_miptree_create_for_renderbuffer(struct brw_context *brw,
- gl_format format,
+ mesa_format format,
uint32_t width,
uint32_t height,
uint32_t num_samples);
{
struct intel_renderbuffer *rb;
struct intel_screen *screen = (struct intel_screen*) driScrnPriv->driverPrivate;
- gl_format rgbFormat;
+ mesa_format rgbFormat;
unsigned num_samples = intel_quantize_num_samples(screen, mesaVis->samples);
struct gl_framebuffer *fb;
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
};
struct intel_region *region,
GLenum target,
GLenum internalFormat,
- gl_format format,
+ mesa_format format,
uint32_t offset,
GLuint width,
GLuint height,
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);
* the function.
*/
DBG("%s: level=%d offset=(%d,%d) (w,h)=(%d,%d) format=0x%x type=0x%x "
- "gl_format=0x%x tiling=%d "
+ "mesa_format=0x%x tiling=%d "
"packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d) "
"for_glTexImage=%d\n",
__FUNCTION__, texImage->Level, xoffset, yoffset, width, height,
}
static int
-validate_format_bpp(gl_format format)
+validate_format_bpp(mesa_format format)
{
switch (format) {
case MESA_FORMAT_XRGB8888:
const uint8_t stencil_bits[] = { 0, 0, 0, 8 };
const uint8_t msaa_samples[] = { 0 };
- static const gl_format formats[3] = {
+ static const mesa_format formats[3] = {
MESA_FORMAT_RGB565,
MESA_FORMAT_ARGB8888,
MESA_FORMAT_XRGB8888,
enum nouveau_surface_layout layout;
- gl_format format;
+ mesa_format format;
unsigned cpp, pitch;
unsigned width, height;
}
}
-static gl_format
+static mesa_format
nouveau_choose_tex_format(struct gl_context *ctx, GLenum target,
GLint internalFormat,
GLenum srcFormat, GLenum srcType)
context_dirty_i(ctx, TEX_ENV, ctx->Texture.CurrentUnit);
}
-static gl_format
+static mesa_format
get_texbuffer_format(struct gl_renderbuffer *rb, GLint format)
{
struct nouveau_surface *s = &to_nouveau_renderbuffer(rb)->surface;
#include "main/colormac.h"
static inline unsigned
-pack_rgba_i(gl_format f, uint8_t c[])
+pack_rgba_i(mesa_format f, uint8_t c[])
{
switch (f) {
case MESA_FORMAT_ARGB8888:
}
static inline unsigned
-pack_zs_i(gl_format f, uint32_t z, uint8_t s)
+pack_zs_i(mesa_format f, uint32_t z, uint8_t s)
{
switch (f) {
case MESA_FORMAT_Z24_S8:
}
static inline unsigned
-pack_rgba_f(gl_format f, float c[])
+pack_rgba_f(mesa_format f, float c[])
{
return pack_rgba_i(f, (uint8_t []) {
FLOAT_TO_UBYTE(c[RCOMP]),
}
static inline unsigned
-pack_rgba_clamp_f(gl_format f, float c[])
+pack_rgba_clamp_f(mesa_format f, float c[])
{
GLubyte bytes[4];
_mesa_unclamped_float_rgba_to_ubyte(bytes, c);
}
static inline unsigned
-pack_zs_f(gl_format f, float z, uint8_t s)
+pack_zs_f(mesa_format f, float z, uint8_t s)
{
return pack_zs_i(f, FLOAT_TO_UINT(z), s);
}
}
static inline unsigned
-get_format_blocksx(gl_format format,
+get_format_blocksx(mesa_format format,
unsigned x)
{
GLuint blockwidth;
}
static inline unsigned
-get_format_blocksy(gl_format format,
+get_format_blocksy(mesa_format format,
unsigned y)
{
GLuint blockwidth;
#include "nv04_driver.h"
static inline unsigned
-get_rt_format(gl_format format)
+get_rt_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_XRGB8888:
int i = (source == GL_TEXTURE ?
rc->unit : source - GL_TEXTURE0);
struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
- gl_format format = t->Image[0][t->BaseLevel]->TexFormat;
+ mesa_format format = t->Image[0][t->BaseLevel]->TexFormat;
if (format == MESA_FORMAT_A8) {
/* Emulated using I8. */
#include "nv04_driver.h"
static inline int
-swzsurf_format(gl_format format)
+swzsurf_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_A8:
}
static inline int
-surf2d_format(gl_format format)
+surf2d_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_A8:
}
static inline int
-rect_format(gl_format format)
+rect_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_A8:
}
static inline int
-sifm_format(gl_format format)
+sifm_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_A8:
#include "nv10_driver.h"
static inline unsigned
-get_rt_format(gl_format format)
+get_rt_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_XRGB8888:
int i = (source == GL_TEXTURE ?
rc->unit : source - GL_TEXTURE0);
struct gl_texture_object *t = rc->ctx->Texture.Unit[i]._Current;
- gl_format format = t->Image[0][t->BaseLevel]->TexFormat;
+ mesa_format format = t->Image[0][t->BaseLevel]->TexFormat;
if (format == MESA_FORMAT_A8) {
/* Emulated using I8. */
#include "nv20_driver.h"
static inline unsigned
-get_rt_format(gl_format format)
+get_rt_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_XRGB8888:
}
/* common formats supported as both textures and render targets */
-unsigned r200_check_blit(gl_format mesa_format, uint32_t dst_pitch)
+unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
{
/* XXX others? BE/LE? */
switch (mesa_format) {
}
static void inline emit_tx_setup(struct r200_context *r200,
- gl_format src_mesa_format,
- gl_format dst_mesa_format,
+ mesa_format src_mesa_format,
+ mesa_format dst_mesa_format,
struct radeon_bo *bo,
intptr_t offset,
unsigned width,
static inline void emit_cb_setup(struct r200_context *r200,
struct radeon_bo *bo,
intptr_t offset,
- gl_format mesa_format,
+ mesa_format mesa_format,
unsigned pitch,
unsigned width,
unsigned height)
unsigned r200_blit(struct gl_context *ctx,
struct radeon_bo *src_bo,
intptr_t src_offset,
- gl_format src_mesaformat,
+ mesa_format src_mesaformat,
unsigned src_pitch,
unsigned src_width,
unsigned src_height,
unsigned src_y_offset,
struct radeon_bo *dst_bo,
intptr_t dst_offset,
- gl_format dst_mesaformat,
+ mesa_format dst_mesaformat,
unsigned dst_pitch,
unsigned dst_width,
unsigned dst_height,
void r200_blit_init(struct r200_context *r200);
-unsigned r200_check_blit(gl_format mesa_format, uint32_t dst_pitch);
+unsigned r200_check_blit(mesa_format mesa_format, uint32_t dst_pitch);
unsigned r200_blit(struct gl_context *ctx,
struct radeon_bo *src_bo,
intptr_t src_offset,
- gl_format src_mesaformat,
+ mesa_format src_mesaformat,
unsigned src_pitch,
unsigned src_width,
unsigned src_height,
unsigned src_y_offset,
struct radeon_bo *dst_bo,
intptr_t dst_offset,
- gl_format dst_mesaformat,
+ mesa_format dst_mesaformat,
unsigned dst_pitch,
unsigned dst_width,
unsigned dst_height,
struct radeon_framebuffer *rfb;
radeonTexObjPtr t;
uint32_t pitch_val;
- gl_format texFormat;
+ mesa_format texFormat;
radeon = pDRICtx->driverPrivate;
}
/* common formats supported as both textures and render targets */
-unsigned r100_check_blit(gl_format mesa_format, uint32_t dst_pitch)
+unsigned r100_check_blit(mesa_format mesa_format, uint32_t dst_pitch)
{
/* XXX others? BE/LE? */
switch (mesa_format) {
}
static void inline emit_tx_setup(struct r100_context *r100,
- gl_format mesa_format,
+ mesa_format mesa_format,
struct radeon_bo *bo,
intptr_t offset,
unsigned width,
static inline void emit_cb_setup(struct r100_context *r100,
struct radeon_bo *bo,
intptr_t offset,
- gl_format mesa_format,
+ mesa_format mesa_format,
unsigned pitch,
unsigned width,
unsigned height)
unsigned r100_blit(struct gl_context *ctx,
struct radeon_bo *src_bo,
intptr_t src_offset,
- gl_format src_mesaformat,
+ mesa_format src_mesaformat,
unsigned src_pitch,
unsigned src_width,
unsigned src_height,
unsigned src_y_offset,
struct radeon_bo *dst_bo,
intptr_t dst_offset,
- gl_format dst_mesaformat,
+ mesa_format dst_mesaformat,
unsigned dst_pitch,
unsigned dst_width,
unsigned dst_height,
void r100_blit_init(struct r100_context *r100);
-unsigned r100_check_blit(gl_format mesa_format, uint32_t dst_pitch);
+unsigned r100_check_blit(mesa_format mesa_format, uint32_t dst_pitch);
unsigned r100_blit(struct gl_context *ctx,
struct radeon_bo *src_bo,
intptr_t src_offset,
- gl_format src_mesaformat,
+ mesa_format src_mesaformat,
unsigned src_pitch,
unsigned src_width,
unsigned src_height,
unsigned src_y_offset,
struct radeon_bo *dst_bo,
intptr_t dst_offset,
- gl_format dst_mesaformat,
+ mesa_format dst_mesaformat,
unsigned dst_pitch,
unsigned dst_width,
unsigned dst_height,
radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb,
struct radeon_bo *bo);
struct radeon_renderbuffer *
-radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv);
+radeon_create_renderbuffer(mesa_format format, __DRIdrawable *driDrawPriv);
void
radeonReadPixels(struct gl_context * ctx,
void (*free_context)(struct gl_context *ctx);
void (*emit_query_finish)(radeonContextPtr radeon);
void (*update_scissor)(struct gl_context *ctx);
- unsigned (*check_blit)(gl_format mesa_format, uint32_t dst_pitch);
+ unsigned (*check_blit)(mesa_format mesa_format, uint32_t dst_pitch);
unsigned (*blit)(struct gl_context *ctx,
struct radeon_bo *src_bo,
intptr_t src_offset,
- gl_format src_mesaformat,
+ mesa_format src_mesaformat,
unsigned src_pitch,
unsigned src_width,
unsigned src_height,
unsigned src_y_offset,
struct radeon_bo *dst_bo,
intptr_t dst_offset,
- gl_format dst_mesaformat,
+ mesa_format dst_mesaformat,
unsigned dst_pitch,
unsigned dst_width,
unsigned dst_height,
unsigned reg_width,
unsigned reg_height,
unsigned flip_y);
- unsigned (*is_format_renderable)(gl_format mesa_format);
+ unsigned (*is_format_renderable)(mesa_format mesa_format);
} vtbl;
};
* Not used for user-created renderbuffers.
*/
struct radeon_renderbuffer *
-radeon_create_renderbuffer(gl_format format, __DRIdrawable *driDrawPriv)
+radeon_create_renderbuffer(mesa_format format, __DRIdrawable *driDrawPriv)
{
struct radeon_renderbuffer *rrb;
struct gl_renderbuffer *rb;
radeon_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
{
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
- gl_format mesa_format;
+ mesa_format mesa_format;
int i;
for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
#include "radeon_tile.h"
static unsigned get_aligned_compressed_row_stride(
- gl_format format,
+ mesa_format format,
unsigned width,
unsigned minStride)
{
}
unsigned get_texture_image_size(
- gl_format format,
+ mesa_format format,
unsigned rowStride,
unsigned height,
unsigned depth,
return rowStride * height * depth;
}
-unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, GLuint target)
+unsigned get_texture_image_row_stride(radeonContextPtr rmesa, mesa_format format, unsigned width, unsigned tiling, GLuint target)
{
if (_mesa_is_format_compressed(format)) {
return get_aligned_compressed_row_stride(format, width, rmesa->texture_compressed_row_align);
* Create a new mipmap tree, calculate its layout and allocate memory.
*/
radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa,
- GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels,
+ GLenum target, mesa_format mesaFormat, GLuint baseLevel, GLuint numLevels,
GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits)
{
radeon_mipmap_tree *mt = CALLOC_STRUCT(_radeon_mipmap_tree);
GLuint face, GLuint level);
uint32_t get_base_teximage_offset(radeonTexObj *texObj);
-unsigned get_texture_image_row_stride(radeonContextPtr rmesa, gl_format format, unsigned width, unsigned tiling, unsigned target);
+unsigned get_texture_image_row_stride(radeonContextPtr rmesa, mesa_format format, unsigned width, unsigned tiling, unsigned target);
unsigned get_texture_image_size(
- gl_format format,
+ mesa_format format,
unsigned rowStride,
unsigned height,
unsigned depth,
unsigned tiling);
radeon_mipmap_tree *radeon_miptree_create(radeonContextPtr rmesa,
- GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels,
+ GLenum target, mesa_format mesaFormat, GLuint baseLevel, GLuint numLevels,
GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits);
#endif /* __RADEON_MIPMAP_TREE_H_ */
#include "radeon_debug.h"
#include "radeon_mipmap_tree.h"
-static gl_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
+static mesa_format gl_format_and_type_to_mesa_format(GLenum format, GLenum type)
{
switch (format)
{
{
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
const struct radeon_renderbuffer *rrb = radeon_renderbuffer(ctx->ReadBuffer->_ColorReadBuffer);
- const gl_format dst_format = gl_format_and_type_to_mesa_format(format, type);
+ const mesa_format dst_format = gl_format_and_type_to_mesa_format(format, type);
unsigned dst_rowstride, dst_imagesize, aligned_rowstride, flip_y;
struct radeon_bo *dst_buffer;
GLint dst_x = 0, dst_y = 0;
const GLboolean swAccum = mesaVis->accumRedBits > 0;
const GLboolean swStencil = mesaVis->stencilBits > 0 &&
mesaVis->depthBits != 24;
- gl_format rgbFormat;
+ mesa_format rgbFormat;
struct radeon_framebuffer *rfb;
if (isPixmap)
static const
__DRIconfig **radeonInitScreen2(__DRIscreen *psp)
{
- static const gl_format formats[3] = {
+ static const mesa_format formats[3] = {
MESA_FORMAT_RGB565,
MESA_FORMAT_XRGB8888,
MESA_FORMAT_ARGB8888
const GLuint level = timg->base.Base.Level;
unsigned src_bpp;
unsigned dst_bpp;
- gl_format src_mesaformat;
- gl_format dst_mesaformat;
+ mesa_format src_mesaformat;
+ mesa_format dst_mesaformat;
unsigned flip_y;
if (!radeon->vtbl.blit) {
struct radeon_framebuffer *rfb;
radeonTexObjPtr t;
uint32_t pitch_val;
- gl_format texFormat;
+ mesa_format texFormat;
radeon = pDRICtx->driverPrivate;
}
/* try to find a format which will only need a memcopy */
-static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
+static mesa_format radeonChoose8888TexFormat(radeonContextPtr rmesa,
GLenum srcFormat,
GLenum srcType, GLboolean fbo)
{
#endif
}
-gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
GLenum target,
GLint internalFormat,
GLenum format,
type, 0);
}
-gl_format radeonChooseTextureFormat(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
GLint internalFormat,
GLenum format,
GLenum type, GLboolean fbo)
"%s Failed to allocate miptree.\n", __func__);
}
-unsigned radeonIsFormatRenderable(gl_format mesa_format)
+unsigned radeonIsFormatRenderable(mesa_format mesa_format)
{
if (mesa_format == _radeon_texformat_argb8888 || mesa_format == _radeon_texformat_rgb565 ||
mesa_format == _radeon_texformat_argb1555 || mesa_format == _radeon_texformat_argb4444)
fprintf(stderr, "miptree doesn't match image\n");
}
-gl_format _radeon_texformat_rgba8888 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_argb8888 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_rgb565 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_argb4444 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_argb1555 = MESA_FORMAT_NONE;
-gl_format _radeon_texformat_al88 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_rgba8888 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_argb8888 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_rgb565 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_argb4444 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_argb1555 = MESA_FORMAT_NONE;
+mesa_format _radeon_texformat_al88 = MESA_FORMAT_NONE;
/*@}*/
#include "main/formats.h"
-extern gl_format _radeon_texformat_rgba8888;
-extern gl_format _radeon_texformat_argb8888;
-extern gl_format _radeon_texformat_rgb565;
-extern gl_format _radeon_texformat_argb4444;
-extern gl_format _radeon_texformat_argb1555;
-extern gl_format _radeon_texformat_al88;
+extern mesa_format _radeon_texformat_rgba8888;
+extern mesa_format _radeon_texformat_argb8888;
+extern mesa_format _radeon_texformat_rgb565;
+extern mesa_format _radeon_texformat_argb4444;
+extern mesa_format _radeon_texformat_argb1555;
+extern mesa_format _radeon_texformat_al88;
extern
void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride,
struct gl_texture_object *texObj);
-gl_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat_mesa(struct gl_context * ctx,
GLenum target,
GLint internalFormat,
GLenum format,
GLenum type);
-gl_format radeonChooseTextureFormat(struct gl_context * ctx,
+mesa_format radeonChooseTextureFormat(struct gl_context * ctx,
GLint internalFormat,
GLenum format,
GLenum type, GLboolean fbo);
GLint x, GLint y,
GLsizei width, GLsizei height);
-unsigned radeonIsFormatRenderable(gl_format mesa_format);
+unsigned radeonIsFormatRenderable(mesa_format mesa_format);
void radeon_image_target_texture_2d(struct gl_context *ctx, GLenum target,
struct gl_texture_object *texObj,
void tile_image(const void * src, unsigned src_pitch,
void *dst, unsigned dst_pitch,
- gl_format format, unsigned width, unsigned height)
+ mesa_format format, unsigned width, unsigned height)
{
assert(src_pitch >= width);
assert(dst_pitch >= width);
void untile_image(const void * src, unsigned src_pitch,
void *dst, unsigned dst_pitch,
- gl_format format, unsigned width, unsigned height)
+ mesa_format format, unsigned width, unsigned height)
{
assert(src_pitch >= width);
assert(dst_pitch >= width);
}
}
-void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height)
+void get_tile_size(mesa_format format, unsigned *block_width, unsigned *block_height)
{
switch (_mesa_get_format_bytes(format))
{
void tile_image(const void * src, unsigned src_pitch,
void *dst, unsigned dst_pitch,
- gl_format format, unsigned width, unsigned height);
+ mesa_format format, unsigned width, unsigned height);
void untile_image(const void * src, unsigned src_pitch,
void *dst, unsigned dst_pitch,
- gl_format format, unsigned width, unsigned height);
+ mesa_format format, unsigned width, unsigned height);
-void get_tile_size(gl_format format, unsigned *block_width, unsigned *block_height);
+void get_tile_size(mesa_format format, unsigned *block_width, unsigned *block_height);
struct gl_texture_image *texImage;
struct swrast_texture_image *swImage;
uint32_t internalFormat;
- gl_format texFormat;
+ mesa_format texFormat;
dri_ctx = pDRICtx->driverPrivate;
__DRIconfig **configs;
unsigned depth_buffer_factor;
unsigned back_buffer_factor;
- gl_format format;
+ mesa_format format;
/* GLX_SWAP_COPY_OML is only supported because the Intel driver doesn't
* support pageflipping at all.
swrast_check_and_update_window_size(ctx, read);
}
-static gl_format swrastChooseTextureFormat(struct gl_context * ctx,
+static mesa_format swrastChooseTextureFormat(struct gl_context * ctx,
GLenum target,
GLint internalFormat,
GLenum format,
}
/**
- * Returns an appropriate gl_format for color rendering based on the
+ * Returns an appropriate mesa_format for color rendering based on the
* GL_FRAMEBUFFER_SRGB state.
*
* Some drivers implement GL_FRAMEBUFFER_SRGB using a flag on the blend state
* overriding the format of the surface. This is a helper for doing the
* surface format override variant.
*/
-gl_format
-_mesa_get_render_format(const struct gl_context *ctx, gl_format format)
+mesa_format
+_mesa_get_render_format(const struct gl_context *ctx, mesa_format format)
{
if (ctx->Color.sRGBEnabled)
return format;
extern void
_mesa_update_clamp_vertex_color(struct gl_context *ctx);
-extern gl_format
-_mesa_get_render_format(const struct gl_context *ctx, gl_format format);
+extern mesa_format
+_mesa_get_render_format(const struct gl_context *ctx, mesa_format format);
extern void
_mesa_init_color( struct gl_context * ctx );
* \param format Format of the supplied data.
* \param type Type of the supplied data.
* \param caller Name of calling function for recording errors.
- * \return If internalformat, format and type are legal the gl_format
+ * \return If internalformat, format and type are legal the mesa_format
* corresponding to internalformat, otherwise MESA_FORMAT_NONE.
*
* \sa glClearBufferData and glClearBufferSubData
*/
-static gl_format
+static mesa_format
validate_clear_buffer_format(struct gl_context *ctx,
GLenum internalformat,
GLenum format, GLenum type,
const char *caller)
{
- gl_format mesaFormat;
+ mesa_format mesaFormat;
GLenum errorFormatType;
mesaFormat = _mesa_validate_texbuffer_format(ctx, internalformat);
*/
static bool
convert_clear_buffer_data(struct gl_context *ctx,
- gl_format internalformat,
+ mesa_format internalformat,
GLubyte *clearValue, GLenum format, GLenum type,
const GLvoid *data, const char *caller)
{
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object* bufObj;
- gl_format mesaFormat;
+ mesa_format mesaFormat;
GLubyte clearValue[MAX_PIXEL_BYTES];
GLsizeiptr clearValueSize;
{
GET_CURRENT_CONTEXT(ctx);
struct gl_buffer_object* bufObj;
- gl_format mesaFormat;
+ mesa_format mesaFormat;
GLubyte clearValue[MAX_PIXEL_BYTES];
GLsizeiptr clearValueSize;
* GL_TEXTURE_CUBE_MAP_[POSITIVE/NEGATIVE]_[XYZ].
* Called by glTexImage(), etc.
*/
- gl_format (*ChooseTextureFormat)( struct gl_context *ctx,
+ mesa_format (*ChooseTextureFormat)( struct gl_context *ctx,
GLenum target, GLint internalFormat,
GLenum srcFormat, GLenum srcType );
* \return GL_TRUE if the image is OK, GL_FALSE if too large
*/
GLboolean (*TestProxyTexImage)(struct gl_context *ctx, GLenum target,
- GLint level, gl_format format,
+ GLint level, mesa_format format,
GLint width, GLint height,
GLint depth, GLint border);
/*@}*/
* Is the given base format a legal format for a color renderbuffer?
*/
static GLboolean
-is_format_color_renderable(const struct gl_context *ctx, gl_format format, GLenum internalFormat)
+is_format_color_renderable(const struct gl_context *ctx, mesa_format format, GLenum internalFormat)
{
const GLenum baseFormat =
_mesa_get_format_base_format(format);
for (i = -2; i < (GLint) ctx->Const.MaxColorAttachments; i++) {
struct gl_renderbuffer_attachment *att;
GLenum f;
- gl_format attFormat;
+ mesa_format attFormat;
GLenum att_tex_target = GL_NONE;
/*
* we need to return zero.
*/
static GLint
-get_component_bits(GLenum pname, GLenum baseFormat, gl_format format)
+get_component_bits(GLenum pname, GLenum baseFormat, mesa_format format)
{
if (_mesa_base_format_has_channel(baseFormat, pname))
return _mesa_get_format_bits(format, pname);
"glGetFramebufferAttachmentParameterivEXT(pname)");
}
else {
- gl_format format = att->Renderbuffer->Format;
+ mesa_format format = att->Renderbuffer->Format;
/* Page 235 (page 247 of the PDF) in section 6.1.13 of the OpenGL ES
* 3.0.1 spec says:
* does not contain signed integer values."
*/
static GLboolean
-compatible_color_datatypes(gl_format srcFormat, gl_format dstFormat)
+compatible_color_datatypes(mesa_format srcFormat, mesa_format dstFormat)
{
GLenum srcType = _mesa_get_format_datatype(srcFormat);
GLenum dstType = _mesa_get_format_datatype(dstFormat);
* Return a function that can pack a GLubyte rgba[4] color.
*/
gl_pack_ubyte_rgba_func
-_mesa_get_pack_ubyte_rgba_function(gl_format format)
+_mesa_get_pack_ubyte_rgba_function(mesa_format format)
{
static gl_pack_ubyte_rgba_func table[MESA_FORMAT_COUNT];
static GLboolean initialized = GL_FALSE;
* Return a function that can pack a GLfloat rgba[4] color.
*/
gl_pack_float_rgba_func
-_mesa_get_pack_float_rgba_function(gl_format format)
+_mesa_get_pack_float_rgba_function(mesa_format format)
{
static gl_pack_float_rgba_func table[MESA_FORMAT_COUNT];
static GLboolean initialized = GL_FALSE;
static pack_float_rgba_row_func
-get_pack_float_rgba_row_function(gl_format format)
+get_pack_float_rgba_row_function(mesa_format format)
{
static pack_float_rgba_row_func table[MESA_FORMAT_COUNT];
static GLboolean initialized = GL_FALSE;
static pack_ubyte_rgba_row_func
-get_pack_ubyte_rgba_row_function(gl_format format)
+get_pack_ubyte_rgba_row_function(mesa_format format)
{
static pack_ubyte_rgba_row_func table[MESA_FORMAT_COUNT];
static GLboolean initialized = GL_FALSE;
* Pack a row of GLfloat rgba[4] values to the destination.
*/
void
-_mesa_pack_float_rgba_row(gl_format format, GLuint n,
+_mesa_pack_float_rgba_row(mesa_format format, GLuint n,
const GLfloat src[][4], void *dst)
{
pack_float_rgba_row_func packrow = get_pack_float_rgba_row_function(format);
* Pack a row of GLubyte rgba[4] values to the destination.
*/
void
-_mesa_pack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_rgba_row(mesa_format format, GLuint n,
const GLubyte src[][4], void *dst)
{
pack_ubyte_rgba_row_func packrow = get_pack_ubyte_rgba_row_function(format);
* \param dstRowStride destination image row stride in bytes
*/
void
-_mesa_pack_ubyte_rgba_rect(gl_format format, GLuint width, GLuint height,
+_mesa_pack_ubyte_rgba_rect(mesa_format format, GLuint width, GLuint height,
const GLubyte *src, GLint srcRowStride,
void *dst, GLint dstRowStride)
{
}
gl_pack_float_z_func
-_mesa_get_pack_float_z_func(gl_format format)
+_mesa_get_pack_float_z_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_Z24_S8:
}
gl_pack_uint_z_func
-_mesa_get_pack_uint_z_func(gl_format format)
+_mesa_get_pack_uint_z_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_Z24_S8:
gl_pack_ubyte_stencil_func
-_mesa_get_pack_ubyte_stencil_func(gl_format format)
+_mesa_get_pack_ubyte_stencil_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_Z24_S8:
void
-_mesa_pack_float_z_row(gl_format format, GLuint n,
+_mesa_pack_float_z_row(mesa_format format, GLuint n,
const GLfloat *src, void *dst)
{
switch (format) {
* The incoming Z values are always in the range [0, 0xffffffff].
*/
void
-_mesa_pack_uint_z_row(gl_format format, GLuint n,
+_mesa_pack_uint_z_row(mesa_format format, GLuint n,
const GLuint *src, void *dst)
{
switch (format) {
void
-_mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n,
const GLubyte *src, void *dst)
{
switch (format) {
* Incoming Z/stencil values are always in uint_24_8 format.
*/
void
-_mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
const GLuint *src, void *dst)
{
switch (format) {
* the packed value at dst will be 0 or ~0 depending on the colorMask.
*/
void
-_mesa_pack_colormask(gl_format format, const GLubyte colorMask[4], void *dst)
+_mesa_pack_colormask(mesa_format format, const GLubyte colorMask[4], void *dst)
{
GLfloat maskColor[4];
extern gl_pack_ubyte_rgba_func
-_mesa_get_pack_ubyte_rgba_function(gl_format format);
+_mesa_get_pack_ubyte_rgba_function(mesa_format format);
extern gl_pack_float_rgba_func
-_mesa_get_pack_float_rgba_function(gl_format format);
+_mesa_get_pack_float_rgba_function(mesa_format format);
extern gl_pack_float_z_func
-_mesa_get_pack_float_z_func(gl_format format);
+_mesa_get_pack_float_z_func(mesa_format format);
extern gl_pack_uint_z_func
-_mesa_get_pack_uint_z_func(gl_format format);
+_mesa_get_pack_uint_z_func(mesa_format format);
extern gl_pack_ubyte_stencil_func
-_mesa_get_pack_ubyte_stencil_func(gl_format format);
+_mesa_get_pack_ubyte_stencil_func(mesa_format format);
extern void
-_mesa_pack_float_rgba_row(gl_format format, GLuint n,
+_mesa_pack_float_rgba_row(mesa_format format, GLuint n,
const GLfloat src[][4], void *dst);
extern void
-_mesa_pack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_rgba_row(mesa_format format, GLuint n,
const GLubyte src[][4], void *dst);
extern void
-_mesa_pack_ubyte_rgba_rect(gl_format format, GLuint width, GLuint height,
+_mesa_pack_ubyte_rgba_rect(mesa_format format, GLuint width, GLuint height,
const GLubyte *src, GLint srcRowStride,
void *dst, GLint dstRowStride);
extern void
-_mesa_pack_float_z_row(gl_format format, GLuint n,
+_mesa_pack_float_z_row(mesa_format format, GLuint n,
const GLfloat *src, void *dst);
extern void
-_mesa_pack_uint_z_row(gl_format format, GLuint n,
+_mesa_pack_uint_z_row(mesa_format format, GLuint n,
const GLuint *src, void *dst);
extern void
-_mesa_pack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_pack_ubyte_stencil_row(mesa_format format, GLuint n,
const GLubyte *src, void *dst);
extern void
-_mesa_pack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
const GLuint *src, void *dst);
extern void
-_mesa_pack_colormask(gl_format format, const GLubyte colorMask[4], void *dst);
+_mesa_pack_colormask(mesa_format format, const GLubyte colorMask[4], void *dst);
#endif
* Return the unpacker function for the given format.
*/
static unpack_rgba_func
-get_unpack_rgba_function(gl_format format)
+get_unpack_rgba_function(mesa_format format)
{
static unpack_rgba_func table[MESA_FORMAT_COUNT];
static GLboolean initialized = GL_FALSE;
* Unpack rgba colors, returning as GLfloat values.
*/
void
-_mesa_unpack_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_rgba_row(mesa_format format, GLuint n,
const void *src, GLfloat dst[][4])
{
unpack_rgba_func unpack = get_unpack_rgba_function(format);
* only be used for unpacking formats that use 8 bits or less per channel.
*/
void
-_mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n,
const void *src, GLubyte dst[][4])
{
switch (format) {
}
void
-_mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
const void *src, GLuint dst[][4])
{
switch (format) {
* \param height height of rect region to convert
*/
void
-_mesa_unpack_rgba_block(gl_format format,
+_mesa_unpack_rgba_block(mesa_format format,
const void *src, GLint srcRowStride,
GLfloat dst[][4], GLint dstRowStride,
GLuint x, GLuint y, GLuint width, GLuint height)
* The returned values will always be in the range [0.0, 1.0].
*/
void
-_mesa_unpack_float_z_row(gl_format format, GLuint n,
+_mesa_unpack_float_z_row(mesa_format format, GLuint n,
const void *src, GLfloat *dst)
{
unpack_float_z_func unpack;
* The returned values will always be in the range [0, 0xffffffff].
*/
void
-_mesa_unpack_uint_z_row(gl_format format, GLuint n,
+_mesa_unpack_uint_z_row(mesa_format format, GLuint n,
const void *src, GLuint *dst)
{
unpack_uint_z_func unpack;
}
void
-_mesa_unpack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_stencil_row(mesa_format format, GLuint n,
const void *src, GLubyte *dst)
{
switch (format) {
}
void
-_mesa_unpack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
const void *src, GLuint *dst)
{
switch (format) {
_mesa_nonlinear_to_linear(GLubyte cs8);
extern void
-_mesa_unpack_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_rgba_row(mesa_format format, GLuint n,
const void *src, GLfloat dst[][4]);
extern void
-_mesa_unpack_ubyte_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_rgba_row(mesa_format format, GLuint n,
const void *src, GLubyte dst[][4]);
void
-_mesa_unpack_uint_rgba_row(gl_format format, GLuint n,
+_mesa_unpack_uint_rgba_row(mesa_format format, GLuint n,
const void *src, GLuint dst[][4]);
extern void
-_mesa_unpack_rgba_block(gl_format format,
+_mesa_unpack_rgba_block(mesa_format format,
const void *src, GLint srcRowStride,
GLfloat dst[][4], GLint dstRowStride,
GLuint x, GLuint y, GLuint width, GLuint height);
extern void
-_mesa_unpack_float_z_row(gl_format format, GLuint n,
+_mesa_unpack_float_z_row(mesa_format format, GLuint n,
const void *src, GLfloat *dst);
void
-_mesa_unpack_uint_z_row(gl_format format, GLuint n,
+_mesa_unpack_uint_z_row(mesa_format format, GLuint n,
const void *src, GLuint *dst);
void
-_mesa_unpack_ubyte_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_ubyte_stencil_row(mesa_format format, GLuint n,
const void *src, GLubyte *dst);
void
-_mesa_unpack_uint_24_8_depth_stencil_row(gl_format format, GLuint n,
+_mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
const void *src, GLuint *dst);
*/
struct gl_format_info
{
- gl_format Name;
+ mesa_format Name;
/** text name for debugging */
const char *StrName;
static const struct gl_format_info *
-_mesa_get_format_info(gl_format format)
+_mesa_get_format_info(mesa_format format)
{
const struct gl_format_info *info = &format_info[format];
assert(info->Name == format);
/** Return string name of format (for debugging) */
const char *
-_mesa_get_format_name(gl_format format)
+_mesa_get_format_name(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return info->StrName;
* Note: not GLuint, so as not to coerce math to unsigned. cf. fdo #37351
*/
GLint
-_mesa_get_format_bytes(gl_format format)
+_mesa_get_format_bytes(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
ASSERT(info->BytesPerBlock);
* \param pname the component, such as GL_RED_BITS, GL_TEXTURE_BLUE_BITS, etc.
*/
GLint
-_mesa_get_format_bits(gl_format format, GLenum pname)
+_mesa_get_format_bits(mesa_format format, GLenum pname)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
GLuint
-_mesa_get_format_max_bits(gl_format format)
+_mesa_get_format_max_bits(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
GLuint max = MAX2(info->RedBits, info->GreenBits);
* GL_FLOAT = an ordinary float
*/
GLenum
-_mesa_get_format_datatype(gl_format format)
+_mesa_get_format_datatype(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return info->DataType;
* GL_YCBCR_MESA, GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL.
*/
GLenum
-_mesa_get_format_base_format(gl_format format)
+_mesa_get_format_base_format(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return info->BaseFormat;
* \param bh returns block height in pixels
*/
void
-_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh)
+_mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
*bw = info->BlockWidth;
/** Is the given format a compressed format? */
GLboolean
-_mesa_is_format_compressed(gl_format format)
+_mesa_is_format_compressed(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return info->BlockWidth > 1 || info->BlockHeight > 1;
* Determine if the given format represents a packed depth/stencil buffer.
*/
GLboolean
-_mesa_is_format_packed_depth_stencil(gl_format format)
+_mesa_is_format_packed_depth_stencil(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
* Is the given format a signed/unsigned integer color format?
*/
GLboolean
-_mesa_is_format_integer_color(gl_format format)
+_mesa_is_format_integer_color(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return (info->DataType == GL_INT || info->DataType == GL_UNSIGNED_INT) &&
* Is the given format an unsigned integer format?
*/
GLboolean
-_mesa_is_format_unsigned(gl_format format)
+_mesa_is_format_unsigned(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return _mesa_is_type_unsigned(info->DataType);
* Does the given format store signed values?
*/
GLboolean
-_mesa_is_format_signed(gl_format format)
+_mesa_is_format_signed(mesa_format format)
{
if (format == MESA_FORMAT_R11_G11_B10_FLOAT ||
format == MESA_FORMAT_RGB9_E5_FLOAT) {
* \return GL_LINEAR or GL_SRGB
*/
GLenum
-_mesa_get_format_color_encoding(gl_format format)
+_mesa_get_format_color_encoding(mesa_format format)
{
/* XXX this info should be encoded in gl_format_info */
switch (format) {
* For an sRGB format, return the corresponding linear color space format.
* For non-sRGB formats, return the format as-is.
*/
-gl_format
-_mesa_get_srgb_format_linear(gl_format format)
+mesa_format
+_mesa_get_srgb_format_linear(mesa_format format)
{
switch (format) {
case MESA_FORMAT_SRGB8:
* If the given format is a compressed format, return a corresponding
* uncompressed format.
*/
-gl_format
-_mesa_get_uncompressed_format(gl_format format)
+mesa_format
+_mesa_get_uncompressed_format(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGB_FXT1:
GLuint
-_mesa_format_num_components(gl_format format)
+_mesa_format_num_components(mesa_format format)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
return ((info->RedBits > 0) +
* in the given format.
*/
GLuint
-_mesa_format_image_size(gl_format format, GLsizei width,
+_mesa_format_image_size(mesa_format format, GLsizei width,
GLsizei height, GLsizei depth)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
* accomodate very large textures.
*/
uint64_t
-_mesa_format_image_size64(gl_format format, GLsizei width,
+_mesa_format_image_size64(mesa_format format, GLsizei width,
GLsizei height, GLsizei depth)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
GLint
-_mesa_format_row_stride(gl_format format, GLsizei width)
+_mesa_format_row_stride(mesa_format format, GLsizei width)
{
const struct gl_format_info *info = _mesa_get_format_info(format);
/* Strictly speaking, a conditional isn't needed here */
static void
check_format_to_type_and_comps(void)
{
- gl_format f;
+ mesa_format f;
for (f = MESA_FORMAT_NONE + 1; f < MESA_FORMAT_COUNT; f++) {
GLenum datatype = 0;
/**
- * Return datatype and number of components per texel for the given gl_format.
+ * Return datatype and number of components per texel for the given mesa_format.
* Only used for mipmap generation code.
*/
void
-_mesa_format_to_type_and_comps(gl_format format,
+_mesa_format_to_type_and_comps(mesa_format format,
GLenum *datatype, GLuint *comps)
{
switch (format) {
}
/**
- * Check if a gl_format exactly matches a GL format/type combination
+ * Check if a mesa_format exactly matches a GL format/type combination
* such that we can use memcpy() from one to the other.
- * \param gl_format a MESA_FORMAT_x value
+ * \param mesa_format a MESA_FORMAT_x value
* \param format the user-specified image format
* \param type the user-specified image datatype
* \param swapBytes typically the current pixel pack/unpack byteswap state
* \return GL_TRUE if the formats match, GL_FALSE otherwise.
*/
GLboolean
-_mesa_format_matches_format_and_type(gl_format gl_format,
+_mesa_format_matches_format_and_type(mesa_format mesa_format,
GLenum format, GLenum type,
GLboolean swapBytes)
{
* enums in formats.h.
*/
- switch (gl_format) {
+ switch (mesa_format) {
case MESA_FORMAT_NONE:
case MESA_FORMAT_COUNT:
MESA_FORMAT_SIGNED_RG1616,
MESA_FORMAT_COUNT
-} gl_format;
+} mesa_format;
extern const char *
-_mesa_get_format_name(gl_format format);
+_mesa_get_format_name(mesa_format format);
extern GLint
-_mesa_get_format_bytes(gl_format format);
+_mesa_get_format_bytes(mesa_format format);
extern GLint
-_mesa_get_format_bits(gl_format format, GLenum pname);
+_mesa_get_format_bits(mesa_format format, GLenum pname);
extern GLuint
-_mesa_get_format_max_bits(gl_format format);
+_mesa_get_format_max_bits(mesa_format format);
extern GLenum
-_mesa_get_format_datatype(gl_format format);
+_mesa_get_format_datatype(mesa_format format);
extern GLenum
-_mesa_get_format_base_format(gl_format format);
+_mesa_get_format_base_format(mesa_format format);
extern void
-_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh);
+_mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh);
extern GLboolean
-_mesa_is_format_compressed(gl_format format);
+_mesa_is_format_compressed(mesa_format format);
extern GLboolean
-_mesa_is_format_packed_depth_stencil(gl_format format);
+_mesa_is_format_packed_depth_stencil(mesa_format format);
extern GLboolean
-_mesa_is_format_integer_color(gl_format format);
+_mesa_is_format_integer_color(mesa_format format);
extern GLboolean
-_mesa_is_format_unsigned(gl_format format);
+_mesa_is_format_unsigned(mesa_format format);
extern GLboolean
-_mesa_is_format_signed(gl_format format);
+_mesa_is_format_signed(mesa_format format);
extern GLenum
-_mesa_get_format_color_encoding(gl_format format);
+_mesa_get_format_color_encoding(mesa_format format);
extern GLuint
-_mesa_format_image_size(gl_format format, GLsizei width,
+_mesa_format_image_size(mesa_format format, GLsizei width,
GLsizei height, GLsizei depth);
extern uint64_t
-_mesa_format_image_size64(gl_format format, GLsizei width,
+_mesa_format_image_size64(mesa_format format, GLsizei width,
GLsizei height, GLsizei depth);
extern GLint
-_mesa_format_row_stride(gl_format format, GLsizei width);
+_mesa_format_row_stride(mesa_format format, GLsizei width);
extern void
-_mesa_format_to_type_and_comps(gl_format format,
+_mesa_format_to_type_and_comps(mesa_format format,
GLenum *datatype, GLuint *comps);
extern void
_mesa_test_formats(void);
-extern gl_format
-_mesa_get_srgb_format_linear(gl_format format);
+extern mesa_format
+_mesa_get_srgb_format_linear(mesa_format format);
-extern gl_format
-_mesa_get_uncompressed_format(gl_format format);
+extern mesa_format
+_mesa_get_uncompressed_format(mesa_format format);
extern GLuint
-_mesa_format_num_components(gl_format format);
+_mesa_format_num_components(mesa_format format);
GLboolean
-_mesa_format_matches_format_and_type(gl_format gl_format,
+_mesa_format_matches_format_and_type(mesa_format mesa_format,
GLenum format, GLenum type,
GLboolean swapBytes);
if (fb->Attachment[i].Renderbuffer) {
const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
const GLenum baseFormat = _mesa_get_format_base_format(rb->Format);
- const gl_format fmt = rb->Format;
+ const mesa_format fmt = rb->Format;
/* Grab samples and sampleBuffers from any attachment point (assuming
* the framebuffer is complete, we'll get the same answer from all
for (i = 0; i < BUFFER_COUNT; i++) {
if (fb->Attachment[i].Renderbuffer) {
const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer;
- const gl_format fmt = rb->Format;
+ const mesa_format fmt = rb->Format;
if (_mesa_get_format_datatype(fmt) == GL_FLOAT) {
fb->Visual.floatMode = GL_TRUE;
if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) {
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_DEPTH].Renderbuffer;
- const gl_format fmt = rb->Format;
+ const mesa_format fmt = rb->Format;
fb->Visual.haveDepthBuffer = GL_TRUE;
fb->Visual.depthBits = _mesa_get_format_bits(fmt, GL_DEPTH_BITS);
}
if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) {
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_STENCIL].Renderbuffer;
- const gl_format fmt = rb->Format;
+ const mesa_format fmt = rb->Format;
fb->Visual.haveStencilBuffer = GL_TRUE;
fb->Visual.stencilBits = _mesa_get_format_bits(fmt, GL_STENCIL_BITS);
}
if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) {
const struct gl_renderbuffer *rb =
fb->Attachment[BUFFER_ACCUM].Renderbuffer;
- const gl_format fmt = rb->Format;
+ const mesa_format fmt = rb->Format;
fb->Visual.haveAccumBuffer = GL_TRUE;
fb->Visual.accumRedBits = _mesa_get_format_bits(fmt, GL_RED_BITS);
fb->Visual.accumGreenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS);
_mesa_prepare_mipmap_level(struct gl_context *ctx,
struct gl_texture_object *texObj, GLuint level,
GLsizei width, GLsizei height, GLsizei depth,
- GLsizei border, GLenum intFormat, gl_format format)
+ GLsizei border, GLenum intFormat, mesa_format format)
{
const GLuint numFaces = _mesa_num_tex_faces(texObj->Target);
GLuint face;
GLuint maxLevel)
{
GLuint level;
- gl_format temp_format;
+ mesa_format temp_format;
GLint components;
GLuint temp_src_row_stride, temp_src_img_stride; /* in bytes */
GLubyte *temp_src = NULL, *temp_dst = NULL;
_mesa_prepare_mipmap_level(struct gl_context *ctx,
struct gl_texture_object *texObj, GLuint level,
GLsizei width, GLsizei height, GLsizei depth,
- GLsizei border, GLenum intFormat, gl_format format);
+ GLsizei border, GLenum intFormat, mesa_format format);
extern void
_mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
* GL_DEPTH_STENCIL_EXT only. Used for
* choosing TexEnv arithmetic.
*/
- gl_format TexFormat; /**< The actual texture memory format */
+ mesa_format TexFormat; /**< The actual texture memory format */
GLuint Border; /**< 0 or 1 */
GLuint Width; /**< = 2^WidthLog2 + 2*Border */
struct gl_buffer_object *BufferObject;
GLenum BufferObjectFormat;
/** Equivalent Mesa format for BufferObjectFormat. */
- gl_format _BufferObjectFormat;
+ mesa_format _BufferObjectFormat;
/** GL_ARB_texture_buffer_range */
GLintptr BufferOffset;
GLsizeiptr BufferSize; /**< if this is -1, use BufferObject->Size instead */
GLenum InternalFormat; /**< The user-specified format */
GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or
GL_STENCIL_INDEX. */
- gl_format Format; /**< The actual renderbuffer memory format */
+ mesa_format Format; /**< The actual renderbuffer memory format */
/**
* Pointer to the texture image if this renderbuffer wraps a texture,
* otherwise NULL.
/**
* Mesa format corresponding to \c Format.
*/
- gl_format _ActualFormat;
+ mesa_format _ActualFormat;
/**
* GL_TRUE if the state of this image unit is valid and access from
* Return true if the conversion L=R+G+B is needed.
*/
static GLboolean
-need_rgb_to_luminance_conversion(gl_format texFormat, GLenum format)
+need_rgb_to_luminance_conversion(mesa_format texFormat, GLenum format)
{
GLenum baseTexFormat = _mesa_get_format_base_format(texFormat);
* Return transfer op flags for this ReadPixels operation.
*/
static GLbitfield
-get_readpixels_transfer_ops(const struct gl_context *ctx, gl_format texFormat,
+get_readpixels_transfer_ops(const struct gl_context *ctx, mesa_format texFormat,
GLenum format, GLenum type, GLboolean uses_blit)
{
GLbitfield transferOps = ctx->_ImageTransferState;
GLbitfield transferOps )
{
struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
- const gl_format rbFormat = _mesa_get_srgb_format_linear(rb->Format);
+ const mesa_format rbFormat = _mesa_get_srgb_format_linear(rb->Format);
void *rgba;
GLubyte *dst, *map;
int dstStride, stride, j;
# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88_REV
#endif
-static gl_format
+static mesa_format
get_image_format(GLenum format)
{
switch (format) {
};
static enum image_format_class
-get_image_format_class(gl_format format)
+get_image_format_class(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGBA_FLOAT32:
/**
* Convert a compressed MESA_FORMAT_x to a GLenum.
*/
-gl_format
+mesa_format
_mesa_glenum_to_compressed_format(GLenum format)
{
switch (format) {
* internal format unchanged.
*/
GLenum
-_mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat)
+_mesa_compressed_format_to_glenum(struct gl_context *ctx, mesa_format mesaFormat)
{
switch (mesaFormat) {
case MESA_FORMAT_RGB_FXT1:
*/
GLubyte *
_mesa_compressed_image_address(GLint col, GLint row, GLint img,
- gl_format mesaFormat,
+ mesa_format mesaFormat,
GLsizei width, const GLubyte *image)
{
/* XXX only 2D images implemented, not 3D */
* invalid format.
*/
compressed_fetch_func
-_mesa_get_compressed_fetch_func(gl_format format)
+_mesa_get_compressed_fetch_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGB_DXT1:
* compressed source image.
*/
void
-_mesa_decompress_image(gl_format format, GLuint width, GLuint height,
+_mesa_decompress_image(mesa_format format, GLuint width, GLuint height,
const GLubyte *src, GLint srcRowStride,
GLfloat *dest)
{
extern GLuint
_mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats);
-extern gl_format
+extern mesa_format
_mesa_glenum_to_compressed_format(GLenum format);
extern GLenum
-_mesa_compressed_format_to_glenum(struct gl_context *ctx, gl_format mesaFormat);
+_mesa_compressed_format_to_glenum(struct gl_context *ctx, mesa_format mesaFormat);
extern GLubyte *
_mesa_compressed_image_address(GLint col, GLint row, GLint img,
- gl_format mesaFormat,
+ mesa_format mesaFormat,
GLsizei width, const GLubyte *image);
GLfloat *texel);
extern compressed_fetch_func
-_mesa_get_compressed_fetch_func(gl_format format);
+_mesa_get_compressed_fetch_func(mesa_format format);
extern void
-_mesa_decompress_image(gl_format format, GLuint width, GLuint height,
+_mesa_decompress_image(mesa_format format, GLuint width, GLuint height,
const GLubyte *src, GLint srcRowStride,
GLfloat *dest);
unsigned src_stride,
unsigned src_width,
unsigned src_height,
- gl_format format)
+ mesa_format format)
{
if (format == MESA_FORMAT_ETC2_RGB8)
etc2_unpack_rgb8(dst_row, dst_stride,
compressed_fetch_func
-_mesa_get_etc_fetch_func(gl_format format)
+_mesa_get_etc_fetch_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_ETC1_RGB8:
unsigned src_stride,
unsigned src_width,
unsigned src_height,
- gl_format format);
+ mesa_format format);
compressed_fetch_func
-_mesa_get_etc_fetch_func(gl_format format);
+_mesa_get_etc_fetch_func(mesa_format format);
#endif
compressed_fetch_func
-_mesa_get_fxt_fetch_func(gl_format format)
+_mesa_get_fxt_fetch_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGB_FXT1:
compressed_fetch_func
-_mesa_get_fxt_fetch_func(gl_format format);
+_mesa_get_fxt_fetch_func(mesa_format format);
#endif /* TEXCOMPRESS_FXT1_H */
compressed_fetch_func
-_mesa_get_compressed_rgtc_func(gl_format format)
+_mesa_get_compressed_rgtc_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RED_RGTC1:
_mesa_texstore_signed_rg_rgtc2(TEXSTORE_PARAMS);
extern compressed_fetch_func
-_mesa_get_compressed_rgtc_func(gl_format format);
+_mesa_get_compressed_rgtc_func(mesa_format format);
#endif
compressed_fetch_func
-_mesa_get_dxt_fetch_func(gl_format format)
+_mesa_get_dxt_fetch_func(mesa_format format)
{
switch (format) {
case MESA_FORMAT_RGB_DXT1:
_mesa_init_texture_s3tc(struct gl_context *ctx);
extern compressed_fetch_func
-_mesa_get_dxt_fetch_func(gl_format format);
+_mesa_get_dxt_fetch_func(mesa_format format);
#endif /* TEXCOMPRESS_S3TC_H */
* \param format incoming image pixel format.
* \param type incoming image data type.
*
- * \return the closest gl_format for the given format/type arguments
+ * \return the closest mesa_format for the given format/type arguments
*
* This is called via dd_function_table::ChooseTextureFormat. Hardware
* drivers may override this function with a specialized version.
*/
-gl_format
+mesa_format
_mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
GLint internalFormat, GLenum format, GLenum type)
{
struct gl_context;
-extern gl_format
+extern mesa_format
_mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
GLint internalFormat, GLenum format, GLenum type);
GLbitfield transferOps)
{
/* don't want to apply sRGB -> RGB conversion here so override the format */
- const gl_format texFormat =
+ const mesa_format texFormat =
_mesa_get_srgb_format_linear(texImage->TexFormat);
const GLenum baseFormat = _mesa_get_format_base_format(texFormat);
const GLenum destBaseFormat = _mesa_base_tex_format(ctx, format);
GLbitfield transferOps)
{
/* don't want to apply sRGB -> RGB conversion here so override the format */
- const gl_format texFormat =
+ const mesa_format texFormat =
_mesa_get_srgb_format_linear(texImage->TexFormat);
const GLuint width = texImage->Width;
GLenum destBaseFormat = _mesa_base_pack_format(format);
struct gl_texture_image *img,
GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLenum internalFormat,
- gl_format format)
+ mesa_format format)
{
GLenum target;
ASSERT(img);
*/
GLboolean
_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
- gl_format format,
+ mesa_format format,
GLint width, GLint height, GLint depth, GLint border)
{
/* We just check if the image size is less than MaxTextureMbytes.
compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth,
GLenum glformat)
{
- gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
+ mesa_format mesaFormat = _mesa_glenum_to_compressed_format(glformat);
return _mesa_format_image_size(mesaFormat, width, height, depth);
}
* for efficient texture memory layout/allocation. In particular, this
* comes up during automatic mipmap generation.
*/
-gl_format
+mesa_format
_mesa_choose_texture_format(struct gl_context *ctx,
struct gl_texture_object *texObj,
GLenum target, GLint level,
GLenum internalFormat, GLenum format, GLenum type)
{
- gl_format f;
+ mesa_format f;
/* see if we've already chosen a format for the previous level */
if (level > 0) {
struct gl_pixelstore_attrib unpack_no_border;
const struct gl_pixelstore_attrib *unpack = &ctx->Unpack;
struct gl_texture_object *texObj;
- gl_format texFormat;
+ mesa_format texFormat;
GLboolean dimensionsOK, sizeOK;
FLUSH_VERTICES(ctx, 0);
* from. This depends on whether the texture contains color or depth values.
*/
static struct gl_renderbuffer *
-get_copy_tex_image_source(struct gl_context *ctx, gl_format texFormat)
+get_copy_tex_image_source(struct gl_context *ctx, mesa_format texFormat)
{
if (_mesa_get_format_bits(texFormat, GL_DEPTH_BITS) > 0) {
/* reading from depth/stencil buffer */
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
const GLuint face = _mesa_tex_target_to_face(target);
- gl_format texFormat;
+ mesa_format texFormat;
FLUSH_VERTICES(ctx, 0);
width, height, depth, format, imageSize, data);
}
-static gl_format
+static mesa_format
get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat)
{
if (ctx->API != API_OPENGL_CORE) {
}
-gl_format
+mesa_format
_mesa_validate_texbuffer_format(const struct gl_context *ctx,
GLenum internalFormat)
{
- gl_format format = get_texbuffer_format(ctx, internalFormat);
+ mesa_format format = get_texbuffer_format(ctx, internalFormat);
GLenum datatype;
if (format == MESA_FORMAT_NONE)
GLintptr offset, GLsizeiptr size)
{
struct gl_texture_object *texObj;
- gl_format format;
+ mesa_format format;
FLUSH_VERTICES(ctx, 0);
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
GLboolean sizeOK, dimensionsOK;
- gl_format texFormat;
+ mesa_format texFormat;
GLenum sample_count_error;
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_image *img,
GLsizei width, GLsizei height, GLsizei depth,
GLint border, GLenum internalFormat,
- gl_format format);
+ mesa_format format);
-extern gl_format
+extern mesa_format
_mesa_choose_texture_format(struct gl_context *ctx,
struct gl_texture_object *texObj,
GLenum target, GLint level,
extern GLboolean
_mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target, GLint level,
- gl_format format,
+ mesa_format format,
GLint width, GLint height, GLint depth, GLint border);
GLint level, GLint width, GLint height,
GLint depth, GLint border);
-extern gl_format
+extern mesa_format
_mesa_validate_texbuffer_format(const struct gl_context *ctx,
GLenum internalFormat);
GLubyte texel[4];
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
- gl_format texFormat;
+ mesa_format texFormat;
GLuint dims, face, numFaces = 1;
GLenum target;
GLenum pname, GLint *params)
{
const struct gl_texture_image *img = NULL;
- gl_format texFormat;
+ mesa_format texFormat;
img = _mesa_select_tex_image(ctx, texObj, target, level);
if (!img || img->TexFormat == MESA_FORMAT_NONE) {
GLenum pname, GLint *params)
{
const struct gl_buffer_object *bo = texObj->BufferObject;
- gl_format texFormat = texObj->_BufferObjectFormat;
+ mesa_format texFormat = texObj->_BufferObjectFormat;
GLenum internalFormat = texObj->BufferObjectFormat;
GLenum baseFormat = _mesa_get_format_base_format(texFormat);
struct gl_texture_object *texObj,
GLint levels,
GLsizei width, GLsizei height, GLsizei depth,
- GLenum internalFormat, gl_format texFormat)
+ GLenum internalFormat, mesa_format texFormat)
{
const GLenum target = texObj->Target;
const GLuint numFaces = _mesa_num_tex_faces(target);
{
struct gl_texture_object *texObj;
GLboolean sizeOK, dimensionsOK;
- gl_format texFormat;
+ mesa_format texFormat;
GET_CURRENT_CONTEXT(ctx);
static void
memcpy_texture(struct gl_context *ctx,
GLuint dimensions,
- gl_format dstFormat,
+ mesa_format dstFormat,
GLint dstRowStride,
GLubyte **dstSlices,
GLint srcWidth, GLint srcHeight, GLint srcDepth,
static GLboolean
_mesa_texstore_srgb8(TEXSTORE_PARAMS)
{
- gl_format newDstFormat;
+ mesa_format newDstFormat;
GLboolean k;
ASSERT(dstFormat == MESA_FORMAT_SRGB8);
static GLboolean
_mesa_texstore_srgba8(TEXSTORE_PARAMS)
{
- gl_format newDstFormat;
+ mesa_format newDstFormat;
GLboolean k;
ASSERT(dstFormat == MESA_FORMAT_SRGBA8 ||
static GLboolean
_mesa_texstore_sargb8(TEXSTORE_PARAMS)
{
- gl_format newDstFormat;
+ mesa_format newDstFormat;
GLboolean k;
ASSERT(dstFormat == MESA_FORMAT_SARGB8);
static GLboolean
_mesa_texstore_sl8(TEXSTORE_PARAMS)
{
- gl_format newDstFormat;
+ mesa_format newDstFormat;
GLboolean k;
ASSERT(dstFormat == MESA_FORMAT_SL8);
static GLboolean
_mesa_texstore_sla8(TEXSTORE_PARAMS)
{
- gl_format newDstFormat;
+ mesa_format newDstFormat;
GLboolean k;
ASSERT(dstFormat == MESA_FORMAT_SLA8);
* Return the StoreTexImageFunc pointer to store an image in the given format.
*/
static StoreTexImageFunc
-_mesa_get_texstore_func(gl_format format)
+_mesa_get_texstore_func(mesa_format format)
{
static StoreTexImageFunc table[MESA_FORMAT_COUNT];
static GLboolean initialized = GL_FALSE;
GLboolean
_mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
GLenum baseInternalFormat,
- gl_format dstFormat)
+ mesa_format dstFormat)
{
GLenum dstType;
GLboolean
_mesa_texstore_can_use_memcpy(struct gl_context *ctx,
- GLenum baseInternalFormat, gl_format dstFormat,
+ GLenum baseInternalFormat, mesa_format dstFormat,
GLenum srcFormat, GLenum srcType,
const struct gl_pixelstore_attrib *srcPacking)
{
* \param texFormat the destination texture format
*/
static GLbitfield
-get_read_write_mode(GLenum userFormat, gl_format texFormat)
+get_read_write_mode(GLenum userFormat, mesa_format texFormat)
{
if ((userFormat == GL_STENCIL_INDEX || userFormat == GL_DEPTH_COMPONENT)
&& _mesa_get_format_base_format(texFormat) == GL_DEPTH_STENCIL)
GLint i, rows;
GLubyte *dstMap;
const GLubyte *src;
- const gl_format texFormat = texImage->TexFormat;
+ const mesa_format texFormat = texImage->TexFormat;
GLuint bw, bh;
GLint slice;
#define TEXSTORE_PARAMS \
struct gl_context *ctx, GLuint dims, \
GLenum baseInternalFormat, \
- gl_format dstFormat, \
+ mesa_format dstFormat, \
GLint dstRowStride, \
GLubyte **dstSlices, \
GLint srcWidth, GLint srcHeight, GLint srcDepth, \
extern GLboolean
_mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
GLenum baseInternalFormat,
- gl_format dstFormat);
+ mesa_format dstFormat);
extern GLboolean
_mesa_texstore_can_use_memcpy(struct gl_context *ctx,
- GLenum baseInternalFormat, gl_format dstFormat,
+ GLenum baseInternalFormat, mesa_format dstFormat,
GLenum srcFormat, GLenum srcType,
const struct gl_pixelstore_attrib *srcPacking);
struct gl_texture_object *texObj,
GLint levels,
GLsizei width, GLsizei height, GLsizei depth,
- GLenum internalFormat, gl_format texFormat)
+ GLenum internalFormat, mesa_format texFormat)
{
const GLuint numFaces = _mesa_num_tex_faces(target);
GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
GLuint newViewMinLevel, newViewMinLayer;
GLuint newViewNumLevels, newViewNumLayers;
GLsizei width, height, depth;
- gl_format texFormat;
+ mesa_format texFormat;
GLboolean sizeOK, dimensionsOK;
GLenum faceTarget;
{
struct gl_context *ctx = st->ctx;
struct pipe_context *pipe = st->pipe;
- gl_format mformat;
+ mesa_format mformat;
struct pipe_resource *pt;
enum pipe_format pipeFormat;
GLenum baseInternalFormat;
*/
success = _mesa_texstore(ctx, 2, /* dims */
baseInternalFormat, /* baseInternalFormat */
- mformat, /* gl_format */
+ mformat, /* mesa_format */
transfer->stride, /* dstRowStride, bytes */
&dest, /* destSlices */
width, height, 1, /* size */
struct st_texture_object *stObj;
struct st_texture_image *stImage;
GLenum internalFormat;
- gl_format texFormat;
+ mesa_format texFormat;
/* map pipe format to base format */
if (util_format_get_component_bits(ps->format, UTIL_FORMAT_COLORSPACE_RGB, 3) > 0)
{
const struct st_texture_object *stObj = st_texture_object(att->Texture);
enum pipe_format format;
- gl_format texFormat;
+ mesa_format texFormat;
GLboolean valid;
/* Sanity check: we must be binding the surface as a (color) render target
* Later when we create a surface, we change the format to a linear one. */
if (!ctx->Extensions.EXT_framebuffer_sRGB &&
_mesa_get_format_color_encoding(texFormat) == GL_SRGB) {
- const gl_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
+ const mesa_format linearFormat = _mesa_get_srgb_format_linear(texFormat);
format = st_mesa_format_to_pipe_format(linearFormat);
}
if (stObj->surface_based) {
const GLenum target = texObj->Target;
const GLuint level = texImage->Level;
- gl_format texFormat;
+ mesa_format texFormat;
_mesa_clear_texture_object(ctx, texObj);
pipe_resource_reference(&stObj->pt, NULL);
struct pipe_transfer *transfer;
struct pipe_blit_info blit;
enum pipe_format src_format, dst_format;
- gl_format mesa_src_format;
+ mesa_format mesa_src_format;
GLenum gl_target = texImage->TexObject->Target;
unsigned bind;
GLubyte *map;
struct pipe_resource *dst = NULL;
struct pipe_resource dst_templ;
enum pipe_format dst_format, src_format;
- gl_format mesa_format;
+ mesa_format mesa_format;
GLenum gl_target = texImage->TexObject->Target;
enum pipe_texture_target pipe_target;
struct pipe_blit_info blit;
static GLboolean
st_TestProxyTexImage(struct gl_context *ctx, GLenum target,
- GLint level, gl_format format,
+ GLint level, mesa_format format,
GLint width, GLint height,
GLint depth, GLint border)
{
* Translate Mesa format to Gallium format.
*/
enum pipe_format
-st_mesa_format_to_pipe_format(gl_format mesaFormat)
+st_mesa_format_to_pipe_format(mesa_format mesaFormat)
{
switch (mesaFormat) {
case MESA_FORMAT_RGBA8888:
/**
* Translate Gallium format to Mesa format.
*/
-gl_format
+mesa_format
st_pipe_format_to_mesa_format(enum pipe_format format)
{
switch (format) {
st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
GLenum format, GLenum type, GLboolean swapBytes)
{
- gl_format mesa_format;
+ mesa_format mesa_format;
for (mesa_format = 1; mesa_format < MESA_FORMAT_COUNT; mesa_format++) {
if (_mesa_get_format_color_encoding(mesa_format) == GL_SRGB) {
/**
* Called via ctx->Driver.ChooseTextureFormat().
*/
-gl_format
+mesa_format
st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
GLint internalFormat,
GLenum format, GLenum type)
extern enum pipe_format
-st_mesa_format_to_pipe_format(gl_format mesaFormat);
+st_mesa_format_to_pipe_format(mesa_format mesaFormat);
-extern gl_format
+extern mesa_format
st_pipe_format_to_mesa_format(enum pipe_format pipeFormat);
st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
GLenum format, GLenum type, GLboolean swapBytes);
-extern gl_format
+extern mesa_format
st_ChooseTextureFormat(struct gl_context * ctx, GLenum target,
GLint internalFormat,
GLenum format, GLenum type);
texImage = _mesa_get_tex_image(ctx, texObj, target, level);
stImage = st_texture_image(texImage);
if (tex) {
- gl_format texFormat = st_pipe_format_to_mesa_format(pipe_format);
+ mesa_format texFormat = st_pipe_format_to_mesa_format(pipe_format);
if (util_format_has_alpha(tex->format))
internalFormat = GL_RGBA;
struct pipe_resource *res;
struct pipe_sampler_view *sv, templ;
- gl_format texFormat;
+ mesa_format texFormat;
getProcAddr = ctx->vdpGetProcAddress;
if (output) {
GLint srcBufferY0 = -1, srcBufferY1 = -1;
GLvoid *dstBuffer;
- gl_format readFormat = _mesa_get_srgb_format_linear(readRb->Format);
+ mesa_format readFormat = _mesa_get_srgb_format_linear(readRb->Format);
GLuint bpp = _mesa_get_format_bytes(readFormat);
GLenum pixelType;
GLint idx = drawFb->_ColorDrawBufferIndexes[i];
struct gl_renderbuffer_attachment *drawAtt;
struct gl_renderbuffer *drawRb;
- gl_format drawFormat;
+ mesa_format drawFormat;
if (idx == -1)
continue;
* within the 4-byte pixel will be either 0 or 3.
*/
static GLint
-get_stencil_offset(gl_format format)
+get_stencil_offset(mesa_format format)
{
const GLubyte one = 1;
GLubyte pixel[MAX_PIXEL_BYTES];
* XXX this is somewhat temporary.
*/
static struct {
- gl_format Name;
+ mesa_format Name;
FetchTexelFunc Fetch1D;
FetchTexelFunc Fetch2D;
FetchTexelFunc Fetch3D;
set_fetch_functions(const struct gl_sampler_object *samp,
struct swrast_texture_image *texImage, GLuint dims)
{
- gl_format format = texImage->Base.TexFormat;
+ mesa_format format = texImage->Base.TexFormat;
#ifdef DEBUG
/* check that the table entries are sorted by format name */
- gl_format fmt;
+ mesa_format fmt;
for (fmt = 0; fmt < MESA_FORMAT_COUNT; fmt++) {
assert(texfetch_funcs[fmt].Name == fmt);
}
struct gl_renderbuffer *rb = att->Renderbuffer;
struct swrast_renderbuffer *srb = swrast_renderbuffer(rb);
struct swrast_texture_image *swImage;
- gl_format format;
+ mesa_format format;
GLuint zOffset;
(void) ctx;
const struct gl_texture_image *texImg;
const struct swrast_texture_image *swImg;
GLenum minFilter, magFilter, envMode;
- gl_format format;
+ mesa_format format;
texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX];
if (ctx->Texture.Unit[0].Sampler)
samp = ctx->Texture.Unit[0].Sampler;