mesa/src/intel/vulkan
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
..
tests anv/tests: compile to something sensible in release builds 2019-02-14 12:52:34 +00:00
.gitignore anv,nir: add generated files to .gitignore(s) 2018-05-12 20:14:49 -07:00
anv_allocator.c anv: Silence some compiler warnings in release builds 2019-02-14 16:04:45 -06:00
anv_android.c anv: drop unneeded KHR suffix 2019-01-08 18:47:56 +00:00
anv_android.h anv/android: support creating images from external format 2018-12-19 09:38:41 +02:00
anv_android_stubs.c anv/android: support creating images from external format 2018-12-19 09:38:41 +02:00
anv_batch_chain.c anv: Implement VK_EXT_buffer_device_address 2019-02-01 17:09:42 -06:00
anv_blorp.c anv/blorp: Delete a pointless assert 2019-02-14 16:04:42 -06:00
anv_cmd_buffer.c anv: Implement the basic form of VK_EXT_transform_feedback 2019-01-22 10:42:56 -06:00
anv_descriptor_set.c anv: Only parse pImmutableSamplers if the descriptor has samplers 2019-01-21 11:45:58 -06:00
anv_device.c anv: implement VK_EXT_depth_clip_enable 2019-02-20 09:57:58 +00:00
anv_dump.c anv: drop unneeded KHR suffix 2019-01-08 18:47:56 +00:00
anv_entrypoints_gen.py anv: Define trampolines as the weak functions 2018-10-19 11:52:00 -05:00
anv_extensions.py anv: drop unused imports 2019-02-20 14:28:55 +00:00
anv_extensions_gen.py anv: Add EXT_acquire_xlib_display to anv driver [v3] 2018-06-19 14:17:46 -07:00
anv_formats.c drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
anv_gem.c vulkan: Add VK_EXT_calibrated_timestamps extension (radv and anv) [v5] 2018-10-17 20:10:15 -07:00
anv_gem_stubs.c vulkan: Add VK_EXT_calibrated_timestamps extension (radv and anv) [v5] 2018-10-17 20:10:15 -07:00
anv_genX.h anv: Implement VK_EXT_conditional_rendering for gen 7.5+ 2019-01-18 18:31:44 +00:00
anv_icd.py anv: fix python whitespace warning 2018-07-25 20:55:35 +01:00
anv_image.c drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
anv_intel.c anv: drop unneeded KHR suffix 2019-01-08 18:47:56 +00:00
anv_nir.h anv/nir: Rework arguments to apply_pipeline_layout 2018-11-22 09:17:28 -06:00
anv_nir_add_base_work_group_id.c anv: Implement vkCmdDispatchBase 2018-03-07 12:13:47 -08:00
anv_nir_apply_pipeline_layout.c anv/device: fix maximum number of images supported 2019-01-17 07:59:00 +01:00
anv_nir_lower_input_attachments.c nir, glsl: move pixel_center_integer/origin_upper_left to shader_info.fs 2019-02-21 11:47:59 +01:00
anv_nir_lower_multiview.c glsl_type: Add support for explicitly laid out matrices and arrays 2019-01-08 00:38:29 +00:00
anv_nir_lower_push_constants.c spirv/i965/anv: Relax push constant offset assertions being 32-bit aligned 2018-02-28 21:37:40 -08:00
anv_nir_lower_ycbcr_textures.c anv: drop unneeded KHR suffix 2019-01-08 18:47:56 +00:00
anv_pass.c anv: Implement VK_KHR_depth_stencil_resolve 2019-01-14 10:16:52 -06:00
anv_pipeline.c anv: implement VK_EXT_depth_clip_enable 2019-02-20 09:57:58 +00:00
anv_pipeline_cache.c anv: use anv_shader_bin_write_to_blob()'s return value 2019-02-20 16:40:13 +00:00
anv_private.h anv: implement VK_EXT_depth_clip_enable 2019-02-20 09:57:58 +00:00
anv_queue.c anv: drop unneeded KHR suffix 2019-01-08 18:47:56 +00:00
anv_util.c anv/util: Split a vk_errorv helper out of vk_errorf 2018-10-26 13:27:21 -05:00
anv_wsi.c vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching 2018-10-18 11:29:00 -05:00
anv_wsi_display.c anv,radv: Add support for VK_KHR_get_display_properties2 2018-07-09 17:09:41 -07:00
anv_wsi_wayland.c anv: drop unused includes 2018-10-24 18:15:05 +01:00
anv_wsi_x11.c vulkan: drop always-true param 2018-10-26 18:33:11 +01:00
gen7_cmd_buffer.c anv/cmd_buffer: check for NULL framebuffer 2019-02-12 19:19:13 +01:00
gen8_cmd_buffer.c anv: Remove state flush. 2019-01-17 15:08:22 -08:00
genX_blorp_exec.c anv: narrow flushing of the render target to buffer writes 2019-01-19 15:45:41 +00:00
genX_cmd_buffer.c anv: Silence some compiler warnings in release builds 2019-02-14 16:04:45 -06:00
genX_gpu_memcpy.c anv: narrow flushing of the render target to buffer writes 2019-01-19 15:45:41 +00:00
genX_pipeline.c anv: implement VK_EXT_depth_clip_enable 2019-02-20 09:57:58 +00:00
genX_query.c anv: Implement transform feedback queries 2019-01-22 10:42:57 -06:00
genX_state.c anv: ignore VkSamplerYcbcrConversion on non-yuv formats 2018-12-19 09:38:41 +02:00
meson.build drm-uapi: use local files, not system libdrm 2019-02-14 11:20:00 +00:00
TODO anv: Implement pipeline statistics queries 2017-03-17 12:12:50 -07:00
vk_format_info.h anv: add from/to helpers with android and vulkan formats 2018-12-19 09:38:41 +02:00