mesa/src/intel
Alejandro Piñeiro 0629b2a462 nir, glsl: move pixel_center_integer/origin_upper_left to shader_info.fs
On GLSL that info is set as a layout qualifier when redeclaring
gl_FragCoord, so somehow tied to a specific variable. But in practice,
they behave as a global of the shader. On ARB programs they are set
using a global OPTION (defined at ARB_fragment_coord_conventions), and
on SPIR-V using ExecutionModes, that are also not tied specifically to
the builtin.

This patch moves that info from nir variable and ir variable to nir
shader and gl_program shader_info respectively, so the map is more
similar to SPIR-V, and ARB programs, instead of more similar to GLSL.

FWIW, shader_info.fs already had pixel_center_integer, so this change
also removes some redundancy. Also, as struct gl_program also includes
a shader_info, we removed gl_program::OriginUpperLeft and
PixelCenterInteger, as it would be superfluous.

This change was needed because recently spirv_to_nir changed the order
in which execution modes and variables are handled, so the variables
didn't get the correct values. Now the info is set on the shader
itself, and we don't need to go back to the builtin variable to set
it.

Fixes: e68871f6a ("spirv: Handle constants and types before execution
                   modes")

v2: (Jason)
   * glsl_to_nir: get the info before glsl_to_nir, while all the rest
     of the info gathering is happening
   * prog_to_nir: gather the info on a general info-gathering pass,
     not on variable setup.

v3: (Jason)
   * Squash with the patch that removes that info from ir variable
   * anv: assert that OriginUpperLeft is true. It should be already
     set by spirv_to_nir.
   * blorp: set origin_upper_left on its core "compile fragment
     shader", not just on some specific places (for this we added an
     helper on a previous patch).
   * prog_to_nir: no need to gather specifically this fragcoord modes
     as the full gl_program shader_info is copied.
   * spirv_to_nir: assert that we are a fragment shader when handling
     this execution modes.

v4: (reported by failing gitlab pipeline #18750)
   * state_tracker: update too due changes on ir.h/gl_program

v5:
   * blorp: minor change after change on previous patch
   * radeonsi: update due this change.

v6: (Timothy Arceri)
   * prog_to_nir: remove extra whitespace
   * shader_info: don't use :1 on origin_upper_left
   * glsl: program.fs.origin_upper_left/pixel_center_integer can be
     move out of the shader list loop
2019-02-21 11:47:59 +01:00
..
blorp nir, glsl: move pixel_center_integer/origin_upper_left to shader_info.fs 2019-02-21 11:47:59 +01:00
common drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
compiler intel/compiler/test: Add unit test for mismatched signedness comparison 2019-02-15 11:11:02 -08:00
dev drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
genxml genxml: Add SO_PRIM_STORAGE_NEEDED and SO_NUM_PRIMS_WRITTEN 2019-01-22 10:42:57 -06:00
isl isl: remove the cache line size alignment requirement 2019-02-20 08:28:31 +01:00
tools drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
vulkan nir, glsl: move pixel_center_integer/origin_upper_left to shader_info.fs 2019-02-21 11:47:59 +01:00
Android.blorp.mk intel: android: remove libdrm_intel requirement 2017-03-30 19:07:23 +01:00
Android.common.mk android: link libmesa_intel_common with zlib and expat 2017-08-02 10:30:50 +03:00
Android.compiler.mk android: fix build issues with brw_nir_trig_workarounds.c 2017-10-04 07:39:05 +03:00
Android.dev.mk drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
Android.genxml.mk intel/genxml/icl: Generate packing headers 2018-02-15 16:14:55 -08:00
Android.isl.mk intel/isl: move tiled_memcpy static libs from i965 to isl 2019-01-10 08:02:30 +02:00
Android.mk intel: Add missing includes for building on Android 2018-03-06 00:14:22 -08:00
Android.vulkan.mk drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
Makefile.am drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
Makefile.blorp.am blorp: automake: add TODO to the tarball 2017-02-24 17:37:00 +00:00
Makefile.common.am automake: intel: correctly append to the LIBADD variable 2017-11-08 14:23:57 +00:00
Makefile.compiler.am i965/vec4/dce: Don't narrow the write mask if the flags are used 2018-12-17 13:47:06 -08:00
Makefile.dev.am intel: Split gen_device_info out into libintel_dev 2018-03-05 09:47:37 -08:00
Makefile.genxml.am intel: genxml: automake: include gen_bits_header.py in the tarball 2017-04-05 13:16:28 +01:00
Makefile.isl.am intel/isl: move tiled_memcpy static libs from i965 to isl 2019-01-10 08:02:30 +02:00
Makefile.sources intel/isl: move tiled_memcpy static libs from i965 to isl 2019-01-10 08:02:30 +02:00
Makefile.tools.am intel/tools: new i965_disasm tool 2018-08-29 11:19:55 -07:00
Makefile.vulkan.am drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
meson.build intel: compiler option msse2 and mstackrealign 2018-09-07 13:45:46 +01:00