diff options
author | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-05-30 12:54:23 -0400 |
---|---|---|
committer | Ilia Mirkin <imirkin@alum.mit.edu> | 2016-08-30 20:25:15 -0400 |
commit | 10663c648e58762eb39c7670c9397b74521e8134 (patch) | |
tree | d60fdb18fcf7a7c59bc8dc7c946caadc9e666091 /src/mesa/main/bbox.c | |
parent | 3b81c998a214a2ad7a4a712577277b1fc7b9be4e (diff) | |
download | external_mesa3d-10663c648e58762eb39c7670c9397b74521e8134.zip external_mesa3d-10663c648e58762eb39c7670c9397b74521e8134.tar.gz external_mesa3d-10663c648e58762eb39c7670c9397b74521e8134.tar.bz2 |
mesa: add support for GL_PRIMITIVE_BOUNDING_BOX storage and query
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/main/bbox.c')
-rw-r--r-- | src/mesa/main/bbox.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/mesa/main/bbox.c b/src/mesa/main/bbox.c index 0ef5705..2184330 100644 --- a/src/mesa/main/bbox.c +++ b/src/mesa/main/bbox.c @@ -36,9 +36,28 @@ _mesa_PrimitiveBoundingBox( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW) { + GET_CURRENT_CONTEXT(ctx); + + ctx->PrimitiveBoundingBox[0] = minX; + ctx->PrimitiveBoundingBox[1] = minY; + ctx->PrimitiveBoundingBox[2] = minZ; + ctx->PrimitiveBoundingBox[3] = minW; + ctx->PrimitiveBoundingBox[4] = maxX; + ctx->PrimitiveBoundingBox[5] = maxY; + ctx->PrimitiveBoundingBox[6] = maxZ; + ctx->PrimitiveBoundingBox[7] = maxW; } void _mesa_init_bbox(struct gl_context *ctx) { + ctx->PrimitiveBoundingBox[0] = + ctx->PrimitiveBoundingBox[1] = + ctx->PrimitiveBoundingBox[2] = -1.0f; + + ctx->PrimitiveBoundingBox[3] = + ctx->PrimitiveBoundingBox[4] = + ctx->PrimitiveBoundingBox[5] = + ctx->PrimitiveBoundingBox[6] = + ctx->PrimitiveBoundingBox[7] = 1.0f; } |