summaryrefslogtreecommitdiff
path: root/src/mesa/tnl
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_draw.c24
-rw-r--r--src/mesa/tnl/t_vb_points.c2
-rw-r--r--src/mesa/tnl/t_vertex.c2
3 files changed, 25 insertions, 3 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 38757a0e28..812d712b07 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -108,6 +108,22 @@ convert_bgra_to_float(const struct gl_client_array *input,
}
}
+static void
+convert_half_to_float(const struct gl_client_array *input,
+ const GLubyte *ptr, GLfloat *fptr,
+ GLuint count, GLuint sz)
+{
+ GLuint i, j;
+
+ for (i = 0; i < count; i++) {
+ GLhalfARB *in = (GLhalfARB *)ptr;
+
+ for (j = 0; j < sz; j++) {
+ *fptr++ = _mesa_half_to_float(in[j]);
+ }
+ ptr += input->StrideB;
+ }
+}
/* Adjust pointer to point at first requested element, convert to
* floating point, populate VB->AttribPtr[].
@@ -155,6 +171,9 @@ static void _tnl_import_array( GLcontext *ctx,
case GL_DOUBLE:
CONVERT(GLdouble, (GLfloat));
break;
+ case GL_HALF_FLOAT:
+ convert_half_to_float(input, ptr, fptr, count, sz);
+ break;
default:
assert(0);
break;
@@ -380,9 +399,12 @@ void _tnl_draw_prims( GLcontext *ctx,
TNLcontext *tnl = TNL_CONTEXT(ctx);
const GLuint TEST_SPLIT = 0;
const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES;
- GLuint max_basevertex = prim->basevertex;
+ GLint max_basevertex = prim->basevertex;
GLuint i;
+ /* Mesa core state should have been validated already */
+ assert(ctx->NewState == 0x0);
+
if (!_mesa_check_conditional_render(ctx))
return; /* don't draw */
diff --git a/src/mesa/tnl/t_vb_points.c b/src/mesa/tnl/t_vb_points.c
index a52505b4b8..ab8ea60cf2 100644
--- a/src/mesa/tnl/t_vb_points.c
+++ b/src/mesa/tnl/t_vb_points.c
@@ -64,7 +64,7 @@ run_point_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage)
for (i = 0; i < VB->Count; i++) {
const GLfloat dist = FABSF(*eyeCoord);
const GLfloat q = p0 + dist * (p1 + dist * p2);
- const GLfloat atten = (q != 0.0) ? SQRTF(1.0 / q) : 1.0;
+ const GLfloat atten = (q != 0.0F) ? SQRTF(1.0F / q) : 1.0F;
size[i][0] = pointSize * atten; /* clamping done in rasterization */
eyeCoord += eyeCoordStride;
}
diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c
index fe4209ae57..d3955873dc 100644
--- a/src/mesa/tnl/t_vertex.c
+++ b/src/mesa/tnl/t_vertex.c
@@ -383,7 +383,7 @@ static void adjust_input_ptrs( GLcontext *ctx, GLint diff)
struct tnl_clipspace *vtx = GET_VERTEX_STATE(ctx);
struct tnl_clipspace_attr *a = vtx->attr;
const GLuint count = vtx->attr_count;
- int j;
+ GLuint j;
diff -= 1;
for (j=0; j<count; ++j) {