#include "pipe/p_shader_tokens.h"
#include "pipe/p_defines.h"
+#define NOUVEAU_DEBUG
+
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_util.h"
#include "tgsi/tgsi_dump.h"
*/
case TGSI_SEMANTIC_INSTANCEID:
return 0x2f8;
+ case TGSI_SEMANTIC_FACE:
+ return 0x3fc;
default:
assert(0);
return 0x000;
return 0x360;
case TGSI_SEMANTIC_PRIMID:
return 0x40;
+ case TGSI_SEMANTIC_FACE:
+ return 0x3fc;
/*
case TGSI_SEMANTIC_CLIP_DISTANCE:
return 0x2c0 + (si * 4);
SB_DATA (so, nvgl_polygon_mode(cso->fill_back));
SB_OUT_3D (so, POLYGON_SMOOTH_ENABLE, cso->poly_smooth);
- if (cso->cull_face != PIPE_FACE_NONE) {
- SB_BEGIN_3D(so, CULL_FACE_ENABLE, 3);
- SB_DATA (so, 1);
- SB_DATA (so, cso->front_ccw ? NVC0_3D_FRONT_FACE_CCW :
- NVC0_3D_FRONT_FACE_CW);
- switch (cso->cull_face) {
- case PIPE_FACE_FRONT_AND_BACK:
- SB_DATA(so, NVC0_3D_CULL_FACE_FRONT_AND_BACK);
- break;
- case PIPE_FACE_FRONT:
- SB_DATA(so, NVC0_3D_CULL_FACE_FRONT);
- break;
- case PIPE_FACE_BACK:
- default:
- SB_DATA(so, NVC0_3D_CULL_FACE_BACK);
- break;
- }
- } else {
- SB_OUT_3D(so, CULL_FACE_ENABLE, 0);
+ SB_BEGIN_3D(so, CULL_FACE_ENABLE, 3);
+ SB_DATA (so, cso->cull_face != PIPE_FACE_NONE);
+ SB_DATA (so, cso->front_ccw ? NVC0_3D_FRONT_FACE_CCW :
+ NVC0_3D_FRONT_FACE_CW);
+ switch (cso->cull_face) {
+ case PIPE_FACE_FRONT_AND_BACK:
+ SB_DATA(so, NVC0_3D_CULL_FACE_FRONT_AND_BACK);
+ break;
+ case PIPE_FACE_FRONT:
+ SB_DATA(so, NVC0_3D_CULL_FACE_FRONT);
+ break;
+ case PIPE_FACE_BACK:
+ default:
+ SB_DATA(so, NVC0_3D_CULL_FACE_BACK);
+ break;
}
SB_OUT_3D (so, POLYGON_STIPPLE_ENABLE, cso->poly_stipple_enable);
if (val->reg.address == 0x3fc) {
/* gl_FrontFacing: 0/~0 to -1.0/+1.0 */
val = bld_insn_1(bld, NV_OP_LINTERP, val);
+ val->insn->flat = 1;
val = bld_insn_2(bld, NV_OP_SHL, val, bld_imm_u32(bld, 31));
val = bld_insn_2(bld, NV_OP_XOR, val, bld_imm_f32(bld, -1.0f));
+ return val;
} else
if (mode == NVC0_INTERP_PERSPECTIVE) {
val = bld_insn_2(bld, NV_OP_PINTERP, val, bld->frag_coord[3]);