vk/vulkan.h: Remove programPointSize
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Jul 2015 22:57:03 +0000 (15:57 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 7 Jul 2015 23:00:46 +0000 (16:00 -0700)
Instead, we auto-detect whether or not your shader writes gl_PointSize.  If
it does, we use 1.0, otherwise we take it from the shader.

include/vulkan/vulkan.h
src/vulkan/compiler.cpp
src/vulkan/device.c
src/vulkan/pipeline.c
src/vulkan/private.h

index 234814e92cac906c38db1f89ddd44a633156d873..3057a982f3e5b8760b6cc4497a8a558d5eb3bb4b 100644 (file)
@@ -1469,7 +1469,6 @@ typedef struct {
     const void*                                 pNext;
     bool32_t                                    depthClipEnable;
     bool32_t                                    rasterizerDiscardEnable;
-    bool32_t                                    programPointSize;
     VkFillMode                                  fillMode;
     VkCullMode                                  cullMode;
     VkFrontFace                                 frontFace;
index 7ba42151c196cf6e4f2192f1c0812f1b8b881923..558a31001e2a6043073d26079970bd28036bd05a 100644 (file)
@@ -1018,6 +1018,8 @@ anv_compiler_run(struct anv_compiler *compiler, struct anv_pipeline *pipeline)
    int name = 0;
    struct brw_context *brw = compiler->brw;
 
+   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.
     */
@@ -1086,6 +1088,9 @@ anv_compiler_run(struct anv_compiler *compiler, struct anv_pipeline *pipeline)
       fail_if(!success, "do_wm_prog failed\n");
       add_compiled_stage(pipeline, VK_SHADER_STAGE_VERTEX,
                          &pipeline->vs_prog_data.base.base);
+
+      if (vp->Base.OutputsWritten & VARYING_SLOT_PSIZ)
+         pipeline->writes_point_size = true;
    } else {
       memset(&pipeline->vs_prog_data, 0, sizeof(pipeline->vs_prog_data));
       pipeline->vs_simd8 = NO_KERNEL;
@@ -1104,6 +1109,9 @@ anv_compiler_run(struct anv_compiler *compiler, struct anv_pipeline *pipeline)
       fail_if(!success, "do_gs_prog failed\n");
       add_compiled_stage(pipeline, VK_SHADER_STAGE_GEOMETRY,
                          &pipeline->gs_prog_data.base.base);
+
+      if (gp->Base.OutputsWritten & VARYING_SLOT_PSIZ)
+         pipeline->writes_point_size = true;
    } else {
       pipeline->gs_vec4 = NO_KERNEL;
    }
index 4c0082779a842352868b6249e09080902a245840..9654637b6e1fc62be10dd64208cb52e27ded4a5e 100644 (file)
@@ -2034,7 +2034,6 @@ VkResult anv_CreateDynamicRasterState(
    struct GEN8_3DSTATE_SF sf = {
       GEN8_3DSTATE_SF_header,
       .LineWidth = pCreateInfo->lineWidth,
-      .PointWidth = 1.0,
    };
 
    GEN8_3DSTATE_SF_pack(NULL, state->state_sf, &sf);
index c500c7a0a33d1fac5b3f6415c20e7f0183f2a1bf..665ee773fe47bd4b473f5fd4247e7f3b77d64282 100644 (file)
@@ -184,7 +184,8 @@ emit_rs_state(struct anv_pipeline *pipeline, VkPipelineRsStateCreateInfo *info,
       .TriangleStripListProvokingVertexSelect = 0,
       .LineStripListProvokingVertexSelect = 0,
       .TriangleFanProvokingVertexSelect = 0,
-      .PointWidthSource = info->programPointSize ? Vertex : State,
+      .PointWidthSource = pipeline->writes_point_size ? Vertex : State,
+      .PointWidth = 1.0,
    };
 
    /* FINISHME: bool32_t rasterizerDiscardEnable; */
index a9c9f26bc7360096630937550f788166cdc9ed26..2663d97834ff1ccc13ce312047c4fcc4b1477eea 100644 (file)
@@ -733,6 +733,7 @@ struct anv_pipeline {
    struct brw_wm_prog_data                      wm_prog_data;
    struct brw_gs_prog_data                      gs_prog_data;
    struct brw_cs_prog_data                      cs_prog_data;
+   bool                                         writes_point_size;
    struct brw_stage_prog_data *                 prog_data[VK_SHADER_STAGE_NUM];
    uint32_t                                     scratch_start[VK_SHADER_STAGE_NUM];
    uint32_t                                     total_scratch;