a[2] = fb->_DepthMaxF * (vp->Far + vp->Near) / 2;
}
+static inline void
+OUT_RINGb(struct nouveau_channel *chan, GLboolean x)
+{
+ OUT_RING(chan, x ? 1 : 0);
+}
+
static inline void
OUT_RINGm(struct nouveau_channel *chan, float m[16])
{
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_fbo.h"
+#include "nouveau_util.h"
#include "nv_object.xml.h"
#include "nv10_3d.xml.h"
-#include "nouveau_util.h"
#include "nv10_driver.h"
static inline unsigned
if (nfb->hierz.bo) {
BEGIN_RING(chan, celsius, NV17_3D_ZCLEAR_ENABLE, 2);
- OUT_RING(chan, nctx->hierz.clear_blocked ? 0 : 1);
+ OUT_RINGb(chan, !nctx->hierz.clear_blocked);
OUT_RING(chan, nfb->hierz.clear_value |
(nctx->hierz.clear_seq & 0xff));
} else {
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_gldefs.h"
+#include "nouveau_util.h"
#include "nv10_3d.xml.h"
#include "nv10_driver.h"
GLenum mode = ctx->Polygon.CullFaceMode;
BEGIN_RING(chan, celsius, NV10_3D_CULL_FACE_ENABLE, 1);
- OUT_RING(chan, ctx->Polygon.CullFlag ? 1 : 0);
+ OUT_RINGb(chan, ctx->Polygon.CullFlag);
BEGIN_RING(chan, celsius, NV10_3D_CULL_FACE, 1);
OUT_RING(chan, (mode == GL_FRONT ? NV10_3D_CULL_FACE_FRONT :
OUT_RING(chan, MAX2(smooth ? 0 : 1,
ctx->Line.Width) * 8);
BEGIN_RING(chan, celsius, NV10_3D_LINE_SMOOTH_ENABLE, 1);
- OUT_RING(chan, smooth ? 1 : 0);
+ OUT_RINGb(chan, smooth);
}
void
OUT_RING(chan, (uint32_t)(ctx->Point.Size * 8));
BEGIN_RING(chan, celsius, NV10_3D_POINT_SMOOTH_ENABLE, 1);
- OUT_RING(chan, ctx->Point.SmoothFlag ? 1 : 0);
+ OUT_RINGb(chan, ctx->Point.SmoothFlag);
}
void
OUT_RING(chan, nvgl_polygon_mode(ctx->Polygon.BackMode));
BEGIN_RING(chan, celsius, NV10_3D_POLYGON_SMOOTH_ENABLE, 1);
- OUT_RING(chan, ctx->Polygon.SmoothFlag ? 1 : 0);
+ OUT_RINGb(chan, ctx->Polygon.SmoothFlag);
}
void
struct nouveau_grobj *celsius = context_eng3d(ctx);
BEGIN_RING(chan, celsius, NV10_3D_POLYGON_OFFSET_POINT_ENABLE, 3);
- OUT_RING(chan, ctx->Polygon.OffsetPoint ? 1 : 0);
- OUT_RING(chan, ctx->Polygon.OffsetLine ? 1 : 0);
- OUT_RING(chan, ctx->Polygon.OffsetFill ? 1 : 0);
+ OUT_RINGb(chan, ctx->Polygon.OffsetPoint);
+ OUT_RINGb(chan, ctx->Polygon.OffsetLine);
+ OUT_RINGb(chan, ctx->Polygon.OffsetFill);
BEGIN_RING(chan, celsius, NV10_3D_POLYGON_OFFSET_FACTOR, 2);
OUT_RINGf(chan, ctx->Polygon.OffsetFactor);
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_gldefs.h"
+#include "nouveau_util.h"
#include "nv10_3d.xml.h"
#include "nv10_driver.h"
struct nouveau_grobj *celsius = context_eng3d(ctx);
BEGIN_RING(chan, celsius, NV10_3D_ALPHA_FUNC_ENABLE, 1);
- OUT_RING(chan, ctx->Color.AlphaEnabled ? 1 : 0);
+ OUT_RINGb(chan, ctx->Color.AlphaEnabled);
BEGIN_RING(chan, celsius, NV10_3D_ALPHA_FUNC_FUNC, 2);
OUT_RING(chan, nvgl_comparison_op(ctx->Color.AlphaFunc));
struct nouveau_grobj *celsius = context_eng3d(ctx);
BEGIN_RING(chan, celsius, NV10_3D_BLEND_FUNC_ENABLE, 1);
- OUT_RING(chan, ctx->Color.BlendEnabled ? 1 : 0);
+ OUT_RINGb(chan, ctx->Color.BlendEnabled);
BEGIN_RING(chan, celsius, NV10_3D_BLEND_EQUATION, 1);
OUT_RING(chan, nvgl_blend_eqn(ctx->Color.BlendEquationRGB));
struct nouveau_grobj *celsius = context_eng3d(ctx);
BEGIN_RING(chan, celsius, NV10_3D_DEPTH_TEST_ENABLE, 1);
- OUT_RING(chan, ctx->Depth.Test ? 1 : 0);
+ OUT_RINGb(chan, ctx->Depth.Test);
BEGIN_RING(chan, celsius, NV10_3D_DEPTH_WRITE_ENABLE, 1);
- OUT_RING(chan, ctx->Depth.Mask ? 1 : 0);
+ OUT_RINGb(chan, ctx->Depth.Mask);
BEGIN_RING(chan, celsius, NV10_3D_DEPTH_FUNC, 1);
OUT_RING(chan, nvgl_comparison_op(ctx->Depth.Func));
}
struct nouveau_grobj *celsius = context_eng3d(ctx);
BEGIN_RING(chan, celsius, NV10_3D_DITHER_ENABLE, 1);
- OUT_RING(chan, ctx->Color.DitherFlag ? 1 : 0);
+ OUT_RINGb(chan, ctx->Color.DitherFlag);
}
void
|| context_chipset(ctx) >= 0x11);
BEGIN_RING(chan, celsius, NV11_3D_COLOR_LOGIC_OP_ENABLE, 2);
- OUT_RING(chan, ctx->Color.ColorLogicOpEnabled ? 1 : 0);
+ OUT_RINGb(chan, ctx->Color.ColorLogicOpEnabled);
OUT_RING(chan, nvgl_logicop_func(ctx->Color.LogicOp));
}
struct nouveau_grobj *celsius = context_eng3d(ctx);
BEGIN_RING(chan, celsius, NV10_3D_STENCIL_ENABLE, 1);
- OUT_RING(chan, ctx->Stencil.Enabled ? 1 : 0);
+ OUT_RINGb(chan, ctx->Stencil.Enabled);
BEGIN_RING(chan, celsius, NV10_3D_STENCIL_FUNC_FUNC, 3);
OUT_RING(chan, nvgl_comparison_op(ctx->Stencil.Function[0]));
BEGIN_RING(chan, celsius, NV10_3D_FOG_MODE, 4);
OUT_RING(chan, get_fog_mode(f->Mode));
OUT_RING(chan, get_fog_source(source));
- OUT_RING(chan, f->Enabled ? 1 : 0);
+ OUT_RINGb(chan, f->Enabled);
OUT_RING(chan, pack_rgba_f(MESA_FORMAT_RGBA8888_REV, f->Color));
BEGIN_RING(chan, celsius, NV10_3D_FOG_COEFF(0), 3);
BEGIN_RING(chan, celsius, NV10_3D_ENABLED_LIGHTS, 1);
OUT_RING(chan, en_lights);
BEGIN_RING(chan, celsius, NV10_3D_LIGHTING_ENABLE, 1);
- OUT_RING(chan, ctx->Light.Enabled ? 1 : 0);
+ OUT_RINGb(chan, ctx->Light.Enabled);
BEGIN_RING(chan, celsius, NV10_3D_NORMALIZE_ENABLE, 1);
- OUT_RING(chan, ctx->Transform.Normalize ? 1 : 0);
+ OUT_RINGb(chan, ctx->Transform.Normalize);
}
void
struct gl_lightmodel *m = &ctx->Light.Model;
BEGIN_RING(chan, celsius, NV10_3D_SEPARATE_SPECULAR_ENABLE, 1);
- OUT_RING(chan, m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? 1 : 0);
+ OUT_RINGb(chan, m->ColorControl == GL_SEPARATE_SPECULAR_COLOR);
BEGIN_RING(chan, celsius, NV10_3D_LIGHT_MODEL, 1);
OUT_RING(chan, ((m->LocalViewer ?
#include "nouveau_driver.h"
#include "nouveau_context.h"
#include "nouveau_gldefs.h"
+#include "nouveau_util.h"
#include "nv20_3d.xml.h"
#include "nv20_driver.h"
struct nouveau_grobj *kelvin = context_eng3d(ctx);
BEGIN_RING(chan, kelvin, NV20_3D_COLOR_LOGIC_OP_ENABLE, 2);
- OUT_RING(chan, ctx->Color.ColorLogicOpEnabled ? 1 : 0);
+ OUT_RINGb(chan, ctx->Color.ColorLogicOpEnabled);
OUT_RING(chan, nvgl_logicop_func(ctx->Color.LogicOp));
}
get_fog_mode_signed(f->Mode) :
get_fog_mode_unsigned(f->Mode)));
OUT_RING(chan, get_fog_source(source));
- OUT_RING(chan, f->Enabled ? 1 : 0);
+ OUT_RINGb(chan, f->Enabled);
OUT_RING(chan, pack_rgba_f(MESA_FORMAT_RGBA8888_REV, f->Color));
BEGIN_RING(chan, kelvin, NV20_3D_FOG_COEFF(0), 3);
struct gl_lightmodel *m = &ctx->Light.Model;
BEGIN_RING(chan, kelvin, NV20_3D_SEPARATE_SPECULAR_ENABLE, 1);
- OUT_RING(chan, m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? 1 : 0);
+ OUT_RINGb(chan, m->ColorControl == GL_SEPARATE_SPECULAR_COLOR);
BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_MODEL, 1);
OUT_RING(chan, ((m->LocalViewer ?
0)));
BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_MODEL_TWO_SIDE_ENABLE, 1);
- OUT_RING(chan, ctx->Light.Model.TwoSide ? 1 : 0);
+ OUT_RINGb(chan, ctx->Light.Model.TwoSide);
}
void