summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl/t_draw.c')
-rw-r--r--src/mesa/tnl/t_draw.c43
1 files changed, 27 insertions, 16 deletions
diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c
index 9a888ce19f..d8c611031d 100644
--- a/src/mesa/tnl/t_draw.c
+++ b/src/mesa/tnl/t_draw.c
@@ -26,6 +26,7 @@
*/
#include "main/glheader.h"
+#include "main/condrender.h"
#include "main/context.h"
#include "main/imports.h"
#include "main/mtypes.h"
@@ -107,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[].
@@ -154,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;
@@ -247,22 +267,10 @@ static void bind_inputs( GLcontext *ctx,
*/
VB->Count = count;
-
- /* Legacy pointers -- remove one day.
- */
- VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS];
- VB->NormalPtr = VB->AttribPtr[_TNL_ATTRIB_NORMAL];
- VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
- VB->ColorPtr[1] = NULL;
- VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX];
- VB->IndexPtr[1] = NULL;
- VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1];
- VB->SecondaryColorPtr[1] = NULL;
- VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
-
- for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
- VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i];
- }
+ /* These should perhaps be part of _TNL_ATTRIB_* */
+ VB->BackfaceColorPtr = NULL;
+ VB->BackfaceIndexPtr = NULL;
+ VB->BackfaceSecondaryColorPtr = NULL;
/* Clipping and drawing code still requires this to be a packed
* array of ubytes which can be written into. TODO: Fix and
@@ -394,6 +402,9 @@ void _tnl_draw_prims( GLcontext *ctx,
GLuint max_basevertex = prim->basevertex;
GLuint i;
+ if (!_mesa_check_conditional_render(ctx))
+ return; /* don't draw */
+
for (i = 1; i < nr_prims; i++)
max_basevertex = MAX2(max_basevertex, prim[i].basevertex);