mesa/src
Jason Ekstrand 3b80481965 anv: Default PointSize to 1.0 if not written by the shader
The Vulkan rules for point size are a bit whacky.  If you only have a
vertex shader and you use points, then you must write PointSize in your
vertex shader.  If you have a geometry or tessellation shader, then it's
dependent on the shaderTessellationAndGeometryPointSize device feature.
From the Vulkan 1.0.38 specification:

   "shaderTessellationAndGeometryPointSize indicates whether the
   PointSize built-in decoration is available in the tessellation
   control, tessellation evaluation, and geometry shader stages. If this
   feature is not enabled, members decorated with the PointSize built-in
   decoration must not be read from or written to and all points written
   from a tessellation or geometry shader will have a size of 1.0. This
   also indicates whether shader modules can declare the
   TessellationPointSize capability for tessellation control and
   evaluation shaders, or if the shader modules can declare the
   GeometryPointSize capability for geometry shaders. An implementation
   supporting this feature must also support one or both of the
   tessellationShader or geometryShader features."

In other words, if the feature is disbled (the client can disable
features!) then they don't write PointSize and we provide a 1.0 default
but if the feature is enabled, they do write PointSize and we use the
one they wrote in the shader.  There are at least two valid ways we can
implement this:

 1) Track whether or not shaderTessellationAndGeometryPointSize is
    enabled and set the 3DSTATE_SF bits based on that and what stages
    are enabled, ignoring the shader source.

 2) Just look at the last geometry stage VUE map and see if they wrote
    PointSize and set the 3DSTATE_SF accordingly.

The second solution is the easiest and the most robust against invalid
usage of the Vulkan API, so we choose to go with that one.

This fixes all of the dEQP-VK.tessellation.primitive_discard.*point_mode
tests.  The tests are also broken because they unconditionally enable
shaderTessellationAndGeometryPointSize if it's supported by the
implementation and then don't write PointSize in the evaluation shader.
However, since this is the "robust against invalid API usage" solution,
the tests happily pass. :-)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-01-13 16:31:17 -08:00
..
amd radv: Support loader interface version 3. 2017-01-13 19:11:17 +01:00
compiler nir/gcm: Fix a typo in a comment 2017-01-12 14:56:55 -08:00
egl egl/dri2: Unify the style of function pointer calls in structs 2017-01-13 16:24:22 +00:00
gallium st/va: flush pipeline after post processing 2017-01-13 14:21:29 +01:00
gbm gbm: request correct version of the DRI2_FENCE extension 2016-11-22 15:56:44 +00:00
getopt Introduce .editorconfig 2016-08-31 17:06:54 -07:00
glx dri3: Fix MakeCurrent without a default framebuffer 2017-01-05 20:52:01 +01:00
gtest Introduce .editorconfig 2016-08-31 17:06:54 -07:00
hgl glapi/hgl: remove the final user of _glapi_check_table() 2016-10-06 15:03:46 +01:00
intel anv: Default PointSize to 1.0 if not written by the shader 2017-01-13 16:31:17 -08:00
loader loader/dri3: Unify the style of function pointer calls in structs 2017-01-13 16:24:32 +00:00
mapi glX_proto_send.py: Unify the style of function pointer calls in structs 2017-01-13 16:24:32 +00:00
mesa i965/vec4: Fix mapping attributes 2017-01-13 16:23:32 -08:00
util util: fix list_is_singular() 2017-01-12 13:58:32 +11:00
vulkan/wsi vulkan: Add new cast macros for VkIcd types 2017-01-12 09:42:32 -08:00
Makefile.am amd: flatten amd/common makefile structure 2016-11-15 20:04:37 +00:00
SConscript scons: put the generated git_sha1.h file in top-level src/ directory 2016-06-17 10:33:00 -06:00