aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/get.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-01-10 23:39:19 +0100
committermarha <marha@users.sourceforge.net>2014-01-10 23:39:19 +0100
commitaaeb8bf497c82efabc4f9b27c319042c0e72d816 (patch)
tree0df2c4a5b027a07dd1e3bf8707c72f25fe71b4f1 /mesalib/src/mesa/main/get.c
parentbe6e384aa4b97dc81b88ab5b04328c161828e760 (diff)
downloadvcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.tar.gz
vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.tar.bz2
vcxsrv-aaeb8bf497c82efabc4f9b27c319042c0e72d816.zip
randrproto libfontenc mesa xserver git update 10 Jan 2014
xserver commit a92c6406e7f6c0b74fb1cb9361ad904facc0f722 libfontenc commit 0037a42107b952c9d903719615747e760e4e7247 randrproto commit 1755cbe0f501a86afe515f92bb24e417a1866092 mesa commit 532b1fecd93fd30d3b1b101b55fd2c6e074088ad
Diffstat (limited to 'mesalib/src/mesa/main/get.c')
-rw-r--r--mesalib/src/mesa/main/get.c55
1 files changed, 50 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 691380898..6e55e9956 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -327,6 +327,12 @@ static const int extra_EXT_framebuffer_sRGB_and_new_buffers[] = {
EXTRA_END
};
+static const int extra_EXT_packed_float[] = {
+ EXT(EXT_packed_float),
+ EXTRA_NEW_BUFFERS,
+ EXTRA_END
+};
+
static const int extra_EXT_texture_array_es3[] = {
EXT(EXT_texture_array),
EXTRA_API_ES3,
@@ -757,6 +763,45 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
ctx->Texture.Unit[unit].CurrentTex[d->offset]->Name;
break;
+ /* GL_EXT_packed_float */
+ case GL_RGBA_SIGNED_COMPONENTS_EXT:
+ {
+ /* Note: we only check the 0th color attachment. */
+ const struct gl_renderbuffer *rb =
+ ctx->DrawBuffer->_ColorDrawBuffers[0];
+ if (rb && _mesa_is_format_signed(rb->Format)) {
+ /* Issue 17 of GL_EXT_packed_float: If a component (such as
+ * alpha) has zero bits, the component should not be considered
+ * signed and so the bit for the respective component should be
+ * zeroed.
+ */
+ GLint r_bits =
+ _mesa_get_format_bits(rb->Format, GL_RED_BITS);
+ GLint g_bits =
+ _mesa_get_format_bits(rb->Format, GL_GREEN_BITS);
+ GLint b_bits =
+ _mesa_get_format_bits(rb->Format, GL_BLUE_BITS);
+ GLint a_bits =
+ _mesa_get_format_bits(rb->Format, GL_ALPHA_BITS);
+ GLint l_bits =
+ _mesa_get_format_bits(rb->Format, GL_TEXTURE_LUMINANCE_SIZE);
+ GLint i_bits =
+ _mesa_get_format_bits(rb->Format, GL_TEXTURE_INTENSITY_SIZE);
+
+ v->value_int_4[0] = r_bits + l_bits + i_bits > 0;
+ v->value_int_4[1] = g_bits + l_bits + i_bits > 0;
+ v->value_int_4[2] = b_bits + l_bits + i_bits > 0;
+ v->value_int_4[3] = a_bits + i_bits > 0;
+ }
+ else {
+ v->value_int_4[0] =
+ v->value_int_4[1] =
+ v->value_int_4[2] =
+ v->value_int_4[3] = 0;
+ }
+ }
+ break;
+
/* GL_ARB_vertex_buffer_object */
case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB:
case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB:
@@ -849,11 +894,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_float = ctx->Color.AlphaRefUnclamped;
break;
case GL_MAX_VERTEX_UNIFORM_VECTORS:
- v->value_int = ctx->Const.VertexProgram.MaxUniformComponents / 4;
+ v->value_int = ctx->Const.Program[MESA_SHADER_VERTEX].MaxUniformComponents / 4;
break;
case GL_MAX_FRAGMENT_UNIFORM_VECTORS:
- v->value_int = ctx->Const.FragmentProgram.MaxUniformComponents / 4;
+ v->value_int = ctx->Const.Program[MESA_SHADER_FRAGMENT].MaxUniformComponents / 4;
break;
/* GL_ARB_texture_buffer_object */
@@ -1747,7 +1792,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
case GL_VERTEX_BINDING_DIVISOR:
if (!_mesa_is_desktop_gl(ctx) || !ctx->Extensions.ARB_instanced_arrays)
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].InstanceDivisor;
return TYPE_INT;
@@ -1755,7 +1800,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
case GL_VERTEX_BINDING_OFFSET:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Offset;
return TYPE_INT;
@@ -1763,7 +1808,7 @@ find_value_indexed(const char *func, GLenum pname, GLuint index, union value *v)
case GL_VERTEX_BINDING_STRIDE:
if (!_mesa_is_desktop_gl(ctx))
goto invalid_enum;
- if (index >= ctx->Const.VertexProgram.MaxAttribs)
+ if (index >= ctx->Const.Program[MESA_SHADER_VERTEX].MaxAttribs)
goto invalid_value;
v->value_int = ctx->Array.ArrayObj->VertexBinding[VERT_ATTRIB_GENERIC(index)].Stride;
return TYPE_INT;