diff options
author | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-12-19 21:46:33 +0100 |
---|---|---|
committer | Christoph Bumiller <e0425955@student.tuwien.ac.at> | 2010-12-19 21:46:33 +0100 |
commit | 0f68236a2487dbeb0396b996debcda595b0b54a1 (patch) | |
tree | 938ae3b779349b6dba6f5a891550604f9a9ca895 /src/mesa/drivers/dri/nouveau/nv20_state_tnl.c | |
parent | d047168d81cfeb39a98f3ae16416872facc6237c (diff) | |
parent | 237880463d5168cad8df0bae6018b5fd76617777 (diff) |
Merge remote branch 'origin/master' into nvc0-new
Diffstat (limited to 'src/mesa/drivers/dri/nouveau/nv20_state_tnl.c')
-rw-r--r-- | src/mesa/drivers/dri/nouveau/nv20_state_tnl.c | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c index b65cd9ad87..4677198dd0 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c @@ -28,31 +28,31 @@ #include "nouveau_context.h" #include "nouveau_gldefs.h" #include "nouveau_util.h" -#include "nouveau_class.h" +#include "nv20_3d.xml.h" #include "nv10_driver.h" #include "nv20_driver.h" #define LIGHT_MODEL_AMBIENT_R(side) \ - ((side) ? NV20TCL_LIGHT_MODEL_BACK_AMBIENT_R : \ - NV20TCL_LIGHT_MODEL_FRONT_AMBIENT_R) + ((side) ? NV20_3D_LIGHT_MODEL_BACK_AMBIENT_R : \ + NV20_3D_LIGHT_MODEL_FRONT_AMBIENT_R) #define LIGHT_AMBIENT_R(side, i) \ - ((side) ? NV20TCL_LIGHT_BACK_AMBIENT_R(i) : \ - NV20TCL_LIGHT_FRONT_AMBIENT_R(i)) + ((side) ? NV20_3D_LIGHT_BACK_AMBIENT_R(i) : \ + NV20_3D_LIGHT_FRONT_AMBIENT_R(i)) #define LIGHT_DIFFUSE_R(side, i) \ - ((side) ? NV20TCL_LIGHT_BACK_DIFFUSE_R(i) : \ - NV20TCL_LIGHT_FRONT_DIFFUSE_R(i)) + ((side) ? NV20_3D_LIGHT_BACK_DIFFUSE_R(i) : \ + NV20_3D_LIGHT_FRONT_DIFFUSE_R(i)) #define LIGHT_SPECULAR_R(side, i) \ - ((side) ? NV20TCL_LIGHT_BACK_SPECULAR_R(i) : \ - NV20TCL_LIGHT_FRONT_SPECULAR_R(i)) + ((side) ? NV20_3D_LIGHT_BACK_SPECULAR_R(i) : \ + NV20_3D_LIGHT_FRONT_SPECULAR_R(i)) #define MATERIAL_FACTOR_R(side) \ - ((side) ? NV20TCL_MATERIAL_FACTOR_BACK_R : \ - NV20TCL_MATERIAL_FACTOR_FRONT_R) + ((side) ? NV20_3D_MATERIAL_FACTOR_BACK_R : \ + NV20_3D_MATERIAL_FACTOR_FRONT_R) #define MATERIAL_FACTOR_A(side) \ - ((side) ? NV20TCL_MATERIAL_FACTOR_BACK_A : \ - NV20TCL_MATERIAL_FACTOR_FRONT_A) + ((side) ? NV20_3D_MATERIAL_FACTOR_BACK_A : \ + NV20_3D_MATERIAL_FACTOR_FRONT_A) #define MATERIAL_SHININESS(side) \ - ((side) ? NV20TCL_BACK_MATERIAL_SHININESS(0) : \ - NV20TCL_FRONT_MATERIAL_SHININESS(0)) + ((side) ? NV20_3D_BACK_MATERIAL_SHININESS(0) : \ + NV20_3D_FRONT_MATERIAL_SHININESS(0)) void nv20_emit_clip_plane(struct gl_context *ctx, int emit) @@ -65,22 +65,22 @@ get_material_bitmask(unsigned m) unsigned ret = 0; if (m & MAT_BIT_FRONT_EMISSION) - ret |= NV20TCL_COLOR_MATERIAL_FRONT_EMISSION_COL1; + ret |= NV20_3D_COLOR_MATERIAL_FRONT_EMISSION_COL1; if (m & MAT_BIT_FRONT_AMBIENT) - ret |= NV20TCL_COLOR_MATERIAL_FRONT_AMBIENT_COL1; + ret |= NV20_3D_COLOR_MATERIAL_FRONT_AMBIENT_COL1; if (m & MAT_BIT_FRONT_DIFFUSE) - ret |= NV20TCL_COLOR_MATERIAL_FRONT_DIFFUSE_COL1; + ret |= NV20_3D_COLOR_MATERIAL_FRONT_DIFFUSE_COL1; if (m & MAT_BIT_FRONT_SPECULAR) - ret |= NV20TCL_COLOR_MATERIAL_FRONT_SPECULAR_COL1; + ret |= NV20_3D_COLOR_MATERIAL_FRONT_SPECULAR_COL1; if (m & MAT_BIT_BACK_EMISSION) - ret |= NV20TCL_COLOR_MATERIAL_BACK_EMISSION_COL1; + ret |= NV20_3D_COLOR_MATERIAL_BACK_EMISSION_COL1; if (m & MAT_BIT_BACK_AMBIENT) - ret |= NV20TCL_COLOR_MATERIAL_BACK_AMBIENT_COL1; + ret |= NV20_3D_COLOR_MATERIAL_BACK_AMBIENT_COL1; if (m & MAT_BIT_BACK_DIFFUSE) - ret |= NV20TCL_COLOR_MATERIAL_BACK_DIFFUSE_COL1; + ret |= NV20_3D_COLOR_MATERIAL_BACK_DIFFUSE_COL1; if (m & MAT_BIT_BACK_SPECULAR) - ret |= NV20TCL_COLOR_MATERIAL_BACK_SPECULAR_COL1; + ret |= NV20_3D_COLOR_MATERIAL_BACK_SPECULAR_COL1; return ret; } @@ -92,7 +92,7 @@ nv20_emit_color_material(struct gl_context *ctx, int emit) struct nouveau_grobj *kelvin = context_eng3d(ctx); unsigned mask = get_material_bitmask(ctx->Light.ColorMaterialBitmask); - BEGIN_RING(chan, kelvin, NV20TCL_COLOR_MATERIAL, 1); + BEGIN_RING(chan, kelvin, NV20_3D_COLOR_MATERIAL, 1); OUT_RING(chan, ctx->Light.ColorMaterialEnabled ? mask : 0); } @@ -101,11 +101,11 @@ get_fog_mode_signed(unsigned mode) { switch (mode) { case GL_LINEAR: - return NV20TCL_FOG_MODE_LINEAR_SIGNED; + return NV20_3D_FOG_MODE_LINEAR_SIGNED; case GL_EXP: - return NV20TCL_FOG_MODE_EXP_SIGNED; + return NV20_3D_FOG_MODE_EXP_SIGNED; case GL_EXP2: - return NV20TCL_FOG_MODE_EXP2_SIGNED; + return NV20_3D_FOG_MODE_EXP2_SIGNED; default: assert(0); } @@ -116,11 +116,11 @@ get_fog_mode_unsigned(unsigned mode) { switch (mode) { case GL_LINEAR: - return NV20TCL_FOG_MODE_LINEAR_UNSIGNED; + return NV20_3D_FOG_MODE_LINEAR_UNSIGNED; case GL_EXP: - return NV20TCL_FOG_MODE_EXP_UNSIGNED; + return NV20_3D_FOG_MODE_EXP_UNSIGNED; case GL_EXP2: - return NV20TCL_FOG_MODE_EXP2_UNSIGNED; + return NV20_3D_FOG_MODE_EXP2_UNSIGNED; default: assert(0); } @@ -131,9 +131,9 @@ get_fog_source(unsigned source) { switch (source) { case GL_FOG_COORDINATE_EXT: - return NV20TCL_FOG_COORD_FOG; + return NV20_3D_FOG_COORD_FOG; case GL_FRAGMENT_DEPTH_EXT: - return NV20TCL_FOG_COORD_DIST_ORTHOGONAL_ABS; + return NV20_3D_FOG_COORD_DIST_ORTHOGONAL_ABS; default: assert(0); } @@ -152,15 +152,15 @@ nv20_emit_fog(struct gl_context *ctx, int emit) nv10_get_fog_coeff(ctx, k); - BEGIN_RING(chan, kelvin, NV20TCL_FOG_MODE, 4); + BEGIN_RING(chan, kelvin, NV20_3D_FOG_MODE, 4); OUT_RING(chan, (source == GL_FOG_COORDINATE_EXT ? 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, NV20TCL_FOG_EQUATION_CONSTANT, 3); + BEGIN_RING(chan, kelvin, NV20_3D_FOG_COEFF(0), 3); OUT_RINGp(chan, k, 3); } @@ -171,19 +171,19 @@ nv20_emit_light_model(struct gl_context *ctx, int emit) struct nouveau_grobj *kelvin = context_eng3d(ctx); struct gl_lightmodel *m = &ctx->Light.Model; - BEGIN_RING(chan, kelvin, NV20TCL_SEPARATE_SPECULAR_ENABLE, 1); - OUT_RING(chan, m->ColorControl == GL_SEPARATE_SPECULAR_COLOR ? 1 : 0); + BEGIN_RING(chan, kelvin, NV20_3D_SEPARATE_SPECULAR_ENABLE, 1); + OUT_RINGb(chan, m->ColorControl == GL_SEPARATE_SPECULAR_COLOR); - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_MODEL, 1); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_MODEL, 1); OUT_RING(chan, ((m->LocalViewer ? - NV20TCL_LIGHT_MODEL_VIEWER_LOCAL : - NV20TCL_LIGHT_MODEL_VIEWER_NONLOCAL) | + NV20_3D_LIGHT_MODEL_VIEWER_LOCAL : + NV20_3D_LIGHT_MODEL_VIEWER_NONLOCAL) | (NEED_SECONDARY_COLOR(ctx) ? - NV20TCL_LIGHT_MODEL_SEPARATE_SPECULAR : + NV20_3D_LIGHT_MODEL_SEPARATE_SPECULAR : 0))); - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_MODEL_TWO_SIDE_ENABLE, 1); - OUT_RING(chan, ctx->Light.Model.TwoSide ? 1 : 0); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_MODEL_TWO_SIDE_ENABLE, 1); + OUT_RINGb(chan, ctx->Light.Model.TwoSide); } void @@ -195,19 +195,19 @@ nv20_emit_light_source(struct gl_context *ctx, int emit) struct gl_light *l = &ctx->Light.Light[i]; if (l->_Flags & LIGHT_POSITIONAL) { - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_POSITION_X(i), 3); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_POSITION_X(i), 3); OUT_RINGp(chan, l->_Position, 3); - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_ATTENUATION_CONSTANT(i), 3); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_ATTENUATION_CONSTANT(i), 3); OUT_RINGf(chan, l->ConstantAttenuation); OUT_RINGf(chan, l->LinearAttenuation); OUT_RINGf(chan, l->QuadraticAttenuation); } else { - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_DIRECTION_X(i), 3); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_DIRECTION_X(i), 3); OUT_RINGp(chan, l->_VP_inf_norm, 3); - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_HALF_VECTOR_X(i), 3); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_HALF_VECTOR_X(i), 3); OUT_RINGp(chan, l->_h_inf_norm, 3); } @@ -216,7 +216,7 @@ nv20_emit_light_source(struct gl_context *ctx, int emit) nv10_get_spot_coeff(l, k); - BEGIN_RING(chan, kelvin, NV20TCL_LIGHT_SPOT_CUTOFF_A(i), 7); + BEGIN_RING(chan, kelvin, NV20_3D_LIGHT_SPOT_CUTOFF(i, 0), 7); OUT_RINGp(chan, k, 7); } } @@ -340,7 +340,7 @@ nv20_emit_modelview(struct gl_context *ctx, int emit) if (ctx->Light._NeedEyeCoords || ctx->Fog.Enabled || (ctx->Texture._GenFlags & TEXGEN_NEED_EYE_COORD)) { - BEGIN_RING(chan, kelvin, NV20TCL_MODELVIEW0_MATRIX(0), 16); + BEGIN_RING(chan, kelvin, NV20_3D_MODELVIEW_MATRIX(0, 0), 16); OUT_RINGm(chan, m->m); } @@ -349,7 +349,7 @@ nv20_emit_modelview(struct gl_context *ctx, int emit) int i, j; BEGIN_RING(chan, kelvin, - NV20TCL_INVERSE_MODELVIEW0_MATRIX(0), 12); + NV20_3D_INVERSE_MODELVIEW_MATRIX(0, 0), 12); for (i = 0; i < 3; i++) for (j = 0; j < 4; j++) OUT_RINGf(chan, m->inv[4*i + j]); @@ -370,7 +370,7 @@ nv20_emit_projection(struct gl_context *ctx, int emit) if (nctx->fallback == HWTNL) _math_matrix_mul_matrix(&m, &m, &ctx->_ModelProjectMatrix); - BEGIN_RING(chan, kelvin, NV20TCL_PROJECTION_MATRIX(0), 16); + BEGIN_RING(chan, kelvin, NV20_3D_PROJECTION_MATRIX(0), 16); OUT_RINGm(chan, m.m); _math_matrix_dtr(&m); |