anv: Always use point size from the shader
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Sat, 5 Mar 2016 06:07:02 +0000 (22:07 -0800)
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Sat, 5 Mar 2016 21:54:24 +0000 (13:54 -0800)
There is no API for setting the point size and the shader is always
required to set it. Section 24.4:

   "If the value written to PointSize is less than or equal to zero, or
    if no value was written to PointSize, results are undefined."

As such, we can just always program PointWidthSource to Vertex. This
simplifies anv_pipeline a bit and avoids trouble when we enable the
pipeline cache and don't have writes_point_size in the prog_data.

src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/gen7_pipeline.c
src/intel/vulkan/gen8_pipeline.c

index f3f5ecdf6604831b6032789b476fb08d4f403a2b..183589611a12a0c575ddd7f26bbe96de893e9f8e 100644 (file)
@@ -469,8 +469,6 @@ anv_pipeline_compile_vs(struct anv_pipeline *pipeline,
          ralloc_steal(mem_ctx, nir);
 
       prog_data.inputs_read = nir->info.inputs_read;
-      if (nir->info.outputs_written & (1ull << VARYING_SLOT_PSIZ))
-         pipeline->writes_point_size = true;
 
       brw_compute_vue_map(&pipeline->device->info,
                           &prog_data.base.vue_map,
@@ -556,9 +554,6 @@ anv_pipeline_compile_gs(struct anv_pipeline *pipeline,
       if (module->nir == NULL)
          ralloc_steal(mem_ctx, nir);
 
-      if (nir->info.outputs_written & (1ull << VARYING_SLOT_PSIZ))
-         pipeline->writes_point_size = true;
-
       brw_compute_vue_map(&pipeline->device->info,
                           &prog_data.base.vue_map,
                           nir->info.outputs_written,
@@ -1122,7 +1117,6 @@ anv_pipeline_init(struct anv_pipeline *pipeline,
       anv_finishme("VK_STRUCTURE_TYPE_PIPELINE_TESSELLATION_STATE_CREATE_INFO");
 
    pipeline->use_repclear = extra && extra->use_repclear;
-   pipeline->writes_point_size = false;
 
    /* When we free the pipeline, we detect stages based on the NULL status
     * of various prog_data pointers.  Make them NULL by default.
index b112b457b992f7f989565041b12dd9a29d350cfc..8c3318816c6534e0acee075cfebb41a02ef51252 100644 (file)
@@ -1409,7 +1409,6 @@ struct anv_pipeline {
 
    bool                                         use_repclear;
 
-   bool                                         writes_point_size;
    const struct brw_stage_prog_data *           prog_data[MESA_SHADER_STAGES];
    uint32_t                                     scratch_start[MESA_SHADER_STAGES];
    uint32_t                                     total_scratch;
index 5f480edf809bfbead4793a43e9b36a58a58d0f96..37e4639b287cc283c26ff0a736e3675e1be75bd2 100644 (file)
@@ -65,7 +65,7 @@ gen7_emit_rs_state(struct anv_pipeline *pipeline,
 
       /* uint32_t                                     AALineDistanceMode; */
       /* uint32_t                                     VertexSubPixelPrecisionSelect; */
-      .UsePointWidthState                       = !pipeline->writes_point_size,
+      .UsePointWidthState                       = false,
       .PointWidth                               = 1.0,
       .GlobalDepthOffsetEnableSolid             = info->depthBiasEnable,
       .GlobalDepthOffsetEnableWireframe         = info->depthBiasEnable,
index 5ce1307f09062cc159d778b271d4816c5ff5dfa4..8edc1574ac3210afda4b6ce61092f7a1b8762703 100644 (file)
@@ -60,7 +60,7 @@ emit_rs_state(struct anv_pipeline *pipeline,
       .TriangleStripListProvokingVertexSelect = 0,
       .LineStripListProvokingVertexSelect = 0,
       .TriangleFanProvokingVertexSelect = 1,
-      .PointWidthSource = pipeline->writes_point_size ? Vertex : State,
+      .PointWidthSource = Vertex,
       .PointWidth = 1.0,
    };