SV_VERTEX_COUNT, // gl_PatchVerticesIn
SV_LAYER,
SV_VIEWPORT_INDEX,
+ SV_VIEWPORT_MASK,
SV_YDIR,
SV_FACE,
SV_POINT_SIZE,
uint8_t globalAccess; /* 1 for read, 2 for wr, 3 for rw */
bool fp64; /* program uses fp64 math */
bool mul_zero_wins; /* program wants for x*0 = 0 */
+ bool layer_viewport_relative;
bool nv50styleSurfaces; /* generate gX[] access for raw buffers */
uint16_t texBindBase; /* base address for tex handles (nve4) */
uint16_t fbtexBindBase; /* base address for fbtex handle (nve4) */
case TGSI_PROPERTY_MUL_ZERO_WINS:
info->io.mul_zero_wins = prop->u[0].Data;
break;
+ case TGSI_PROPERTY_LAYER_VIEWPORT_RELATIVE:
+ info->io.layer_viewport_relative = prop->u[0].Data;
+ break;
default:
INFO("unhandled TGSI property %d\n", prop->Property.PropertyName);
break;
info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_PRIMID ||
info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_LAYER ||
info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_VIEWPORT_INDEX ||
+ info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_VIEWPORT_MASK ||
info->out[dst.getIndex(0)].sn == TGSI_SEMANTIC_FOG)
info->out[dst.getIndex(0)].mask &= 1;
#define NVC0_3D_VERTEX_ATTRIB_FORMAT_TYPE_FLOAT 0x38000000
#define NVC0_3D_VERTEX_ATTRIB_FORMAT_BGRA 0x80000000
+#define NVC0_3D_LAYER_VIEWPORT_RELATIVE 0x000011f0
+
#define NVC0_3D_UNK1214 0x00001214
#define NVC0_3D_UNK1218 0x00001218
case TGSI_SEMANTIC_CLIPDIST: return 0x2c0 + si * 0x10;
case TGSI_SEMANTIC_CLIPVERTEX: return 0x270;
case TGSI_SEMANTIC_TEXCOORD: return 0x300 + si * 0x10;
- /* case TGSI_SEMANTIC_VIEWPORT_MASK: return 0x3a0; */
+ case TGSI_SEMANTIC_VIEWPORT_MASK: return 0x3a0;
case TGSI_SEMANTIC_EDGEFLAG: return ~0;
default:
assert(!"invalid TGSI output semantic");
if (info->io.genUserClip < 0)
vp->vp.num_ucps = PIPE_MAX_CLIP_PLANES + 1; /* prevent rebuilding */
+ vp->vp.layer_viewport_relative = info->io.layer_viewport_relative;
+
return 0;
}
uint8_t edgeflag; /* attribute index of edgeflag input */
bool need_vertex_id;
bool need_draw_parameters;
+ bool layer_viewport_relative; /* also applies go gp and tp */
} vp;
struct {
uint8_t early_z;
case PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE:
case PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS:
case PIPE_CAP_VIEWPORT_SWIZZLE:
+ case PIPE_CAP_VIEWPORT_MASK:
return class_3d >= GM200_3D_CLASS;
case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES:
return class_3d >= GP100_3D_CLASS;
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
struct nvc0_program *last;
bool prog_selects_layer = false;
+ bool layer_viewport_relative = false;
if (nvc0->gmtyprog)
last = nvc0->gmtyprog;
else
last = nvc0->vertprog;
- if (last)
+ if (last) {
prog_selects_layer = !!(last->hdr[13] & (1 << 9));
+ layer_viewport_relative = last->vp.layer_viewport_relative;
+ }
BEGIN_NVC0(push, NVC0_3D(LAYER), 1);
PUSH_DATA (push, prog_selects_layer ? NVC0_3D_LAYER_USE_GP : 0);
+ if (nvc0->screen->eng3d->oclass >= GM200_3D_CLASS) {
+ IMMED_NVC0(push, NVC0_3D(LAYER_VIEWPORT_RELATIVE),
+ layer_viewport_relative);
+ }
}
void