aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawpixels.c8
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c19
-rw-r--r--mesalib/src/mesa/state_tracker/st_format.c24
3 files changed, 51 insertions, 0 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
index f159ed2db..9cc40c3d9 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -372,6 +372,14 @@ internal_format(struct gl_context *ctx, GLenum format, GLenum type)
return
ctx->Extensions.ARB_texture_float ? GL_RGBA32F :
ctx->Extensions.EXT_texture_snorm ? GL_RGBA16_SNORM : GL_RGBA16;
+
+ case GL_UNSIGNED_INT_5_9_9_9_REV:
+ assert(ctx->Extensions.EXT_texture_shared_exponent);
+ return GL_RGB9_E5;
+
+ case GL_UNSIGNED_INT_10F_11F_11F_REV:
+ assert(ctx->Extensions.EXT_packed_float);
+ return GL_R11F_G11F_B10F;
}
}
}
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index 8f697fa51..0c5e1991c 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -515,6 +515,12 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.ARB_half_float_vertex = GL_TRUE;
}
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R32G32B32A32_FIXED,
+ PIPE_BUFFER, 0,
+ PIPE_BIND_VERTEX_BUFFER)) {
+ ctx->Extensions.ARB_ES2_compatibility = GL_TRUE;
+ }
+
if (screen->get_shader_param(screen, PIPE_SHADER_GEOMETRY, PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) {
#if 0 /* XXX re-enable when GLSL compiler again supports geometry shaders */
ctx->Extensions.ARB_geometry_shader4 = GL_TRUE;
@@ -576,4 +582,17 @@ void st_init_extensions(struct st_context *st)
if (st->pipe->texture_barrier) {
ctx->Extensions.NV_texture_barrier = GL_TRUE;
}
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE;
+ }
+
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT,
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET |
+ PIPE_BIND_SAMPLER_VIEW)) {
+ ctx->Extensions.EXT_packed_float = GL_TRUE;
+ }
}
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c
index 32b44b806..8568c68e1 100644
--- a/mesalib/src/mesa/state_tracker/st_format.c
+++ b/mesalib/src/mesa/state_tracker/st_format.c
@@ -325,6 +325,11 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat)
case MESA_FORMAT_SIGNED_I16:
return PIPE_FORMAT_I16_SNORM;
+ case MESA_FORMAT_RGB9_E5_FLOAT:
+ return PIPE_FORMAT_R9G9B9E5_FLOAT;
+ case MESA_FORMAT_R11_G11_B10_FLOAT:
+ return PIPE_FORMAT_R11G11B10_FLOAT;
+
default:
assert(0);
return PIPE_FORMAT_NONE;
@@ -545,6 +550,11 @@ st_pipe_format_to_mesa_format(enum pipe_format format)
case PIPE_FORMAT_I16_SNORM:
return MESA_FORMAT_SIGNED_I16;
+ case PIPE_FORMAT_R9G9B9E5_FLOAT:
+ return MESA_FORMAT_RGB9_E5_FLOAT;
+ case PIPE_FORMAT_R11G11B10_FLOAT:
+ return MESA_FORMAT_R11_G11_B10_FLOAT;
+
default:
assert(0);
return MESA_FORMAT_NONE;
@@ -1483,6 +1493,20 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat,
target, sample_count, bindings);
}
+ case GL_RGB9_E5:
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R9G9B9E5_FLOAT, target,
+ sample_count, bindings)) {
+ return PIPE_FORMAT_R9G9B9E5_FLOAT;
+ }
+ return PIPE_FORMAT_NONE;
+
+ case GL_R11F_G11F_B10F:
+ if (screen->is_format_supported(screen, PIPE_FORMAT_R11G11B10_FLOAT, target,
+ sample_count, bindings)) {
+ return PIPE_FORMAT_R11G11B10_FLOAT;
+ }
+ return PIPE_FORMAT_NONE;
+
default:
return PIPE_FORMAT_NONE;
}