aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main')
-rw-r--r--mesalib/src/mesa/main/api_validate.c53
-rw-r--r--mesalib/src/mesa/main/dd.h3
-rw-r--r--mesalib/src/mesa/main/fbobject.c1
-rw-r--r--mesalib/src/mesa/main/imports.c3
-rw-r--r--mesalib/src/mesa/main/macros.h36
-rw-r--r--mesalib/src/mesa/main/shaderapi.c6
-rw-r--r--mesalib/src/mesa/main/texgetimage.c2
-rw-r--r--mesalib/src/mesa/main/texgetimage.h3
-rw-r--r--mesalib/src/mesa/main/texstore.c1
9 files changed, 80 insertions, 28 deletions
diff --git a/mesalib/src/mesa/main/api_validate.c b/mesalib/src/mesa/main/api_validate.c
index 002992186..f285c9748 100644
--- a/mesalib/src/mesa/main/api_validate.c
+++ b/mesalib/src/mesa/main/api_validate.c
@@ -330,26 +330,43 @@ _mesa_valid_prim_mode(struct gl_context *ctx, GLenum mode, const char *name)
if (_mesa_is_xfb_active_and_unpaused(ctx)) {
GLboolean pass = GL_TRUE;
- switch (mode) {
- case GL_POINTS:
- pass = ctx->TransformFeedback.Mode == GL_POINTS;
- break;
- case GL_LINES:
- case GL_LINE_STRIP:
- case GL_LINE_LOOP:
- pass = ctx->TransformFeedback.Mode == GL_LINES;
- break;
- default:
- pass = ctx->TransformFeedback.Mode == GL_TRIANGLES;
- break;
+ if(ctx->Shader.CurrentGeometryProgram) {
+ switch (ctx->Shader.CurrentGeometryProgram->Geom.OutputType) {
+ case GL_POINTS:
+ pass = ctx->TransformFeedback.Mode == GL_POINTS;
+ break;
+ case GL_LINE_STRIP:
+ pass = ctx->TransformFeedback.Mode == GL_LINES;
+ break;
+ case GL_TRIANGLE_STRIP:
+ pass = ctx->TransformFeedback.Mode == GL_TRIANGLES;
+ break;
+ default:
+ pass = GL_FALSE;
+ }
+ }
+ else {
+ switch (mode) {
+ case GL_POINTS:
+ pass = ctx->TransformFeedback.Mode == GL_POINTS;
+ break;
+ case GL_LINES:
+ case GL_LINE_STRIP:
+ case GL_LINE_LOOP:
+ pass = ctx->TransformFeedback.Mode == GL_LINES;
+ break;
+ default:
+ pass = ctx->TransformFeedback.Mode == GL_TRIANGLES;
+ break;
+ }
}
if (!pass) {
- _mesa_error(ctx, GL_INVALID_OPERATION,
- "%s(mode=%s vs transform feedback %s)",
- name,
- _mesa_lookup_prim_by_nr(mode),
- _mesa_lookup_prim_by_nr(ctx->TransformFeedback.Mode));
- return GL_FALSE;
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "%s(mode=%s vs transform feedback %s)",
+ name,
+ _mesa_lookup_prim_by_nr(mode),
+ _mesa_lookup_prim_by_nr(ctx->TransformFeedback.Mode));
+ return GL_FALSE;
}
}
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index 0806e41a0..29469ce33 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -575,7 +575,8 @@ struct dd_function_table {
GLintptr readOffset, GLintptr writeOffset,
GLsizeiptr size );
- /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
+ /* Returns pointer to the start of the mapped range.
+ * May return NULL if MESA_MAP_NOWAIT_BIT is set in access:
*/
void * (*MapBufferRange)( struct gl_context *ctx, GLintptr offset,
GLsizeiptr length, GLbitfield access,
diff --git a/mesalib/src/mesa/main/fbobject.c b/mesalib/src/mesa/main/fbobject.c
index 1034c7a71..9dd71612f 100644
--- a/mesalib/src/mesa/main/fbobject.c
+++ b/mesalib/src/mesa/main/fbobject.c
@@ -3585,6 +3585,7 @@ invalidate_framebuffer_storage(GLenum target, GLsizei numAttachments,
"%s(attachment >= max. color attachments)", name);
return;
}
+ break;
}
default:
goto invalid_enum;
diff --git a/mesalib/src/mesa/main/imports.c b/mesalib/src/mesa/main/imports.c
index ca6b1d53e..277e9476a 100644
--- a/mesalib/src/mesa/main/imports.c
+++ b/mesalib/src/mesa/main/imports.c
@@ -566,7 +566,8 @@ float
_mesa_strtof( const char *s, char **end )
{
#if defined(_GNU_SOURCE) && !defined(__CYGWIN__) && !defined(__FreeBSD__) && \
- !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__)
+ !defined(ANDROID) && !defined(__HAIKU__) && !defined(__UCLIBC__) && \
+ !defined(__NetBSD__)
static locale_t loc = NULL;
if (!loc) {
loc = newlocale(LC_CTYPE_MASK, "C", NULL);
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h
index 1052f7560..880c6564e 100644
--- a/mesalib/src/mesa/main/macros.h
+++ b/mesalib/src/mesa/main/macros.h
@@ -184,6 +184,28 @@ static inline GLfloat UINT_AS_FLT(GLuint u)
return tmp.f;
}
+/**
+ * Convert a floating point value to an unsigned fixed point value.
+ *
+ * \param frac_bits The number of bits used to store the fractional part.
+ */
+static INLINE uint32_t
+U_FIXED(float value, uint32_t frac_bits)
+{
+ value *= (1 << frac_bits);
+ return value < 0 ? 0 : value;
+}
+
+/**
+ * Convert a floating point value to an signed fixed point value.
+ *
+ * \param frac_bits The number of bits used to store the fractional part.
+ */
+static INLINE uint32_t
+S_FIXED(float value, uint32_t frac_bits)
+{
+ return value * (1 << frac_bits);
+}
/*@}*/
@@ -673,8 +695,20 @@ minify(unsigned value, unsigned levels)
*
* \sa ROUND_DOWN_TO()
*/
-#define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 1))
+#define ALIGN(value, alignment) (((value) + (alignment) - 1) & ~((alignment) - 1))
+/**
+ * Align a value down to an alignment value
+ *
+ * If \c value is not already aligned to the requested alignment value, it
+ * will be rounded down.
+ *
+ * \param value Value to be rounded
+ * \param alignment Alignment value to be used. This must be a power of two.
+ *
+ * \sa ALIGN()
+ */
+#define ROUND_DOWN_TO(value, alignment) ((value) & ~(alignment - 1))
/** Cross product of two 3-element vectors */
diff --git a/mesalib/src/mesa/main/shaderapi.c b/mesalib/src/mesa/main/shaderapi.c
index 4c0484aaf..d3677c851 100644
--- a/mesalib/src/mesa/main/shaderapi.c
+++ b/mesalib/src/mesa/main/shaderapi.c
@@ -743,12 +743,6 @@ compile_shader(struct gl_context *ctx, GLuint shaderObj)
if (!sh)
return;
- /* Geometry shaders are not yet fully supported, so issue a warning message
- * if we're compiling one.
- */
- if (sh->Type == GL_GEOMETRY_SHADER)
- printf("WARNING: Geometry shader support is currently experimental.\n");
-
options = &ctx->ShaderCompilerOptions[_mesa_shader_type_to_index(sh->Type)];
/* set default pragma state for shader */
diff --git a/mesalib/src/mesa/main/texgetimage.c b/mesalib/src/mesa/main/texgetimage.c
index 7050f1080..d66ca1abc 100644
--- a/mesalib/src/mesa/main/texgetimage.c
+++ b/mesalib/src/mesa/main/texgetimage.c
@@ -319,7 +319,7 @@ get_tex_rgba_compressed(struct gl_context *ctx, GLuint dimensions,
* Return a base GL format given the user-requested format
* for glGetTexImage().
*/
-static GLenum
+GLenum
_mesa_base_pack_format(GLenum format)
{
switch (format) {
diff --git a/mesalib/src/mesa/main/texgetimage.h b/mesalib/src/mesa/main/texgetimage.h
index 91ae6e2e9..a292fabc0 100644
--- a/mesalib/src/mesa/main/texgetimage.h
+++ b/mesalib/src/mesa/main/texgetimage.h
@@ -33,6 +33,9 @@ struct gl_context;
struct gl_texture_image;
struct gl_texture_object;
+extern GLenum
+_mesa_base_pack_format(GLenum format);
+
extern void
_mesa_get_teximage(struct gl_context *ctx,
GLenum format, GLenum type, GLvoid *pixels,
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index 04385e1e9..76d8d9ba3 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -3961,6 +3961,7 @@ store_texsubimage(struct gl_context *ctx,
case GL_TEXTURE_2D:
case GL_TEXTURE_RECTANGLE:
case GL_TEXTURE_CUBE_MAP:
+ case GL_TEXTURE_EXTERNAL_OES:
/* one image slice, nothing special needs to be done */
break;
case GL_TEXTURE_1D: