aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-02-07 23:28:38 +0100
committermarha <marha@users.sourceforge.net>2014-02-07 23:38:15 +0100
commit982ac918afe6a1c02d5cf735d7b6c56443a048cc (patch)
treee737eb3f7bb18d933e14f0967c1c1aa5ce5e06f6 /mesalib/src/mesa/state_tracker
parent30af30b78075159fce477ae99cc72540133714d0 (diff)
downloadvcxsrv-982ac918afe6a1c02d5cf735d7b6c56443a048cc.tar.gz
vcxsrv-982ac918afe6a1c02d5cf735d7b6c56443a048cc.tar.bz2
vcxsrv-982ac918afe6a1c02d5cf735d7b6c56443a048cc.zip
xkbcomp xkeyboard-config libxcb libxtrans fontconfig libX11 libxcb mesa xserver git update 7 Feb 2014
Update to openssl1.0.1f xserver commit 83e38eb73fd8c852513aac2da2975b4c01070ec2 libxcb commit d7eb0bdf3b5b11ee9f40ee5e73df8fc0bdfa59f3 xkeyboard-config commit 7596672b96315465df8d8d691e3a567a52f70743 libX11 commit aacf95dacc7c598e7297894580d4d655593813b2 xkbcomp commit 31b90ee4ffc774e0da540277907fc5540c0b012c libxtrans commit 3f0de269abe59353acbd7a5587d68ce0da91db67 fontconfig commit e310d2fac2d874d5aa76c609df70cc7b871c0b6d mesa commit dd2229d4c68ed78a50104637aef904f8ab6d7dd3
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c9
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawpixels.c4
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_eglimage.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_fbo.c4
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_texture.c18
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c19
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.c514
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.h6
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp2
-rw-r--r--mesalib/src/mesa/state_tracker/st_manager.c6
-rw-r--r--mesalib/src/mesa/state_tracker/st_program.c19
-rw-r--r--mesalib/src/mesa/state_tracker/st_vdpau.c6
12 files changed, 313 insertions, 296 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
index ac8d0798a..c8f088dc8 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -229,7 +229,8 @@ st_bufferobj_data(struct gl_context *ctx,
case GL_STATIC_DRAW:
case GL_STATIC_READ:
case GL_STATIC_COPY:
- pipe_usage = PIPE_USAGE_STATIC;
+ default:
+ pipe_usage = PIPE_USAGE_DEFAULT;
break;
case GL_DYNAMIC_DRAW:
case GL_DYNAMIC_READ:
@@ -241,8 +242,6 @@ st_bufferobj_data(struct gl_context *ctx,
case GL_STREAM_COPY:
pipe_usage = PIPE_USAGE_STREAM;
break;
- default:
- pipe_usage = PIPE_USAGE_DEFAULT;
}
pipe_resource_reference( &st_obj->buffer, NULL );
@@ -436,6 +435,6 @@ st_init_bufferobject_functions(struct dd_function_table *functions)
functions->CopyBufferSubData = st_copy_buffer_subdata;
/* For GL_APPLE_vertex_array_object */
- functions->NewArrayObject = _mesa_new_array_object;
- functions->DeleteArrayObject = _mesa_delete_array_object;
+ functions->NewArrayObject = _mesa_new_vao;
+ functions->DeleteArrayObject = _mesa_delete_vao;
}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
index 97f213077..90f34e39e 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -483,7 +483,7 @@ make_texture(struct st_context *st,
{
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;
@@ -542,7 +542,7 @@ make_texture(struct st_context *st,
*/
success = _mesa_texstore(ctx, 2, /* dims */
baseInternalFormat, /* baseInternalFormat */
- mformat, /* gl_format */
+ mformat, /* mesa_format */
transfer->stride, /* dstRowStride, bytes */
&dest, /* destSlices */
width, height, 1, /* size */
diff --git a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c
index 7484cb4f1..561967d6c 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_eglimage.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_eglimage.c
@@ -99,7 +99,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target,
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)
diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c
index 780148487..6449c62a8 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c
@@ -541,7 +541,7 @@ st_validate_attachment(struct gl_context *ctx,
{
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
@@ -568,7 +568,7 @@ st_validate_attachment(struct gl_context *ctx,
* 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);
}
diff --git a/mesalib/src/mesa/state_tracker/st_cb_texture.c b/mesalib/src/mesa/state_tracker/st_cb_texture.c
index aa0862867..f0bf3745b 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_texture.c
@@ -519,7 +519,7 @@ prep_teximage(struct gl_context *ctx, struct gl_texture_image *texImage,
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);
@@ -604,7 +604,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
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;
@@ -856,7 +856,7 @@ st_GetTexImage(struct gl_context * ctx,
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;
@@ -865,7 +865,9 @@ st_GetTexImage(struct gl_context * ctx,
ubyte *map = NULL;
boolean done = FALSE;
- if (!st->prefer_blit_based_texture_transfer) {
+ if (!st->prefer_blit_based_texture_transfer &&
+ !_mesa_is_format_compressed(texImage->TexFormat)) {
+ /* Try to avoid the fallback if we're doing texture decompression here */
goto fallback;
}
@@ -1483,6 +1485,12 @@ st_finalize_texture(struct gl_context *ctx,
if (tObj->Target == GL_TEXTURE_BUFFER) {
struct st_buffer_object *st_obj = st_buffer_object(tObj->BufferObject);
+ if (!st_obj) {
+ pipe_resource_reference(&stObj->pt, NULL);
+ pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+ return GL_TRUE;
+ }
+
if (st_obj->buffer != stObj->pt) {
pipe_resource_reference(&stObj->pt, st_obj->buffer);
pipe_sampler_view_release(st->pipe, &stObj->sampler_view);
@@ -1689,7 +1697,7 @@ st_AllocTextureStorage(struct gl_context *ctx,
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)
{
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index e7d5d7413..9829eb596 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -89,10 +89,6 @@ void st_init_limits(struct st_context *st)
c->MaxArrayTextureLayers
= screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
- c->MaxCombinedTextureImageUnits
- = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
- MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-
/* Define max viewport size and max renderbuffer size in terms of
* max texture size (note: max tex RECT size = max tex 2D size).
* If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
@@ -243,6 +239,12 @@ void st_init_limits(struct st_context *st)
options->LowerClipDistance = true;
}
+ c->MaxCombinedTextureImageUnits =
+ _min(c->Program[MESA_SHADER_VERTEX].MaxTextureImageUnits +
+ c->Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits +
+ c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
+ MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+
/* This depends on program constants. */
c->MaxTextureCoordUnits
= _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);
@@ -419,7 +421,9 @@ void st_init_extensions(struct st_context *st)
PIPE_FORMAT_R16G16B16A16_FLOAT } },
{ { o(ARB_texture_rgb10_a2ui) },
- { PIPE_FORMAT_B10G10R10A2_UINT } },
+ { PIPE_FORMAT_R10G10B10A2_UINT,
+ PIPE_FORMAT_B10G10R10A2_UINT },
+ GL_TRUE }, /* at least one format must be supported */
{ { o(EXT_framebuffer_sRGB) },
{ PIPE_FORMAT_A8B8G8R8_SRGB,
@@ -537,7 +541,6 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.EXT_blend_color = GL_TRUE;
ctx->Extensions.EXT_blend_func_separate = GL_TRUE;
ctx->Extensions.EXT_blend_minmax = GL_TRUE;
- ctx->Extensions.EXT_framebuffer_blit = GL_TRUE;
ctx->Extensions.EXT_gpu_program_parameters = GL_TRUE;
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
ctx->Extensions.EXT_point_parameters = GL_TRUE;
@@ -740,9 +743,7 @@ void st_init_extensions(struct st_context *st)
ctx->Const.MinMapBufferAlignment =
screen->get_param(screen, PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT);
- if (ctx->Const.MinMapBufferAlignment >= 64) {
- ctx->Extensions.ARB_map_buffer_alignment = GL_TRUE;
- }
+
if (screen->get_param(screen, PIPE_CAP_TEXTURE_BUFFER_OBJECTS)) {
ctx->Extensions.ARB_texture_buffer_object = GL_TRUE;
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c
index b0158f300..90e9f2f78 100644
--- a/mesalib/src/mesa/state_tracker/st_format.c
+++ b/mesalib/src/mesa/state_tracker/st_format.c
@@ -54,70 +54,70 @@
* 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:
+ case MESA_FORMAT_A8B8G8R8_UNORM:
return PIPE_FORMAT_ABGR8888_UNORM;
- case MESA_FORMAT_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_UNORM:
return PIPE_FORMAT_RGBA8888_UNORM;
- case MESA_FORMAT_ARGB8888:
+ case MESA_FORMAT_B8G8R8A8_UNORM:
return PIPE_FORMAT_BGRA8888_UNORM;
- case MESA_FORMAT_ARGB8888_REV:
+ case MESA_FORMAT_A8R8G8B8_UNORM:
return PIPE_FORMAT_ARGB8888_UNORM;
- case MESA_FORMAT_RGBX8888:
+ case MESA_FORMAT_X8B8G8R8_UNORM:
return PIPE_FORMAT_XBGR8888_UNORM;
- case MESA_FORMAT_RGBX8888_REV:
+ case MESA_FORMAT_R8G8B8X8_UNORM:
return PIPE_FORMAT_RGBX8888_UNORM;
- case MESA_FORMAT_XRGB8888:
+ case MESA_FORMAT_B8G8R8X8_UNORM:
return PIPE_FORMAT_BGRX8888_UNORM;
- case MESA_FORMAT_XRGB8888_REV:
+ case MESA_FORMAT_X8R8G8B8_UNORM:
return PIPE_FORMAT_XRGB8888_UNORM;
- case MESA_FORMAT_ARGB1555:
+ case MESA_FORMAT_B5G5R5A1_UNORM:
return PIPE_FORMAT_B5G5R5A1_UNORM;
- case MESA_FORMAT_ARGB4444:
+ case MESA_FORMAT_B4G4R4A4_UNORM:
return PIPE_FORMAT_B4G4R4A4_UNORM;
- case MESA_FORMAT_RGB565:
+ case MESA_FORMAT_B5G6R5_UNORM:
return PIPE_FORMAT_B5G6R5_UNORM;
- case MESA_FORMAT_RGB332:
+ case MESA_FORMAT_B2G3R3_UNORM:
return PIPE_FORMAT_B2G3R3_UNORM;
- case MESA_FORMAT_ARGB2101010:
+ case MESA_FORMAT_B10G10R10A2_UNORM:
return PIPE_FORMAT_B10G10R10A2_UNORM;
- case MESA_FORMAT_AL44:
+ case MESA_FORMAT_L4A4_UNORM:
return PIPE_FORMAT_L4A4_UNORM;
- case MESA_FORMAT_AL88:
+ case MESA_FORMAT_L8A8_UNORM:
return PIPE_FORMAT_L8A8_UNORM;
- case MESA_FORMAT_AL1616:
+ case MESA_FORMAT_L16A16_UNORM:
return PIPE_FORMAT_L16A16_UNORM;
- case MESA_FORMAT_A8:
+ case MESA_FORMAT_A_UNORM8:
return PIPE_FORMAT_A8_UNORM;
- case MESA_FORMAT_A16:
+ case MESA_FORMAT_A_UNORM16:
return PIPE_FORMAT_A16_UNORM;
- case MESA_FORMAT_L8:
+ case MESA_FORMAT_L_UNORM8:
return PIPE_FORMAT_L8_UNORM;
- case MESA_FORMAT_L16:
+ case MESA_FORMAT_L_UNORM16:
return PIPE_FORMAT_L16_UNORM;
- case MESA_FORMAT_I8:
+ case MESA_FORMAT_I_UNORM8:
return PIPE_FORMAT_I8_UNORM;
- case MESA_FORMAT_I16:
+ case MESA_FORMAT_I_UNORM16:
return PIPE_FORMAT_I16_UNORM;
- case MESA_FORMAT_Z16:
+ case MESA_FORMAT_Z_UNORM16:
return PIPE_FORMAT_Z16_UNORM;
- case MESA_FORMAT_Z32:
+ case MESA_FORMAT_Z_UNORM32:
return PIPE_FORMAT_Z32_UNORM;
- case MESA_FORMAT_Z24_S8:
+ case MESA_FORMAT_S8_UINT_Z24_UNORM:
return PIPE_FORMAT_S8_UINT_Z24_UNORM;
- case MESA_FORMAT_S8_Z24:
+ case MESA_FORMAT_Z24_UNORM_X8_UINT:
return PIPE_FORMAT_Z24_UNORM_S8_UINT;
- case MESA_FORMAT_Z24_X8:
+ case MESA_FORMAT_X8Z24_UNORM:
return PIPE_FORMAT_X8Z24_UNORM;
- case MESA_FORMAT_X8_Z24:
+ case MESA_FORMAT_Z24_UNORM_S8_UINT:
return PIPE_FORMAT_Z24X8_UNORM;
- case MESA_FORMAT_S8:
+ case MESA_FORMAT_S_UINT8:
return PIPE_FORMAT_S8_UINT;
- case MESA_FORMAT_Z32_FLOAT:
+ case MESA_FORMAT_Z_FLOAT32:
return PIPE_FORMAT_Z32_FLOAT;
- case MESA_FORMAT_Z32_FLOAT_X24S8:
+ case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
return PIPE_FORMAT_Z32_FLOAT_S8X24_UINT;
case MESA_FORMAT_YCBCR:
return PIPE_FORMAT_UYVY;
@@ -137,15 +137,15 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
return PIPE_FORMAT_DXT3_SRGBA;
case MESA_FORMAT_SRGBA_DXT5:
return PIPE_FORMAT_DXT5_SRGBA;
- case MESA_FORMAT_SLA8:
+ case MESA_FORMAT_L8A8_SRGB:
return PIPE_FORMAT_L8A8_SRGB;
- case MESA_FORMAT_SL8:
+ case MESA_FORMAT_L_SRGB8:
return PIPE_FORMAT_L8_SRGB;
- case MESA_FORMAT_SRGB8:
+ case MESA_FORMAT_BGR_SRGB8:
return PIPE_FORMAT_R8G8B8_SRGB;
- case MESA_FORMAT_SRGBA8:
+ case MESA_FORMAT_A8B8G8R8_SRGB:
return PIPE_FORMAT_A8B8G8R8_SRGB;
- case MESA_FORMAT_SARGB8:
+ case MESA_FORMAT_B8G8R8A8_SRGB:
return PIPE_FORMAT_B8G8R8A8_SRGB;
case MESA_FORMAT_RGBA_FLOAT32:
return PIPE_FORMAT_R32G32B32A32_FLOAT;
@@ -155,21 +155,21 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
return PIPE_FORMAT_R32G32B32_FLOAT;
case MESA_FORMAT_RGB_FLOAT16:
return PIPE_FORMAT_R16G16B16_FLOAT;
- case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32:
+ case MESA_FORMAT_LA_FLOAT32:
return PIPE_FORMAT_L32A32_FLOAT;
- case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16:
+ case MESA_FORMAT_LA_FLOAT16:
return PIPE_FORMAT_L16A16_FLOAT;
- case MESA_FORMAT_LUMINANCE_FLOAT32:
+ case MESA_FORMAT_L_FLOAT32:
return PIPE_FORMAT_L32_FLOAT;
- case MESA_FORMAT_LUMINANCE_FLOAT16:
+ case MESA_FORMAT_L_FLOAT16:
return PIPE_FORMAT_L16_FLOAT;
- case MESA_FORMAT_ALPHA_FLOAT32:
+ case MESA_FORMAT_A_FLOAT32:
return PIPE_FORMAT_A32_FLOAT;
- case MESA_FORMAT_ALPHA_FLOAT16:
+ case MESA_FORMAT_A_FLOAT16:
return PIPE_FORMAT_A16_FLOAT;
- case MESA_FORMAT_INTENSITY_FLOAT32:
+ case MESA_FORMAT_I_FLOAT32:
return PIPE_FORMAT_I32_FLOAT;
- case MESA_FORMAT_INTENSITY_FLOAT16:
+ case MESA_FORMAT_I_FLOAT16:
return PIPE_FORMAT_I16_FLOAT;
case MESA_FORMAT_R_FLOAT32:
return PIPE_FORMAT_R32_FLOAT;
@@ -180,97 +180,97 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
case MESA_FORMAT_RG_FLOAT16:
return PIPE_FORMAT_R16G16_FLOAT;
- case MESA_FORMAT_R8:
+ case MESA_FORMAT_R_UNORM8:
return PIPE_FORMAT_R8_UNORM;
- case MESA_FORMAT_R16:
+ case MESA_FORMAT_R_UNORM16:
return PIPE_FORMAT_R16_UNORM;
- case MESA_FORMAT_GR88:
+ case MESA_FORMAT_R8G8_UNORM:
return PIPE_FORMAT_R8G8_UNORM;
- case MESA_FORMAT_GR1616:
+ case MESA_FORMAT_R16G16_UNORM:
return PIPE_FORMAT_R16G16_UNORM;
- case MESA_FORMAT_RGBA_16:
+ case MESA_FORMAT_RGBA_UNORM16:
return PIPE_FORMAT_R16G16B16A16_UNORM;
/* signed int formats */
- case MESA_FORMAT_ALPHA_UINT8:
+ case MESA_FORMAT_A_UINT8:
return PIPE_FORMAT_A8_UINT;
- case MESA_FORMAT_ALPHA_UINT16:
+ case MESA_FORMAT_A_UINT16:
return PIPE_FORMAT_A16_UINT;
- case MESA_FORMAT_ALPHA_UINT32:
+ case MESA_FORMAT_A_UINT32:
return PIPE_FORMAT_A32_UINT;
- case MESA_FORMAT_ALPHA_INT8:
+ case MESA_FORMAT_A_SINT8:
return PIPE_FORMAT_A8_SINT;
- case MESA_FORMAT_ALPHA_INT16:
+ case MESA_FORMAT_A_SINT16:
return PIPE_FORMAT_A16_SINT;
- case MESA_FORMAT_ALPHA_INT32:
+ case MESA_FORMAT_A_SINT32:
return PIPE_FORMAT_A32_SINT;
- case MESA_FORMAT_INTENSITY_UINT8:
+ case MESA_FORMAT_I_UINT8:
return PIPE_FORMAT_I8_UINT;
- case MESA_FORMAT_INTENSITY_UINT16:
+ case MESA_FORMAT_I_UINT16:
return PIPE_FORMAT_I16_UINT;
- case MESA_FORMAT_INTENSITY_UINT32:
+ case MESA_FORMAT_I_UINT32:
return PIPE_FORMAT_I32_UINT;
- case MESA_FORMAT_INTENSITY_INT8:
+ case MESA_FORMAT_I_SINT8:
return PIPE_FORMAT_I8_SINT;
- case MESA_FORMAT_INTENSITY_INT16:
+ case MESA_FORMAT_I_SINT16:
return PIPE_FORMAT_I16_SINT;
- case MESA_FORMAT_INTENSITY_INT32:
+ case MESA_FORMAT_I_SINT32:
return PIPE_FORMAT_I32_SINT;
- case MESA_FORMAT_LUMINANCE_UINT8:
+ case MESA_FORMAT_L_UINT8:
return PIPE_FORMAT_L8_UINT;
- case MESA_FORMAT_LUMINANCE_UINT16:
+ case MESA_FORMAT_L_UINT16:
return PIPE_FORMAT_L16_UINT;
- case MESA_FORMAT_LUMINANCE_UINT32:
+ case MESA_FORMAT_L_UINT32:
return PIPE_FORMAT_L32_UINT;
- case MESA_FORMAT_LUMINANCE_INT8:
+ case MESA_FORMAT_L_SINT8:
return PIPE_FORMAT_L8_SINT;
- case MESA_FORMAT_LUMINANCE_INT16:
+ case MESA_FORMAT_L_SINT16:
return PIPE_FORMAT_L16_SINT;
- case MESA_FORMAT_LUMINANCE_INT32:
+ case MESA_FORMAT_L_SINT32:
return PIPE_FORMAT_L32_SINT;
- case MESA_FORMAT_LUMINANCE_ALPHA_UINT8:
+ case MESA_FORMAT_LA_UINT8:
return PIPE_FORMAT_L8A8_UINT;
- case MESA_FORMAT_LUMINANCE_ALPHA_UINT16:
+ case MESA_FORMAT_LA_UINT16:
return PIPE_FORMAT_L16A16_UINT;
- case MESA_FORMAT_LUMINANCE_ALPHA_UINT32:
+ case MESA_FORMAT_LA_UINT32:
return PIPE_FORMAT_L32A32_UINT;
- case MESA_FORMAT_LUMINANCE_ALPHA_INT8:
+ case MESA_FORMAT_LA_SINT8:
return PIPE_FORMAT_L8A8_SINT;
- case MESA_FORMAT_LUMINANCE_ALPHA_INT16:
+ case MESA_FORMAT_LA_SINT16:
return PIPE_FORMAT_L16A16_SINT;
- case MESA_FORMAT_LUMINANCE_ALPHA_INT32:
+ case MESA_FORMAT_LA_SINT32:
return PIPE_FORMAT_L32A32_SINT;
- case MESA_FORMAT_R_INT8:
+ case MESA_FORMAT_R_SINT8:
return PIPE_FORMAT_R8_SINT;
- case MESA_FORMAT_RG_INT8:
+ case MESA_FORMAT_RG_SINT8:
return PIPE_FORMAT_R8G8_SINT;
- case MESA_FORMAT_RGB_INT8:
+ case MESA_FORMAT_RGB_SINT8:
return PIPE_FORMAT_R8G8B8_SINT;
- case MESA_FORMAT_RGBA_INT8:
+ case MESA_FORMAT_RGBA_SINT8:
return PIPE_FORMAT_R8G8B8A8_SINT;
- case MESA_FORMAT_R_INT16:
+ case MESA_FORMAT_R_SINT16:
return PIPE_FORMAT_R16_SINT;
- case MESA_FORMAT_RG_INT16:
+ case MESA_FORMAT_RG_SINT16:
return PIPE_FORMAT_R16G16_SINT;
- case MESA_FORMAT_RGB_INT16:
+ case MESA_FORMAT_RGB_SINT16:
return PIPE_FORMAT_R16G16B16_SINT;
- case MESA_FORMAT_RGBA_INT16:
+ case MESA_FORMAT_RGBA_SINT16:
return PIPE_FORMAT_R16G16B16A16_SINT;
- case MESA_FORMAT_R_INT32:
+ case MESA_FORMAT_R_SINT32:
return PIPE_FORMAT_R32_SINT;
- case MESA_FORMAT_RG_INT32:
+ case MESA_FORMAT_RG_SINT32:
return PIPE_FORMAT_R32G32_SINT;
- case MESA_FORMAT_RGB_INT32:
+ case MESA_FORMAT_RGB_SINT32:
return PIPE_FORMAT_R32G32B32_SINT;
- case MESA_FORMAT_RGBA_INT32:
+ case MESA_FORMAT_RGBA_SINT32:
return PIPE_FORMAT_R32G32B32A32_SINT;
/* unsigned int formats */
@@ -299,96 +299,98 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
case MESA_FORMAT_RGBA_UINT32:
return PIPE_FORMAT_R32G32B32A32_UINT;
- case MESA_FORMAT_RED_RGTC1:
+ case MESA_FORMAT_R_RGTC1_UNORM:
return PIPE_FORMAT_RGTC1_UNORM;
- case MESA_FORMAT_SIGNED_RED_RGTC1:
+ case MESA_FORMAT_R_RGTC1_SNORM:
return PIPE_FORMAT_RGTC1_SNORM;
- case MESA_FORMAT_RG_RGTC2:
+ case MESA_FORMAT_RG_RGTC2_UNORM:
return PIPE_FORMAT_RGTC2_UNORM;
- case MESA_FORMAT_SIGNED_RG_RGTC2:
+ case MESA_FORMAT_RG_RGTC2_SNORM:
return PIPE_FORMAT_RGTC2_SNORM;
- case MESA_FORMAT_L_LATC1:
+ case MESA_FORMAT_L_LATC1_UNORM:
return PIPE_FORMAT_LATC1_UNORM;
- case MESA_FORMAT_SIGNED_L_LATC1:
+ case MESA_FORMAT_L_LATC1_SNORM:
return PIPE_FORMAT_LATC1_SNORM;
- case MESA_FORMAT_LA_LATC2:
+ case MESA_FORMAT_LA_LATC2_UNORM:
return PIPE_FORMAT_LATC2_UNORM;
- case MESA_FORMAT_SIGNED_LA_LATC2:
+ case MESA_FORMAT_LA_LATC2_SNORM:
return PIPE_FORMAT_LATC2_SNORM;
case MESA_FORMAT_ETC1_RGB8:
return PIPE_FORMAT_ETC1_RGB8;
/* signed normalized formats */
- case MESA_FORMAT_SIGNED_R8:
+ case MESA_FORMAT_R_SNORM8:
return PIPE_FORMAT_R8_SNORM;
- case MESA_FORMAT_SIGNED_RG88_REV:
+ case MESA_FORMAT_R8G8_SNORM:
return PIPE_FORMAT_R8G8_SNORM;
- case MESA_FORMAT_SIGNED_RGBA8888_REV:
+ case MESA_FORMAT_R8G8B8A8_SNORM:
return PIPE_FORMAT_R8G8B8A8_SNORM;
- case MESA_FORMAT_SIGNED_A8:
+ case MESA_FORMAT_A_SNORM8:
return PIPE_FORMAT_A8_SNORM;
- case MESA_FORMAT_SIGNED_L8:
+ case MESA_FORMAT_L_SNORM8:
return PIPE_FORMAT_L8_SNORM;
- case MESA_FORMAT_SIGNED_AL88:
+ case MESA_FORMAT_L8A8_SNORM:
return PIPE_FORMAT_L8A8_SNORM;
- case MESA_FORMAT_SIGNED_I8:
+ case MESA_FORMAT_I_SNORM8:
return PIPE_FORMAT_I8_SNORM;
- case MESA_FORMAT_SIGNED_R16:
+ case MESA_FORMAT_R_SNORM16:
return PIPE_FORMAT_R16_SNORM;
- case MESA_FORMAT_SIGNED_GR1616:
+ case MESA_FORMAT_R16G16_SNORM:
return PIPE_FORMAT_R16G16_SNORM;
- case MESA_FORMAT_SIGNED_RGBA_16:
+ case MESA_FORMAT_RGBA_SNORM16:
return PIPE_FORMAT_R16G16B16A16_SNORM;
- case MESA_FORMAT_SIGNED_A16:
+ case MESA_FORMAT_A_SNORM16:
return PIPE_FORMAT_A16_SNORM;
- case MESA_FORMAT_SIGNED_L16:
+ case MESA_FORMAT_L_SNORM16:
return PIPE_FORMAT_L16_SNORM;
- case MESA_FORMAT_SIGNED_AL1616:
+ case MESA_FORMAT_LA_SNORM16:
return PIPE_FORMAT_L16A16_SNORM;
- case MESA_FORMAT_SIGNED_I16:
+ case MESA_FORMAT_I_SNORM16:
return PIPE_FORMAT_I16_SNORM;
- case MESA_FORMAT_RGB9_E5_FLOAT:
+ case MESA_FORMAT_R9G9B9E5_FLOAT:
return PIPE_FORMAT_R9G9B9E5_FLOAT;
- case MESA_FORMAT_R11_G11_B10_FLOAT:
+ case MESA_FORMAT_R11G11B10_FLOAT:
return PIPE_FORMAT_R11G11B10_FLOAT;
- case MESA_FORMAT_ARGB2101010_UINT:
+ case MESA_FORMAT_B10G10R10A2_UINT:
return PIPE_FORMAT_B10G10R10A2_UINT;
+ case MESA_FORMAT_R10G10B10A2_UINT:
+ return PIPE_FORMAT_R10G10B10A2_UINT;
- case MESA_FORMAT_XRGB4444_UNORM:
+ case MESA_FORMAT_B4G4R4X4_UNORM:
return PIPE_FORMAT_B4G4R4X4_UNORM;
- case MESA_FORMAT_XRGB1555_UNORM:
+ case MESA_FORMAT_B5G5R5X1_UNORM:
return PIPE_FORMAT_B5G5R5X1_UNORM;
- case MESA_FORMAT_XBGR8888_SNORM:
+ case MESA_FORMAT_R8G8B8X8_SNORM:
return PIPE_FORMAT_R8G8B8X8_SNORM;
- case MESA_FORMAT_XBGR8888_SRGB:
+ case MESA_FORMAT_R8G8B8X8_SRGB:
return PIPE_FORMAT_R8G8B8X8_SRGB;
- case MESA_FORMAT_XBGR8888_UINT:
+ case MESA_FORMAT_RGBX_UINT8:
return PIPE_FORMAT_R8G8B8X8_UINT;
- case MESA_FORMAT_XBGR8888_SINT:
+ case MESA_FORMAT_RGBX_SINT8:
return PIPE_FORMAT_R8G8B8X8_SINT;
- case MESA_FORMAT_XRGB2101010_UNORM:
+ case MESA_FORMAT_B10G10R10X2_UNORM:
return PIPE_FORMAT_B10G10R10X2_UNORM;
- case MESA_FORMAT_XBGR16161616_UNORM:
+ case MESA_FORMAT_RGBX_UNORM16:
return PIPE_FORMAT_R16G16B16X16_UNORM;
- case MESA_FORMAT_XBGR16161616_SNORM:
+ case MESA_FORMAT_RGBX_SNORM16:
return PIPE_FORMAT_R16G16B16X16_SNORM;
- case MESA_FORMAT_XBGR16161616_FLOAT:
+ case MESA_FORMAT_RGBX_FLOAT16:
return PIPE_FORMAT_R16G16B16X16_FLOAT;
- case MESA_FORMAT_XBGR16161616_UINT:
+ case MESA_FORMAT_RGBX_UINT16:
return PIPE_FORMAT_R16G16B16X16_UINT;
- case MESA_FORMAT_XBGR16161616_SINT:
+ case MESA_FORMAT_RGBX_SINT16:
return PIPE_FORMAT_R16G16B16X16_SINT;
- case MESA_FORMAT_XBGR32323232_FLOAT:
+ case MESA_FORMAT_RGBX_FLOAT32:
return PIPE_FORMAT_R32G32B32X32_FLOAT;
- case MESA_FORMAT_XBGR32323232_UINT:
+ case MESA_FORMAT_RGBX_UINT32:
return PIPE_FORMAT_R32G32B32X32_UINT;
- case MESA_FORMAT_XBGR32323232_SINT:
+ case MESA_FORMAT_RGBX_SINT32:
return PIPE_FORMAT_R32G32B32X32_SINT;
default:
@@ -400,76 +402,76 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
/**
* Translate Gallium format to Mesa format.
*/
-gl_format
+mesa_format
st_pipe_format_to_mesa_format(enum pipe_format format)
{
switch (format) {
case PIPE_FORMAT_ABGR8888_UNORM:
- return MESA_FORMAT_RGBA8888;
+ return MESA_FORMAT_A8B8G8R8_UNORM;
case PIPE_FORMAT_RGBA8888_UNORM:
- return MESA_FORMAT_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_UNORM;
case PIPE_FORMAT_BGRA8888_UNORM:
- return MESA_FORMAT_ARGB8888;
+ return MESA_FORMAT_B8G8R8A8_UNORM;
case PIPE_FORMAT_ARGB8888_UNORM:
- return MESA_FORMAT_ARGB8888_REV;
+ return MESA_FORMAT_A8R8G8B8_UNORM;
case PIPE_FORMAT_XBGR8888_UNORM:
- return MESA_FORMAT_RGBX8888;
+ return MESA_FORMAT_X8B8G8R8_UNORM;
case PIPE_FORMAT_RGBX8888_UNORM:
- return MESA_FORMAT_RGBX8888_REV;
+ return MESA_FORMAT_R8G8B8X8_UNORM;
case PIPE_FORMAT_BGRX8888_UNORM:
- return MESA_FORMAT_XRGB8888;
+ return MESA_FORMAT_B8G8R8X8_UNORM;
case PIPE_FORMAT_XRGB8888_UNORM:
- return MESA_FORMAT_XRGB8888_REV;
+ return MESA_FORMAT_X8R8G8B8_UNORM;
case PIPE_FORMAT_B5G5R5A1_UNORM:
- return MESA_FORMAT_ARGB1555;
+ return MESA_FORMAT_B5G5R5A1_UNORM;
case PIPE_FORMAT_B4G4R4A4_UNORM:
- return MESA_FORMAT_ARGB4444;
+ return MESA_FORMAT_B4G4R4A4_UNORM;
case PIPE_FORMAT_B5G6R5_UNORM:
- return MESA_FORMAT_RGB565;
+ return MESA_FORMAT_B5G6R5_UNORM;
case PIPE_FORMAT_B2G3R3_UNORM:
- return MESA_FORMAT_RGB332;
+ return MESA_FORMAT_B2G3R3_UNORM;
case PIPE_FORMAT_B10G10R10A2_UNORM:
- return MESA_FORMAT_ARGB2101010;
+ return MESA_FORMAT_B10G10R10A2_UNORM;
case PIPE_FORMAT_L4A4_UNORM:
- return MESA_FORMAT_AL44;
+ return MESA_FORMAT_L4A4_UNORM;
case PIPE_FORMAT_L8A8_UNORM:
- return MESA_FORMAT_AL88;
+ return MESA_FORMAT_L8A8_UNORM;
case PIPE_FORMAT_L16A16_UNORM:
- return MESA_FORMAT_AL1616;
+ return MESA_FORMAT_L16A16_UNORM;
case PIPE_FORMAT_A8_UNORM:
- return MESA_FORMAT_A8;
+ return MESA_FORMAT_A_UNORM8;
case PIPE_FORMAT_A16_UNORM:
- return MESA_FORMAT_A16;
+ return MESA_FORMAT_A_UNORM16;
case PIPE_FORMAT_L8_UNORM:
- return MESA_FORMAT_L8;
+ return MESA_FORMAT_L_UNORM8;
case PIPE_FORMAT_L16_UNORM:
- return MESA_FORMAT_L16;
+ return MESA_FORMAT_L_UNORM16;
case PIPE_FORMAT_I8_UNORM:
- return MESA_FORMAT_I8;
+ return MESA_FORMAT_I_UNORM8;
case PIPE_FORMAT_I16_UNORM:
- return MESA_FORMAT_I16;
+ return MESA_FORMAT_I_UNORM16;
case PIPE_FORMAT_S8_UINT:
- return MESA_FORMAT_S8;
+ return MESA_FORMAT_S_UINT8;
case PIPE_FORMAT_R16G16B16A16_UNORM:
- return MESA_FORMAT_RGBA_16;
+ return MESA_FORMAT_RGBA_UNORM16;
case PIPE_FORMAT_Z16_UNORM:
- return MESA_FORMAT_Z16;
+ return MESA_FORMAT_Z_UNORM16;
case PIPE_FORMAT_Z32_UNORM:
- return MESA_FORMAT_Z32;
+ return MESA_FORMAT_Z_UNORM32;
case PIPE_FORMAT_S8_UINT_Z24_UNORM:
- return MESA_FORMAT_Z24_S8;
+ return MESA_FORMAT_S8_UINT_Z24_UNORM;
case PIPE_FORMAT_X8Z24_UNORM:
- return MESA_FORMAT_Z24_X8;
+ return MESA_FORMAT_X8Z24_UNORM;
case PIPE_FORMAT_Z24X8_UNORM:
- return MESA_FORMAT_X8_Z24;
+ return MESA_FORMAT_Z24_UNORM_S8_UINT;
case PIPE_FORMAT_Z24_UNORM_S8_UINT:
- return MESA_FORMAT_S8_Z24;
+ return MESA_FORMAT_Z24_UNORM_X8_UINT;
case PIPE_FORMAT_Z32_FLOAT:
- return MESA_FORMAT_Z32_FLOAT;
+ return MESA_FORMAT_Z_FLOAT32;
case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
- return MESA_FORMAT_Z32_FLOAT_X24S8;
+ return MESA_FORMAT_Z32_FLOAT_S8X24_UINT;
case PIPE_FORMAT_UYVY:
return MESA_FORMAT_YCBCR;
@@ -493,15 +495,15 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
case PIPE_FORMAT_DXT5_SRGBA:
return MESA_FORMAT_SRGBA_DXT5;
case PIPE_FORMAT_L8A8_SRGB:
- return MESA_FORMAT_SLA8;
+ return MESA_FORMAT_L8A8_SRGB;
case PIPE_FORMAT_L8_SRGB:
- return MESA_FORMAT_SL8;
+ return MESA_FORMAT_L_SRGB8;
case PIPE_FORMAT_R8G8B8_SRGB:
- return MESA_FORMAT_SRGB8;
+ return MESA_FORMAT_BGR_SRGB8;
case PIPE_FORMAT_A8B8G8R8_SRGB:
- return MESA_FORMAT_SRGBA8;
+ return MESA_FORMAT_A8B8G8R8_SRGB;
case PIPE_FORMAT_B8G8R8A8_SRGB:
- return MESA_FORMAT_SARGB8;
+ return MESA_FORMAT_B8G8R8A8_SRGB;
case PIPE_FORMAT_R32G32B32A32_FLOAT:
return MESA_FORMAT_RGBA_FLOAT32;
case PIPE_FORMAT_R16G16B16A16_FLOAT:
@@ -511,21 +513,21 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
case PIPE_FORMAT_R16G16B16_FLOAT:
return MESA_FORMAT_RGB_FLOAT16;
case PIPE_FORMAT_L32A32_FLOAT:
- return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32;
+ return MESA_FORMAT_LA_FLOAT32;
case PIPE_FORMAT_L16A16_FLOAT:
- return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16;
+ return MESA_FORMAT_LA_FLOAT16;
case PIPE_FORMAT_L32_FLOAT:
- return MESA_FORMAT_LUMINANCE_FLOAT32;
+ return MESA_FORMAT_L_FLOAT32;
case PIPE_FORMAT_L16_FLOAT:
- return MESA_FORMAT_LUMINANCE_FLOAT16;
+ return MESA_FORMAT_L_FLOAT16;
case PIPE_FORMAT_A32_FLOAT:
- return MESA_FORMAT_ALPHA_FLOAT32;
+ return MESA_FORMAT_A_FLOAT32;
case PIPE_FORMAT_A16_FLOAT:
- return MESA_FORMAT_ALPHA_FLOAT16;
+ return MESA_FORMAT_A_FLOAT16;
case PIPE_FORMAT_I32_FLOAT:
- return MESA_FORMAT_INTENSITY_FLOAT32;
+ return MESA_FORMAT_I_FLOAT32;
case PIPE_FORMAT_I16_FLOAT:
- return MESA_FORMAT_INTENSITY_FLOAT16;
+ return MESA_FORMAT_I_FLOAT16;
case PIPE_FORMAT_R32_FLOAT:
return MESA_FORMAT_R_FLOAT32;
case PIPE_FORMAT_R16_FLOAT:
@@ -536,92 +538,92 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_RG_FLOAT16;
case PIPE_FORMAT_R8_UNORM:
- return MESA_FORMAT_R8;
+ return MESA_FORMAT_R_UNORM8;
case PIPE_FORMAT_R16_UNORM:
- return MESA_FORMAT_R16;
+ return MESA_FORMAT_R_UNORM16;
case PIPE_FORMAT_R8G8_UNORM:
- return MESA_FORMAT_GR88;
+ return MESA_FORMAT_R8G8_UNORM;
case PIPE_FORMAT_R16G16_UNORM:
- return MESA_FORMAT_GR1616;
+ return MESA_FORMAT_R16G16_UNORM;
case PIPE_FORMAT_A8_UINT:
- return MESA_FORMAT_ALPHA_UINT8;
+ return MESA_FORMAT_A_UINT8;
case PIPE_FORMAT_A16_UINT:
- return MESA_FORMAT_ALPHA_UINT16;
+ return MESA_FORMAT_A_UINT16;
case PIPE_FORMAT_A32_UINT:
- return MESA_FORMAT_ALPHA_UINT32;
+ return MESA_FORMAT_A_UINT32;
case PIPE_FORMAT_A8_SINT:
- return MESA_FORMAT_ALPHA_INT8;
+ return MESA_FORMAT_A_SINT8;
case PIPE_FORMAT_A16_SINT:
- return MESA_FORMAT_ALPHA_INT16;
+ return MESA_FORMAT_A_SINT16;
case PIPE_FORMAT_A32_SINT:
- return MESA_FORMAT_ALPHA_INT32;
+ return MESA_FORMAT_A_SINT32;
case PIPE_FORMAT_I8_UINT:
- return MESA_FORMAT_INTENSITY_UINT8;
+ return MESA_FORMAT_I_UINT8;
case PIPE_FORMAT_I16_UINT:
- return MESA_FORMAT_INTENSITY_UINT16;
+ return MESA_FORMAT_I_UINT16;
case PIPE_FORMAT_I32_UINT:
- return MESA_FORMAT_INTENSITY_UINT32;
+ return MESA_FORMAT_I_UINT32;
case PIPE_FORMAT_I8_SINT:
- return MESA_FORMAT_INTENSITY_INT8;
+ return MESA_FORMAT_I_SINT8;
case PIPE_FORMAT_I16_SINT:
- return MESA_FORMAT_INTENSITY_INT16;
+ return MESA_FORMAT_I_SINT16;
case PIPE_FORMAT_I32_SINT:
- return MESA_FORMAT_INTENSITY_INT32;
+ return MESA_FORMAT_I_SINT32;
case PIPE_FORMAT_L8_UINT:
- return MESA_FORMAT_LUMINANCE_UINT8;
+ return MESA_FORMAT_L_UINT8;
case PIPE_FORMAT_L16_UINT:
- return MESA_FORMAT_LUMINANCE_UINT16;
+ return MESA_FORMAT_L_UINT16;
case PIPE_FORMAT_L32_UINT:
- return MESA_FORMAT_LUMINANCE_UINT32;
+ return MESA_FORMAT_L_UINT32;
case PIPE_FORMAT_L8_SINT:
- return MESA_FORMAT_LUMINANCE_INT8;
+ return MESA_FORMAT_L_SINT8;
case PIPE_FORMAT_L16_SINT:
- return MESA_FORMAT_LUMINANCE_INT16;
+ return MESA_FORMAT_L_SINT16;
case PIPE_FORMAT_L32_SINT:
- return MESA_FORMAT_LUMINANCE_INT32;
+ return MESA_FORMAT_L_SINT32;
case PIPE_FORMAT_L8A8_UINT:
- return MESA_FORMAT_LUMINANCE_ALPHA_UINT8;
+ return MESA_FORMAT_LA_UINT8;
case PIPE_FORMAT_L16A16_UINT:
- return MESA_FORMAT_LUMINANCE_ALPHA_UINT16;
+ return MESA_FORMAT_LA_UINT16;
case PIPE_FORMAT_L32A32_UINT:
- return MESA_FORMAT_LUMINANCE_ALPHA_UINT32;
+ return MESA_FORMAT_LA_UINT32;
case PIPE_FORMAT_L8A8_SINT:
- return MESA_FORMAT_LUMINANCE_ALPHA_INT8;
+ return MESA_FORMAT_LA_SINT8;
case PIPE_FORMAT_L16A16_SINT:
- return MESA_FORMAT_LUMINANCE_ALPHA_INT16;
+ return MESA_FORMAT_LA_SINT16;
case PIPE_FORMAT_L32A32_SINT:
- return MESA_FORMAT_LUMINANCE_ALPHA_INT32;
+ return MESA_FORMAT_LA_SINT32;
case PIPE_FORMAT_R8_SINT:
- return MESA_FORMAT_R_INT8;
+ return MESA_FORMAT_R_SINT8;
case PIPE_FORMAT_R8G8_SINT:
- return MESA_FORMAT_RG_INT8;
+ return MESA_FORMAT_RG_SINT8;
case PIPE_FORMAT_R8G8B8_SINT:
- return MESA_FORMAT_RGB_INT8;
+ return MESA_FORMAT_RGB_SINT8;
case PIPE_FORMAT_R8G8B8A8_SINT:
- return MESA_FORMAT_RGBA_INT8;
+ return MESA_FORMAT_RGBA_SINT8;
case PIPE_FORMAT_R16_SINT:
- return MESA_FORMAT_R_INT16;
+ return MESA_FORMAT_R_SINT16;
case PIPE_FORMAT_R16G16_SINT:
- return MESA_FORMAT_RG_INT16;
+ return MESA_FORMAT_RG_SINT16;
case PIPE_FORMAT_R16G16B16_SINT:
- return MESA_FORMAT_RGB_INT16;
+ return MESA_FORMAT_RGB_SINT16;
case PIPE_FORMAT_R16G16B16A16_SINT:
- return MESA_FORMAT_RGBA_INT16;
+ return MESA_FORMAT_RGBA_SINT16;
case PIPE_FORMAT_R32_SINT:
- return MESA_FORMAT_R_INT32;
+ return MESA_FORMAT_R_SINT32;
case PIPE_FORMAT_R32G32_SINT:
- return MESA_FORMAT_RG_INT32;
+ return MESA_FORMAT_RG_SINT32;
case PIPE_FORMAT_R32G32B32_SINT:
- return MESA_FORMAT_RGB_INT32;
+ return MESA_FORMAT_RGB_SINT32;
case PIPE_FORMAT_R32G32B32A32_SINT:
- return MESA_FORMAT_RGBA_INT32;
+ return MESA_FORMAT_RGBA_SINT32;
/* unsigned int formats */
case PIPE_FORMAT_R8_UINT:
@@ -652,97 +654,99 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
return MESA_FORMAT_RGBA_UINT32;
case PIPE_FORMAT_RGTC1_UNORM:
- return MESA_FORMAT_RED_RGTC1;
+ return MESA_FORMAT_R_RGTC1_UNORM;
case PIPE_FORMAT_RGTC1_SNORM:
- return MESA_FORMAT_SIGNED_RED_RGTC1;
+ return MESA_FORMAT_R_RGTC1_SNORM;
case PIPE_FORMAT_RGTC2_UNORM:
- return MESA_FORMAT_RG_RGTC2;
+ return MESA_FORMAT_RG_RGTC2_UNORM;
case PIPE_FORMAT_RGTC2_SNORM:
- return MESA_FORMAT_SIGNED_RG_RGTC2;
+ return MESA_FORMAT_RG_RGTC2_SNORM;
case PIPE_FORMAT_LATC1_UNORM:
- return MESA_FORMAT_L_LATC1;
+ return MESA_FORMAT_L_LATC1_UNORM;
case PIPE_FORMAT_LATC1_SNORM:
- return MESA_FORMAT_SIGNED_L_LATC1;
+ return MESA_FORMAT_L_LATC1_SNORM;
case PIPE_FORMAT_LATC2_UNORM:
- return MESA_FORMAT_LA_LATC2;
+ return MESA_FORMAT_LA_LATC2_UNORM;
case PIPE_FORMAT_LATC2_SNORM:
- return MESA_FORMAT_SIGNED_LA_LATC2;
+ return MESA_FORMAT_LA_LATC2_SNORM;
case PIPE_FORMAT_ETC1_RGB8:
return MESA_FORMAT_ETC1_RGB8;
/* signed normalized formats */
case PIPE_FORMAT_R8_SNORM:
- return MESA_FORMAT_SIGNED_R8;
+ return MESA_FORMAT_R_SNORM8;
case PIPE_FORMAT_R8G8_SNORM:
- return MESA_FORMAT_SIGNED_RG88_REV;
+ return MESA_FORMAT_R8G8_SNORM;
case PIPE_FORMAT_R8G8B8A8_SNORM:
- return MESA_FORMAT_SIGNED_RGBA8888_REV;
+ return MESA_FORMAT_R8G8B8A8_SNORM;
case PIPE_FORMAT_A8_SNORM:
- return MESA_FORMAT_SIGNED_A8;
+ return MESA_FORMAT_A_SNORM8;
case PIPE_FORMAT_L8_SNORM:
- return MESA_FORMAT_SIGNED_L8;
+ return MESA_FORMAT_L_SNORM8;
case PIPE_FORMAT_L8A8_SNORM:
- return MESA_FORMAT_SIGNED_AL88;
+ return MESA_FORMAT_L8A8_SNORM;
case PIPE_FORMAT_I8_SNORM:
- return MESA_FORMAT_SIGNED_I8;
+ return MESA_FORMAT_I_SNORM8;
case PIPE_FORMAT_R16_SNORM:
- return MESA_FORMAT_SIGNED_R16;
+ return MESA_FORMAT_R_SNORM16;
case PIPE_FORMAT_R16G16_SNORM:
- return MESA_FORMAT_SIGNED_GR1616;
+ return MESA_FORMAT_R16G16_SNORM;
case PIPE_FORMAT_R16G16B16A16_SNORM:
- return MESA_FORMAT_SIGNED_RGBA_16;
+ return MESA_FORMAT_RGBA_SNORM16;
case PIPE_FORMAT_A16_SNORM:
- return MESA_FORMAT_SIGNED_A16;
+ return MESA_FORMAT_A_SNORM16;
case PIPE_FORMAT_L16_SNORM:
- return MESA_FORMAT_SIGNED_L16;
+ return MESA_FORMAT_L_SNORM16;
case PIPE_FORMAT_L16A16_SNORM:
- return MESA_FORMAT_SIGNED_AL1616;
+ return MESA_FORMAT_LA_SNORM16;
case PIPE_FORMAT_I16_SNORM:
- return MESA_FORMAT_SIGNED_I16;
+ return MESA_FORMAT_I_SNORM16;
case PIPE_FORMAT_R9G9B9E5_FLOAT:
- return MESA_FORMAT_RGB9_E5_FLOAT;
+ return MESA_FORMAT_R9G9B9E5_FLOAT;
case PIPE_FORMAT_R11G11B10_FLOAT:
- return MESA_FORMAT_R11_G11_B10_FLOAT;
+ return MESA_FORMAT_R11G11B10_FLOAT;
case PIPE_FORMAT_B10G10R10A2_UINT:
- return MESA_FORMAT_ARGB2101010_UINT;
+ return MESA_FORMAT_B10G10R10A2_UINT;
+ case PIPE_FORMAT_R10G10B10A2_UINT:
+ return MESA_FORMAT_R10G10B10A2_UINT;
case PIPE_FORMAT_B4G4R4X4_UNORM:
- return MESA_FORMAT_XRGB4444_UNORM;
+ return MESA_FORMAT_B4G4R4X4_UNORM;
case PIPE_FORMAT_B5G5R5X1_UNORM:
- return MESA_FORMAT_XRGB1555_UNORM;
+ return MESA_FORMAT_B5G5R5X1_UNORM;
case PIPE_FORMAT_R8G8B8X8_SNORM:
- return MESA_FORMAT_XBGR8888_SNORM;
+ return MESA_FORMAT_R8G8B8X8_SNORM;
case PIPE_FORMAT_R8G8B8X8_SRGB:
- return MESA_FORMAT_XBGR8888_SRGB;
+ return MESA_FORMAT_R8G8B8X8_SRGB;
case PIPE_FORMAT_R8G8B8X8_UINT:
- return MESA_FORMAT_XBGR8888_UINT;
+ return MESA_FORMAT_RGBX_UINT8;
case PIPE_FORMAT_R8G8B8X8_SINT:
- return MESA_FORMAT_XBGR8888_SINT;
+ return MESA_FORMAT_RGBX_SINT8;
case PIPE_FORMAT_B10G10R10X2_UNORM:
- return MESA_FORMAT_XRGB2101010_UNORM;
+ return MESA_FORMAT_B10G10R10X2_UNORM;
case PIPE_FORMAT_R16G16B16X16_UNORM:
- return MESA_FORMAT_XBGR16161616_UNORM;
+ return MESA_FORMAT_RGBX_UNORM16;
case PIPE_FORMAT_R16G16B16X16_SNORM:
- return MESA_FORMAT_XBGR16161616_SNORM;
+ return MESA_FORMAT_RGBX_SNORM16;
case PIPE_FORMAT_R16G16B16X16_FLOAT:
- return MESA_FORMAT_XBGR16161616_FLOAT;
+ return MESA_FORMAT_RGBX_FLOAT16;
case PIPE_FORMAT_R16G16B16X16_UINT:
- return MESA_FORMAT_XBGR16161616_UINT;
+ return MESA_FORMAT_RGBX_UINT16;
case PIPE_FORMAT_R16G16B16X16_SINT:
- return MESA_FORMAT_XBGR16161616_SINT;
+ return MESA_FORMAT_RGBX_SINT16;
case PIPE_FORMAT_R32G32B32X32_FLOAT:
- return MESA_FORMAT_XBGR32323232_FLOAT;
+ return MESA_FORMAT_RGBX_FLOAT32;
case PIPE_FORMAT_R32G32B32X32_UINT:
- return MESA_FORMAT_XBGR32323232_UINT;
+ return MESA_FORMAT_RGBX_UINT32;
case PIPE_FORMAT_R32G32B32X32_SINT:
- return MESA_FORMAT_XBGR32323232_SINT;
+ return MESA_FORMAT_RGBX_SINT32;
default:
assert(0);
@@ -1483,7 +1487,7 @@ static const struct format_mapping format_map[] = {
},
{
{ GL_RGB10_A2UI, 0 },
- { PIPE_FORMAT_B10G10R10A2_UINT, 0 }
+ { PIPE_FORMAT_R10G10B10A2_UINT, PIPE_FORMAT_B10G10R10A2_UINT, 0 }
},
};
@@ -1687,7 +1691,7 @@ enum pipe_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) {
@@ -1714,7 +1718,7 @@ st_choose_matching_format(struct pipe_screen *screen, unsigned bind,
/**
* Called via ctx->Driver.ChooseTextureFormat().
*/
-gl_format
+mesa_format
st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
GLint internalFormat,
GLenum format, GLenum type)
diff --git a/mesalib/src/mesa/state_tracker/st_format.h b/mesalib/src/mesa/state_tracker/st_format.h
index bf042ede1..ce1e2306d 100644
--- a/mesalib/src/mesa/state_tracker/st_format.h
+++ b/mesalib/src/mesa/state_tracker/st_format.h
@@ -41,9 +41,9 @@ struct pipe_screen;
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);
@@ -61,7 +61,7 @@ extern enum pipe_format
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);
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 0871dd064..610fc68a8 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5027,6 +5027,8 @@ shader_stage_to_ptarget(gl_shader_stage stage)
return PIPE_SHADER_FRAGMENT;
case MESA_SHADER_GEOMETRY:
return PIPE_SHADER_GEOMETRY;
+ case MESA_SHADER_COMPUTE:
+ return PIPE_SHADER_COMPUTE;
}
assert(!"should not be reached");
diff --git a/mesalib/src/mesa/state_tracker/st_manager.c b/mesalib/src/mesa/state_tracker/st_manager.c
index 8158450dc..215b27634 100644
--- a/mesalib/src/mesa/state_tracker/st_manager.c
+++ b/mesalib/src/mesa/state_tracker/st_manager.c
@@ -469,7 +469,6 @@ st_context_teximage(struct st_context_iface *stctxi,
{
struct st_context *st = (struct st_context *) stctxi;
struct gl_context *ctx = st->ctx;
- struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx);
struct gl_texture_object *texObj;
struct gl_texture_image *texImage;
struct st_texture_object *stObj;
@@ -495,7 +494,8 @@ st_context_teximage(struct st_context_iface *stctxi,
return FALSE;
}
- texObj = _mesa_select_tex_object(ctx, texUnit, target);
+ texObj = _mesa_get_current_tex_object(ctx, target);
+
_mesa_lock_texture(ctx, texObj);
stObj = st_texture_object(texObj);
@@ -508,7 +508,7 @@ st_context_teximage(struct st_context_iface *stctxi,
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;
diff --git a/mesalib/src/mesa/state_tracker/st_program.c b/mesalib/src/mesa/state_tracker/st_program.c
index 7a15b23fa..cadbe1705 100644
--- a/mesalib/src/mesa/state_tracker/st_program.c
+++ b/mesalib/src/mesa/state_tracker/st_program.c
@@ -944,17 +944,16 @@ st_translate_geometry_program(struct st_context *st,
case VARYING_SLOT_TEX5:
case VARYING_SLOT_TEX6:
case VARYING_SLOT_TEX7:
- stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ stgp->input_semantic_name[slot] = st->needs_texcoord_semantic ?
+ TGSI_SEMANTIC_TEXCOORD : TGSI_SEMANTIC_GENERIC;
stgp->input_semantic_index[slot] = (attr - VARYING_SLOT_TEX0);
break;
case VARYING_SLOT_VAR0:
default:
assert(attr >= VARYING_SLOT_VAR0 && attr < VARYING_SLOT_MAX);
stgp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stgp->input_semantic_index[slot] = (VARYING_SLOT_VAR0 -
- VARYING_SLOT_TEX0 +
- attr -
- VARYING_SLOT_VAR0);
+ stgp->input_semantic_index[slot] = st->needs_texcoord_semantic ?
+ (attr - VARYING_SLOT_VAR0) : (attr - VARYING_SLOT_TEX0);
break;
}
}
@@ -1036,7 +1035,8 @@ st_translate_geometry_program(struct st_context *st,
case VARYING_SLOT_TEX5:
case VARYING_SLOT_TEX6:
case VARYING_SLOT_TEX7:
- gs_output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
+ gs_output_semantic_name[slot] = st->needs_texcoord_semantic ?
+ TGSI_SEMANTIC_TEXCOORD : TGSI_SEMANTIC_GENERIC;
gs_output_semantic_index[slot] = (attr - VARYING_SLOT_TEX0);
break;
case VARYING_SLOT_VAR0:
@@ -1044,10 +1044,9 @@ st_translate_geometry_program(struct st_context *st,
assert(slot < Elements(gs_output_semantic_name));
assert(attr >= VARYING_SLOT_VAR0);
gs_output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- gs_output_semantic_index[slot] = (VARYING_SLOT_VAR0 -
- VARYING_SLOT_TEX0 +
- attr -
- VARYING_SLOT_VAR0);
+ gs_output_semantic_index[slot] = st->needs_texcoord_semantic ?
+ (attr - VARYING_SLOT_VAR0) : (attr - VARYING_SLOT_TEX0);
+ break;
}
}
}
diff --git a/mesalib/src/mesa/state_tracker/st_vdpau.c b/mesalib/src/mesa/state_tracker/st_vdpau.c
index 9b165ee39..c5b4780ce 100644
--- a/mesalib/src/mesa/state_tracker/st_vdpau.c
+++ b/mesalib/src/mesa/state_tracker/st_vdpau.c
@@ -47,6 +47,7 @@
#include "st_context.h"
#include "st_texture.h"
#include "st_format.h"
+#include "st_cb_flush.h"
static void
st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
@@ -63,7 +64,7 @@ st_vdpau_map_surface(struct gl_context *ctx, GLenum target, GLenum access,
struct pipe_resource *res;
struct pipe_sampler_view *sv, templ;
- gl_format texFormat;
+ mesa_format texFormat;
getProcAddr = ctx->vdpGetProcAddress;
if (output) {
@@ -163,6 +164,7 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
struct gl_texture_image *texImage,
const GLvoid *vdpSurface, GLuint index)
{
+ struct st_context *st = st_context(ctx);
struct st_texture_object *stObj = st_texture_object(texObj);
struct st_texture_image *stImage = st_texture_image(texImage);
@@ -171,6 +173,8 @@ st_vdpau_unmap_surface(struct gl_context *ctx, GLenum target, GLenum access,
pipe_resource_reference(&stImage->pt, NULL);
_mesa_dirty_texobj(ctx, texObj);
+
+ st_flush(st, NULL, 0);
}
void