nvc0: handle TGSI_SEMANTIC_LAYER
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 7 Feb 2014 22:04:43 +0000 (23:04 +0100)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 7 Feb 2014 22:14:00 +0000 (23:14 +0100)
Cc: 10.1 <mesa-stable@lists.freedesktop.org>
src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h
src/gallium/drivers/nouveau/codegen/nv50_ir_from_tgsi.cpp
src/gallium/drivers/nouveau/codegen/nv50_ir_target_nv50.cpp
src/gallium/drivers/nouveau/nvc0/nvc0_program.c
src/gallium/drivers/nouveau/nvc0/nvc0_shader_state.c

index 752bad3794176c5b9110ebd9e0cf6a11d28517c0..f2f4ead1f0a9d806c6625cefd21b0ccc64967cdd 100644 (file)
@@ -71,7 +71,6 @@ struct nv50_ir_varying
 
 #define NV50_SEMANTIC_CLIPDISTANCE  (TGSI_SEMANTIC_COUNT + 0)
 #define NV50_SEMANTIC_VIEWPORTINDEX (TGSI_SEMANTIC_COUNT + 4)
-#define NV50_SEMANTIC_LAYER         (TGSI_SEMANTIC_COUNT + 5)
 #define NV50_SEMANTIC_INVOCATIONID  (TGSI_SEMANTIC_COUNT + 6)
 #define NV50_SEMANTIC_TESSFACTOR    (TGSI_SEMANTIC_COUNT + 7)
 #define NV50_SEMANTIC_TESSCOORD     (TGSI_SEMANTIC_COUNT + 8)
index d7c06a49658d9c6c7bf9b251c83a7f11d6c6e325..78a6c831fc5a2e6b802acea4c62db4445a505721 100644 (file)
@@ -861,8 +861,8 @@ int Source::inferSysValDirection(unsigned sn) const
    case TGSI_SEMANTIC_INSTANCEID:
    case TGSI_SEMANTIC_VERTEXID:
       return 1;
-#if 0
    case TGSI_SEMANTIC_LAYER:
+#if 0
    case TGSI_SEMANTIC_VIEWPORTINDEX:
       return 0;
 #endif
index 636ef9ee2526473be98dd41f2fba0332ca3d2ef1..de076463f66aad09c8197057c5c07e92842c3ebe 100644 (file)
@@ -532,7 +532,7 @@ recordLocation(uint16_t *locs, uint8_t *masks,
    case TGSI_SEMANTIC_INSTANCEID: locs[SV_INSTANCE_ID] = addr; break;
    case TGSI_SEMANTIC_VERTEXID: locs[SV_VERTEX_ID] = addr; break;
    case TGSI_SEMANTIC_PRIMID: locs[SV_PRIMITIVE_ID] = addr; break;
-   case NV50_SEMANTIC_LAYER: locs[SV_LAYER] = addr; break;
+   case TGSI_SEMANTIC_LAYER: locs[SV_LAYER] = addr; break;
    case NV50_SEMANTIC_VIEWPORTINDEX: locs[SV_VIEWPORT_INDEX] = addr; break;
    default:
       break;
index 71deb3485d5d15caadfb8caad794689f54f856b6..1e7f7d2121319d16d0dbb627b129263806e73997 100644 (file)
@@ -64,7 +64,7 @@ nvc0_shader_output_address(unsigned sn, unsigned si, unsigned ubase)
    switch (sn) {
    case NV50_SEMANTIC_TESSFACTOR:    return 0x000 + si * 0x4;
    case TGSI_SEMANTIC_PRIMID:        return 0x060;
-   case NV50_SEMANTIC_LAYER:         return 0x064;
+   case TGSI_SEMANTIC_LAYER:         return 0x064;
    case NV50_SEMANTIC_VIEWPORTINDEX: return 0x068;
    case TGSI_SEMANTIC_PSIZE:         return 0x06c;
    case TGSI_SEMANTIC_POSITION:      return 0x070;
index b820ef21df8dd02c160421a9853296eb80b2e5bc..a52fed02626295265b26fd82988e0fea6218aff0 100644 (file)
@@ -190,7 +190,7 @@ nvc0_gmtyprog_validate(struct nvc0_context *nvc0)
 
    /* we allow GPs with no code for specifying stream output state only */
    if (gp && gp->code_size) {
-      const boolean gp_selects_layer = gp->hdr[13] & (1 << 9);
+      const boolean gp_selects_layer = !!(gp->hdr[13] & (1 << 9));
 
       BEGIN_NVC0(push, NVC0_3D(MACRO_GP_SELECT), 1);
       PUSH_DATA (push, 0x41);