~ubuntu-branches/ubuntu/jaunty/mesa/jaunty

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/r300/r300_state.c

  • Committer: Bazaar Package Importer
  • Author(s): Timo Aaltonen
  • Date: 2009-04-03 12:42:06 UTC
  • mfrom: (1.2.16 upstream) (3.1.5 experimental)
  • Revision ID: james.westby@ubuntu.com-20090403124206-0oo9dl0tcmd0qr38
Tags: 7.4-0ubuntu1
* New upstream release, merge from debian-experimental
  (LP: #330476, #347171, #349127)
* Drop 103_rs600_support.patch, included in this version.
* Drop 104_swrast_fbconfigs.patch, included in this version.
* Add 103_bump_965_texture_limit.diff. (LP: #146298)
* Add 104_fix_dri2_ext_tfp.diff. (LP: #324854)

Show diffs side-by-side

added added

removed removed

Lines of Context:
974
974
{
975
975
        r300ContextPtr rmesa = R300_CONTEXT(ctx);
976
976
        GLuint refmask =
977
 
            (((ctx->Stencil.
978
 
               Ref[0] & 0xff) << R300_STENCILREF_SHIFT) | ((ctx->
979
 
                                                            Stencil.
980
 
                                                            ValueMask
981
 
                                                            [0] &
982
 
                                                            0xff)
983
 
                                                           <<
984
 
                                                           R300_STENCILMASK_SHIFT));
985
 
 
 
977
            ((ctx->Stencil.Ref[0] & 0xff) << R300_STENCILREF_SHIFT)
 
978
             | ((ctx->Stencil.ValueMask[0] & 0xff) << R300_STENCILMASK_SHIFT);
 
979
        const unsigned back = ctx->Stencil._BackFace;
986
980
        GLuint flag;
987
981
 
988
982
        R300_STATECHANGE(rmesa, zs);
1000
994
        rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
1001
995
            (flag << R300_S_FRONT_FUNC_SHIFT);
1002
996
 
1003
 
        if (ctx->Stencil._TestTwoSide)
1004
 
                flag = translate_func(ctx->Stencil.Function[1]);
 
997
        flag = translate_func(ctx->Stencil.Function[back]);
1005
998
 
1006
999
        rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
1007
1000
            (flag << R300_S_BACK_FUNC_SHIFT);
1026
1019
                                  GLenum fail, GLenum zfail, GLenum zpass)
1027
1020
{
1028
1021
        r300ContextPtr rmesa = R300_CONTEXT(ctx);
 
1022
        const unsigned back = ctx->Stencil._BackFace;
1029
1023
 
1030
1024
        R300_STATECHANGE(rmesa, zs);
1031
1025
        /* It is easier to mask what's left.. */
1042
1036
            | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) <<
1043
1037
               R300_S_FRONT_ZPASS_OP_SHIFT);
1044
1038
 
1045
 
        if (ctx->Stencil._TestTwoSide) {
1046
 
                rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
1047
 
                    (translate_stencil_op(ctx->Stencil.FailFunc[1]) <<
1048
 
                     R300_S_BACK_SFAIL_OP_SHIFT)
1049
 
                    | (translate_stencil_op(ctx->Stencil.ZFailFunc[1]) <<
1050
 
                       R300_S_BACK_ZFAIL_OP_SHIFT)
1051
 
                    | (translate_stencil_op(ctx->Stencil.ZPassFunc[1]) <<
1052
 
                       R300_S_BACK_ZPASS_OP_SHIFT);
1053
 
        } else {
1054
 
                rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
1055
 
                    (translate_stencil_op(ctx->Stencil.FailFunc[0]) <<
1056
 
                     R300_S_BACK_SFAIL_OP_SHIFT)
1057
 
                    | (translate_stencil_op(ctx->Stencil.ZFailFunc[0]) <<
1058
 
                       R300_S_BACK_ZFAIL_OP_SHIFT)
1059
 
                    | (translate_stencil_op(ctx->Stencil.ZPassFunc[0]) <<
1060
 
                       R300_S_BACK_ZPASS_OP_SHIFT);
1061
 
        }
 
1039
        rmesa->hw.zs.cmd[R300_ZS_CNTL_1] |=
 
1040
            (translate_stencil_op(ctx->Stencil.FailFunc[back]) <<
 
1041
             R300_S_BACK_SFAIL_OP_SHIFT)
 
1042
            | (translate_stencil_op(ctx->Stencil.ZFailFunc[back]) <<
 
1043
               R300_S_BACK_ZFAIL_OP_SHIFT)
 
1044
            | (translate_stencil_op(ctx->Stencil.ZPassFunc[back]) <<
 
1045
               R300_S_BACK_ZPASS_OP_SHIFT);
1062
1046
}
1063
1047
 
1064
1048
/* =============================================================
1214
1198
 
1215
1199
                case STATE_R300_TEXRECT_FACTOR:{
1216
1200
                                struct gl_texture_object *t =
1217
 
                                    ctx->Texture.Unit[state[2]].CurrentRect;
 
1201
                                    ctx->Texture.Unit[state[2]].CurrentTex[TEXTURE_RECT_INDEX];
1218
1202
 
1219
1203
                                if (t && t->Image[0][t->BaseLevel]) {
1220
1204
                                        struct gl_texture_image *image =