mesa.git
4 years agoAttempt to fix the AppVeyor build
Nicolai Hähnle [Mon, 31 Jul 2017 14:51:13 +0000 (16:51 +0200)]
Attempt to fix the AppVeyor build

4 years agoxmlconfig: move into src/util
Nicolai Hähnle [Fri, 30 Jun 2017 09:57:06 +0000 (11:57 +0200)]
xmlconfig: move into src/util

v2: attempt to fix Android build (Emil)

v3: add missing include path

Reviewed-by: Marek Olšák <marek.olsak@amd.com> (v1)
4 years agoxmlconfig: remove GL type dependencies
Nicolai Hähnle [Fri, 30 Jun 2017 09:56:50 +0000 (11:56 +0200)]
xmlconfig: remove GL type dependencies

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: ensure that temp array allocas are in the entry block
Nicolai Hähnle [Sat, 29 Jul 2017 07:17:53 +0000 (09:17 +0200)]
radeonsi: ensure that temp array allocas are in the entry block

Otherwise, code generation fails. This has become necessary since some
shaders are wrapped in control flow.

Fixes: 081ac6e5c6d2 ("radeonsi/gfx9: always wrap GS and TCS in an if-block (v2)")
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: enable R600_DEBUG=nir for vertex and fragment shaders
Nicolai Hähnle [Mon, 15 May 2017 23:51:41 +0000 (01:51 +0200)]
radeonsi: enable R600_DEBUG=nir for vertex and fragment shaders

Also, disable geometry and tessellation shaders. Mixing and matching NIR
and TGSI shaders should work (and I've tested it for the VS/PS interface),
but geometry and tessellation requires VS-as-ES/LS, which isn't implemented
yet for NIR.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: VS as ES/LS are not yet supported with R600_DEBUG=nir
Nicolai Hähnle [Mon, 15 May 2017 23:19:04 +0000 (01:19 +0200)]
radeonsi: VS as ES/LS are not yet supported with R600_DEBUG=nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: lower uniforms to UBO loads
Nicolai Hähnle [Tue, 4 Jul 2017 09:09:50 +0000 (11:09 +0200)]
radeonsi/nir: lower uniforms to UBO loads

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: implement load_frag_coord intrinsic
Nicolai Hähnle [Tue, 4 Jul 2017 09:09:24 +0000 (11:09 +0200)]
ac/nir: implement load_frag_coord intrinsic

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: lower txp instructions
Nicolai Hähnle [Mon, 3 Jul 2017 13:32:29 +0000 (15:32 +0200)]
radeonsi/nir: lower txp instructions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_llvm_context to unpack_param
Nicolai Hähnle [Sun, 25 Jun 2017 17:50:16 +0000 (19:50 +0200)]
ac/nir: pass ac_llvm_context to unpack_param

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir,radeonsi: add and use ac_shader_abi::frag_pos
Nicolai Hähnle [Sun, 25 Jun 2017 17:48:09 +0000 (19:48 +0200)]
ac/nir,radeonsi: add and use ac_shader_abi::frag_pos

v2: update for LLVMValueRefs in ac_shader_abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir,radeonsi: add and use ac_shader_abi::{ancillary,sample_coverage}
Nicolai Hähnle [Sun, 25 Jun 2017 17:40:40 +0000 (19:40 +0200)]
ac/nir,radeonsi: add and use ac_shader_abi::{ancillary,sample_coverage}

v2: update for LLVMValueRefs in ac_shader_abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir,radv: move force_persample to ac_shader_info::force_persample
Nicolai Hähnle [Sun, 25 Jun 2017 17:36:06 +0000 (19:36 +0200)]
ac/nir,radv: move force_persample to ac_shader_info::force_persample

Avoid accessing radv-specific structures during the meat of NIR-to-LLVM
translation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: tweak next-shader assumptions when streamout is used
Nicolai Hähnle [Sun, 25 Jun 2017 17:01:13 +0000 (19:01 +0200)]
radeonsi: tweak next-shader assumptions when streamout is used

VS with streamout is always a HW VS.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: use new function ac_build_umin for edgeflag clamping
Nicolai Hähnle [Sun, 25 Jun 2017 15:56:37 +0000 (17:56 +0200)]
radeonsi: use new function ac_build_umin for edgeflag clamping

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: clamp shadow texture comparison value on VI
Nicolai Hähnle [Sun, 25 Jun 2017 13:45:09 +0000 (15:45 +0200)]
ac/nir: clamp shadow texture comparison value on VI

Needed for TC-compatible HTILE in radeonsi for test cases like
piglit spec/arb_texture_rg/execution/fs-shadow2d-red-01.shader_test

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: add always_vector argument to ac_build_gather_values_extended
Nicolai Hähnle [Sun, 25 Jun 2017 11:04:51 +0000 (13:04 +0200)]
ac/nir: add always_vector argument to ac_build_gather_values_extended

This simplifies a bunch of places that no longer need special treatment
of value_count == 1. We rely on LLVM to optimize away the 1-element vector
types.

This fixes a bunch of bugs where 1-element arrays are indexed indirectly.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir,radeonsi: add ac_shader_abi::front_face
Nicolai Hähnle [Sun, 25 Jun 2017 10:56:49 +0000 (12:56 +0200)]
ac/nir,radeonsi: add ac_shader_abi::front_face

v2: update for LLVMValueRefs in ac_shader_abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to emit_ddxy
Nicolai Hähnle [Sat, 24 Jun 2017 20:57:33 +0000 (22:57 +0200)]
ac/nir: pass ac_nir_context to emit_ddxy

Allocating the ddxy_lds is considered to be part of the API shader
translation and not part of the ABI.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to SSBO intrinsic handlers
Nicolai Hähnle [Sat, 24 Jun 2017 18:16:29 +0000 (20:16 +0200)]
ac/nir: pass ac_nir_context to SSBO intrinsic handlers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: implement and use ac_shader_abi::load_ssbo
Nicolai Hähnle [Sat, 24 Jun 2017 18:03:46 +0000 (20:03 +0200)]
radeonsi: implement and use ac_shader_abi::load_ssbo

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: make get_indirect_index globally visible
Nicolai Hähnle [Sat, 24 Jun 2017 18:08:30 +0000 (20:08 +0200)]
radeonsi: make get_indirect_index globally visible

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: load buffer descriptors via ac_shader_abi::load_ssbo
Nicolai Hähnle [Sat, 24 Jun 2017 17:17:54 +0000 (19:17 +0200)]
ac/nir: load buffer descriptors via ac_shader_abi::load_ssbo

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to emit_discard_if
Nicolai Hähnle [Sat, 24 Jun 2017 16:40:17 +0000 (18:40 +0200)]
ac/nir: pass ac_nir_context to emit_discard_if

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: extract shader_info->fs.can_discard from NIR shader info
Nicolai Hähnle [Sat, 24 Jun 2017 16:38:38 +0000 (18:38 +0200)]
ac/nir: extract shader_info->fs.can_discard from NIR shader info

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: perform radeonsi-specific lowering and optimization passes
Nicolai Hähnle [Sat, 24 Jun 2017 15:48:22 +0000 (17:48 +0200)]
radeonsi/nir: perform radeonsi-specific lowering and optimization passes

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: perform lowering of input/output driver locations
Nicolai Hähnle [Sat, 24 Jun 2017 15:30:16 +0000 (17:30 +0200)]
radeonsi/nir: perform lowering of input/output driver locations

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: handle old-style shadow tex instructions correctly
Nicolai Hähnle [Sat, 24 Jun 2017 15:29:43 +0000 (17:29 +0200)]
ac/nir: handle old-style shadow tex instructions correctly

The first element is only extracted for new-style shadow tex.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: whitespace fixes
Nicolai Hähnle [Sat, 24 Jun 2017 12:50:45 +0000 (14:50 +0200)]
ac/nir: whitespace fixes

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: use shader_info pass to determine whether instance_id is used
Nicolai Hähnle [Mon, 26 Jun 2017 12:36:47 +0000 (14:36 +0200)]
ac/nir: use shader_info pass to determine whether instance_id is used

This improves the separation of ABI and NIR translation.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: move setting shader_info->fs.writes_memory to radv-specific code
Nicolai Hähnle [Fri, 9 Jun 2017 15:50:18 +0000 (17:50 +0200)]
ac/nir: move setting shader_info->fs.writes_memory to radv-specific code

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: add image descriptor loading
Nicolai Hähnle [Fri, 9 Jun 2017 15:48:11 +0000 (17:48 +0200)]
radeonsi/nir: add image descriptor loading

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: add image and write parameter to ac_shader_abi::load_sampler_desc
Nicolai Hähnle [Fri, 9 Jun 2017 15:47:34 +0000 (17:47 +0200)]
ac/nir: add image and write parameter to ac_shader_abi::load_sampler_desc

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: add support for arrays-of-arrays to get_sampler_desc
Nicolai Hähnle [Fri, 9 Jun 2017 13:16:51 +0000 (15:16 +0200)]
ac/nir: add support for arrays-of-arrays to get_sampler_desc

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: set si_shader_context::num_{sampler,images}
Nicolai Hähnle [Fri, 9 Jun 2017 13:16:14 +0000 (15:16 +0200)]
radeonsi/nir: set si_shader_context::num_{sampler,images}

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: implement ac_shader_abi::load_sampler_desc
Nicolai Hähnle [Thu, 8 Jun 2017 23:52:06 +0000 (01:52 +0200)]
radeonsi/nir: implement ac_shader_abi::load_sampler_desc

v2: remove enum desc_type from radeonsi (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to tex_fetch_ptrs and related functions
Nicolai Hähnle [Thu, 8 Jun 2017 23:41:55 +0000 (01:41 +0200)]
ac/nir: pass ac_nir_context to tex_fetch_ptrs and related functions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: add and use ac_shader_abi::load_sampler_desc
Nicolai Hähnle [Thu, 8 Jun 2017 23:31:45 +0000 (01:31 +0200)]
ac/nir: add and use ac_shader_abi::load_sampler_desc

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to visit_tex and various related functions
Nicolai Hähnle [Thu, 8 Jun 2017 18:06:39 +0000 (20:06 +0200)]
ac/nir: pass ac_nir_context to visit_tex and various related functions

Get most of the churn out of the way before actually loading samplers
via the ABI.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir,radeonsi: add ac_shader_abi::chip_class
Nicolai Hähnle [Thu, 8 Jun 2017 18:05:09 +0000 (20:05 +0200)]
ac/nir,radeonsi: add ac_shader_abi::chip_class

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: emit FS outputs
Nicolai Hähnle [Thu, 8 Jun 2017 17:38:51 +0000 (19:38 +0200)]
radeonsi/nir: emit FS outputs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: load FS inputs
Nicolai Hähnle [Thu, 8 Jun 2017 17:10:33 +0000 (19:10 +0200)]
radeonsi/nir: load FS inputs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi/nir: load VS inputs
Nicolai Hähnle [Thu, 8 Jun 2017 16:38:06 +0000 (18:38 +0200)]
radeonsi/nir: load VS inputs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir,radeonsi: add ac_shader_abi::load_ubo
Nicolai Hähnle [Sat, 20 May 2017 15:19:50 +0000 (17:19 +0200)]
ac/nir,radeonsi: add ac_shader_abi::load_ubo

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to visit_load_ubo_buffer
Nicolai Hähnle [Sat, 20 May 2017 07:25:25 +0000 (09:25 +0200)]
ac/nir: pass ac_nir_context to visit_load_ubo_buffer

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to visit_{load,store}_var and get_deref_offset helper
Nicolai Hähnle [Fri, 19 May 2017 17:40:06 +0000 (19:40 +0200)]
ac/nir: pass ac_nir_context to visit_{load,store}_var and get_deref_offset helper

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_llvm_context to some helper functions
Nicolai Hähnle [Fri, 19 May 2017 17:39:16 +0000 (19:39 +0200)]
ac/nir: pass ac_llvm_context to some helper functions

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_nir_context to visit_intrinsic
Nicolai Hähnle [Fri, 19 May 2017 17:25:43 +0000 (19:25 +0200)]
ac/nir: pass ac_nir_context to visit_intrinsic

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: add ac_nir_context::main_function
Nicolai Hähnle [Fri, 19 May 2017 17:22:09 +0000 (19:22 +0200)]
ac/nir: add ac_nir_context::main_function

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: split scanning outputs from setting up output allocas
Nicolai Hähnle [Fri, 19 May 2017 16:48:13 +0000 (18:48 +0200)]
ac/nir: split scanning outputs from setting up output allocas

The scanning phase sets the driver_location, because it is part of the
ABI: radeonsi does the assignment differently.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: pass ac_llvm_context to *build_alloca* helpers
Nicolai Hähnle [Fri, 19 May 2017 16:47:02 +0000 (18:47 +0200)]
ac/nir: pass ac_llvm_context to *build_alloca* helpers

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: use ac_shader_abi::emit_outputs
Nicolai Hähnle [Fri, 19 May 2017 16:37:49 +0000 (18:37 +0200)]
ac/nir: use ac_shader_abi::emit_outputs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac,radeonsi: add ac_shader_abi::emit_outputs for hardware VS shaders
Nicolai Hähnle [Fri, 19 May 2017 16:32:57 +0000 (18:32 +0200)]
ac,radeonsi: add ac_shader_abi::emit_outputs for hardware VS shaders

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: pass si_shader_context to get_primitive_id
Nicolai Hähnle [Fri, 19 May 2017 16:17:12 +0000 (18:17 +0200)]
radeonsi: pass si_shader_context to get_primitive_id

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: translate NIR to LLVM
Nicolai Hähnle [Fri, 19 May 2017 15:43:51 +0000 (17:43 +0200)]
radeonsi: translate NIR to LLVM

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: dump NIR instead of TGSI when appropriate
Nicolai Hähnle [Fri, 19 May 2017 15:42:20 +0000 (17:42 +0200)]
radeonsi: dump NIR instead of TGSI when appropriate

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: bypass the shader cache for NIR shaders
Nicolai Hähnle [Fri, 19 May 2017 15:28:54 +0000 (17:28 +0200)]
radeonsi: bypass the shader cache for NIR shaders

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: scan NIR shaders to obtain required info
Nicolai Hähnle [Wed, 17 May 2017 15:46:15 +0000 (17:46 +0200)]
radeonsi: scan NIR shaders to obtain required info

v2: set num_instruction to 2, i.e. 1 + END (Marek)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: add ac_shader_abi::inputs
Nicolai Hähnle [Thu, 8 Jun 2017 16:23:34 +0000 (18:23 +0200)]
ac/nir: add ac_shader_abi::inputs

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: begin splitting off ac_nir_context
Nicolai Hähnle [Fri, 19 May 2017 15:03:20 +0000 (17:03 +0200)]
ac/nir: begin splitting off ac_nir_context

The eventual goal is to hide all radv-specific details behind
ac_nir_context::abi, so that the NIR->LLVM code can be re-used by
radeonsi.

During development, we live with a partial split, where some of the
NIR->LLVM code still relies on linking back to the nir_to_llvm_context
(which should ultimately be renamed to reflect that it's radv-specific).
The idea is to get rid of these backlinks over time.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: add si_shader_selector::nir
Nicolai Hähnle [Tue, 16 May 2017 00:06:15 +0000 (02:06 +0200)]
radeonsi: add si_shader_selector::nir

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: implement pipe_screen::get_compiler_options for NIR
Nicolai Hähnle [Tue, 16 May 2017 00:04:48 +0000 (02:04 +0200)]
radeonsi: implement pipe_screen::get_compiler_options for NIR

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: add nir include paths
Nicolai Hähnle [Tue, 16 May 2017 00:06:35 +0000 (02:06 +0200)]
radeonsi: add nir include paths

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac/nir: start using ac_shader_abi
Nicolai Hähnle [Mon, 15 May 2017 22:28:50 +0000 (00:28 +0200)]
ac/nir: start using ac_shader_abi

v2: update for LLVMValueRefs in ac_shader_abi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoac,radeonsi: move some VS input descriptions to ac_shader_abi
Nicolai Hähnle [Mon, 15 May 2017 22:19:01 +0000 (00:19 +0200)]
ac,radeonsi: move some VS input descriptions to ac_shader_abi

v2: use LLVM values instead of function parameter indices

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agoradeonsi: store shader function arguments in a structure
Nicolai Hähnle [Mon, 3 Jul 2017 14:54:37 +0000 (16:54 +0200)]
radeonsi: store shader function arguments in a structure

Aligns the code a bit more with ac/nir, and simplifies the setup of
ac_shader_abi.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium/targets: link against NIR when building radeonsi
Nicolai Hähnle [Tue, 16 May 2017 00:04:14 +0000 (02:04 +0200)]
gallium/targets: link against NIR when building radeonsi

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agost/glsl_to_nir: move nir_lower_io to drivers
Nicolai Hähnle [Tue, 4 Jul 2017 08:23:49 +0000 (10:23 +0200)]
st/glsl_to_nir: move nir_lower_io to drivers

This allows drivers more freedom in how exactly they want to lower I/O,
e.g. first lowering I/O to temporaries.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agost/mesa: get rid of st_glsl_types
Nicolai Hähnle [Tue, 4 Jul 2017 08:22:02 +0000 (10:22 +0200)]
st/mesa: get rid of st_glsl_types

It's a duplicate of glsl_type::count_attribute_slots.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agost/glsl_to_nir: use nir_lower_samplers_as_deref when requested by the driver
Nicolai Hähnle [Fri, 19 May 2017 20:42:12 +0000 (22:42 +0200)]
st/glsl_to_nir: use nir_lower_samplers_as_deref when requested by the driver

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agost/glsl_to_nir: fix the case where NIR clone testing is enabled
Nicolai Hähnle [Sun, 25 Jun 2017 13:26:47 +0000 (15:26 +0200)]
st/glsl_to_nir: fix the case where NIR clone testing is enabled

In that case, prog->nir must be assigned at the end.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agogallium: add PIPE_CAP_NIR_SAMPLERS_AS_DEREF
Nicolai Hähnle [Sun, 25 Jun 2017 16:31:11 +0000 (18:31 +0200)]
gallium: add PIPE_CAP_NIR_SAMPLERS_AS_DEREF

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
4 years agonir: add nir_lower_uniforms_to_ubo pass
Nicolai Hähnle [Sat, 20 May 2017 15:58:25 +0000 (17:58 +0200)]
nir: add nir_lower_uniforms_to_ubo pass

This is a further lowering of default-block uniform loads that transforms
load_uniform intrinsics into load_ubo intrinsics. This simplifies the rest
of the backend.

v2: transform from load_uniform instead of straight from variables

Reviewed-by: Eric Anholt <eric@anholt.net>
4 years agonir: add nir_lower_samplers_as_deref pass
Nicolai Hähnle [Fri, 9 Jun 2017 09:35:25 +0000 (11:35 +0200)]
nir: add nir_lower_samplers_as_deref pass

This pass is a replacement for the nir_lower_samplers pass, which has the
advantage of keeping sampler references as derefs. This allows a unified
treatment of texture instructions and image intrinsics in the backend.

4 years agonir: add load_frag_coord system value intrinsic
Nicolai Hähnle [Tue, 4 Jul 2017 08:34:02 +0000 (10:34 +0200)]
nir: add load_frag_coord system value intrinsic

Some drivers prefer to treat gl_FragCoord as a system value rather than
a fragment shader input, see Const.GLSLFragCoordIsSysVal.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
4 years agonir: fix nir_lower_wpos_ytransform when gl_FragCoord is a system value
Nicolai Hähnle [Sun, 25 Jun 2017 13:26:01 +0000 (15:26 +0200)]
nir: fix nir_lower_wpos_ytransform when gl_FragCoord is a system value

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
4 years agonir: add nir_instr_rewrite_deref
Nicolai Hähnle [Fri, 9 Jun 2017 13:13:08 +0000 (15:13 +0200)]
nir: add nir_instr_rewrite_deref

Allows modifying a texture instruction's texture and sampler derefs.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
4 years agomesa: add KHR_no_error support to glPointSize()
Samuel Pitoiset [Thu, 20 Jul 2017 08:19:23 +0000 (10:19 +0200)]
mesa: add KHR_no_error support to glPointSize()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add point_size() helper
Samuel Pitoiset [Thu, 20 Jul 2017 08:18:10 +0000 (10:18 +0200)]
mesa: add point_size() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glVertexArrayElementBuffer()
Samuel Pitoiset [Wed, 19 Jul 2017 13:45:01 +0000 (15:45 +0200)]
mesa: add KHR_no_error support to glVertexArrayElementBuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add vertex_array_element_buffer() helper
Samuel Pitoiset [Wed, 19 Jul 2017 13:43:28 +0000 (15:43 +0200)]
mesa: add vertex_array_element_buffer() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glTextureSubImage*D()
Samuel Pitoiset [Wed, 19 Jul 2017 13:36:01 +0000 (15:36 +0200)]
mesa: add KHR_no_error support to glTextureSubImage*D()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add texturesubimage_error() helper
Samuel Pitoiset [Wed, 19 Jul 2017 13:27:54 +0000 (15:27 +0200)]
mesa: add texturesubimage_error() helper

And make texturesubimage() always inline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glDetachShader() and glDetachObjectARB()
Samuel Pitoiset [Wed, 19 Jul 2017 12:42:07 +0000 (14:42 +0200)]
mesa: add KHR_no_error support to glDetachShader() and glDetachObjectARB()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add detach_shader_error() helper
Samuel Pitoiset [Wed, 19 Jul 2017 12:37:21 +0000 (14:37 +0200)]
mesa: add detach_shader_error() helper

And make detach_shader() always inline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glDrawTransformFeedback*()
Samuel Pitoiset [Wed, 19 Jul 2017 12:28:57 +0000 (14:28 +0200)]
mesa: add KHR_no_error support to glDrawTransformFeedback*()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glNamedFramebufferDrawBuffers()
Samuel Pitoiset [Wed, 19 Jul 2017 11:50:12 +0000 (13:50 +0200)]
mesa: add KHR_no_error support to glNamedFramebufferDrawBuffers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glDrawBuffers()
Samuel Pitoiset [Wed, 19 Jul 2017 11:46:25 +0000 (13:46 +0200)]
mesa: add KHR_no_error support to glDrawBuffers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add draw_buffers_error() helper
Samuel Pitoiset [Wed, 19 Jul 2017 11:44:01 +0000 (13:44 +0200)]
mesa: add draw_buffers_error() helper

And make draw_buffers() always inline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glDeleteBuffers()
Samuel Pitoiset [Wed, 19 Jul 2017 11:35:11 +0000 (13:35 +0200)]
mesa: add KHR_no_error support to glDeleteBuffers()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add delete_buffers() helper
Samuel Pitoiset [Wed, 19 Jul 2017 11:32:28 +0000 (13:32 +0200)]
mesa: add delete_buffers() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glNamedFramebufferRenderbuffer()
Samuel Pitoiset [Wed, 19 Jul 2017 10:32:42 +0000 (12:32 +0200)]
mesa: add KHR_no_error support to glNamedFramebufferRenderbuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glFramebufferRenderbuffer()
Samuel Pitoiset [Wed, 19 Jul 2017 10:28:21 +0000 (12:28 +0200)]
mesa: add KHR_no_error support to glFramebufferRenderbuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add framebuffer_renderbuffer_error() helper
Samuel Pitoiset [Wed, 19 Jul 2017 10:24:31 +0000 (12:24 +0200)]
mesa: add framebuffer_renderbuffer_error() helper

And make framebuffer_renderbuffer() always inline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glDeleteTextures()
Samuel Pitoiset [Wed, 19 Jul 2017 09:57:22 +0000 (11:57 +0200)]
mesa: add KHR_no_error support to glDeleteTextures()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add delete_textures() helper
Samuel Pitoiset [Wed, 19 Jul 2017 09:55:05 +0000 (11:55 +0200)]
mesa: add delete_textures() helper

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glNamedFramebufferDrawBuffer()
Samuel Pitoiset [Wed, 19 Jul 2017 09:19:16 +0000 (11:19 +0200)]
mesa: add KHR_no_error support to glNamedFramebufferDrawBuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glDrawBuffer()
Samuel Pitoiset [Wed, 19 Jul 2017 09:14:48 +0000 (11:14 +0200)]
mesa: add KHR_no_error support to glDrawBuffer()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add draw_buffer_error() helper
Samuel Pitoiset [Wed, 19 Jul 2017 09:12:16 +0000 (11:12 +0200)]
mesa: add draw_buffer_error() helper

And make draw_buffer() always inline.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
4 years agomesa: add KHR_no_error support to glBindTextures()
Samuel Pitoiset [Fri, 21 Jul 2017 09:05:39 +0000 (11:05 +0200)]
mesa: add KHR_no_error support to glBindTextures()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>