aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler
Commit message (Collapse)AuthorAgeFilesLines
* glsl: fix constant packing for 64-bit big endian.Dave Airlie2020-07-012-10/+25
| | | | | | | | | In a piglit run on s390 a lot of double tests fail, explicitly packing/shifting things rather than using memcpy seems to help Cc: <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5679>
* nir: Propagate *2*16 conversions into vectorsAlyssa Rosenzweig2020-06-301-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have code like: ('f2f16', ('vec2', ('f2f32', 'a@16'), '#b@32')) We would like to eliminate the conversions, but the existing rules can't see into the the (heterogenous) vector. So instead of trying to eliminate in one pass, we add opts to propagate the f2f16 into the vector. Even if nothing further happens, this is often a win since then the created vector is smaller (half2 instead of float2). Hence the above gets transformed to ('vec2', ('f2f16', ('f2f32', 'a@16')), ('f2f16', '#b@32')) Then the existing f2f16(f2f32) rule will kick in for the first component and constant folding will for the second and we'll be left with ('vec2', 'a@16', '#b@16') ...eliminating all conversions. v2: Predicate on !options->vectorize_vec2_16bit. As discussed, this optimization helps greatly on true vector architectures (like Midgard) but wreaks havoc on more modern SIMD-within-a-register architectures (like Bifrost and modern AMD). So let's predicate on that. v3: Extend for integers as well and add a comment explaining the transforms. Results on Midgard (unfortunately a true SIMD architecture): total instructions in shared programs: 51359 -> 50963 (-0.77%) instructions in affected programs: 4523 -> 4127 (-8.76%) helped: 53 HURT: 0 helped stats (abs) min: 1 max: 86 x̄: 7.47 x̃: 6 helped stats (rel) min: 1.71% max: 28.00% x̄: 9.66% x̃: 7.34% 95% mean confidence interval for instructions value: -10.58 -4.36 95% mean confidence interval for instructions %-change: -11.45% -7.88% Instructions are helped. total bundles in shared programs: 25825 -> 25670 (-0.60%) bundles in affected programs: 2057 -> 1902 (-7.54%) helped: 53 HURT: 0 helped stats (abs) min: 1 max: 26 x̄: 2.92 x̃: 2 helped stats (rel) min: 2.86% max: 30.00% x̄: 8.64% x̃: 8.33% 95% mean confidence interval for bundles value: -3.93 -1.92 95% mean confidence interval for bundles %-change: -10.69% -6.59% Bundles are helped. total quadwords in shared programs: 41359 -> 41055 (-0.74%) quadwords in affected programs: 3801 -> 3497 (-8.00%) helped: 57 HURT: 0 helped stats (abs) min: 1 max: 57 x̄: 5.33 x̃: 4 helped stats (rel) min: 1.92% max: 21.05% x̄: 8.22% x̃: 6.67% 95% mean confidence interval for quadwords value: -7.35 -3.32 95% mean confidence interval for quadwords %-change: -9.54% -6.90% Quadwords are helped. total registers in shared programs: 3849 -> 3807 (-1.09%) registers in affected programs: 167 -> 125 (-25.15%) helped: 32 HURT: 1 helped stats (abs) min: 1 max: 3 x̄: 1.34 x̃: 1 helped stats (rel) min: 20.00% max: 50.00% x̄: 26.35% x̃: 20.00% HURT stats (abs) min: 1 max: 1 x̄: 1.00 x̃: 1 HURT stats (rel) min: 16.67% max: 16.67% x̄: 16.67% x̃: 16.67% 95% mean confidence interval for registers value: -1.54 -1.00 95% mean confidence interval for registers %-change: -29.41% -20.69% Registers are helped. total threads in shared programs: 2471 -> 2520 (1.98%) threads in affected programs: 49 -> 98 (100.00%) helped: 25 HURT: 0 helped stats (abs) min: 1 max: 2 x̄: 1.96 x̃: 2 helped stats (rel) min: 100.00% max: 100.00% x̄: 100.00% x̃: 100.00% 95% mean confidence interval for threads value: 1.88 2.04 95% mean confidence interval for threads %-change: 100.00% 100.00% Threads are [helped]. total spills in shared programs: 168 -> 168 (0.00%) spills in affected programs: 0 -> 0 helped: 0 HURT: 0 total fills in shared programs: 186 -> 186 (0.00%) fills in affected programs: 0 -> 0 helped: 0 HURT: 0 Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4999>
* glsl: remove stale FIXMETimothy Arceri2020-06-301-3/+0
| | | | | | | | This is no longer an issue, was likely fixed years ago. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5657>
* glsl: define gl_LightSource members in ARB_vertex_program orderTimothy Arceri2020-06-302-4/+4
| | | | | | | | | | | | | | | | | | | | GLSL shares functionality with ARB_vertex_program but the GLSL spec defines the gl_LightSource builtin with a member order that is different from the packing expected in ARB_vertex_program. This difference introduces a need for specialist lowering code when handling builtin structs that is not required for normal uniform structs due to member location mismatches. Since gl_LightSource can't be redefined it shouldn't matter if we add the members in the order listed in the spec, just so long as we add them all. So here we rearrange the definition of the glsl builtin to reflex our internal layout and that of ARB_vertex_program. This required for the following patch. CC: <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5656>
* nir: Add new rules to optimize NOOP pack/unpack pairsBoris Brezillon2020-06-292-9/+10
| | | | | | | | | nir_load_store_vectorize_test.ssbo_load_adjacent_32_32_64_64 expectations need to be fixed accordingly. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5589>
* spirv: set variables to restrict by defaultRhys Perry2020-06-243-1/+13
| | | | | | | Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Daniel Schürmann <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5207>
* nir: Fix divergence analysis for tessellation input/outputsKenneth Graunke2020-06-241-2/+16
| | | | | | | | | | | | | | | | | | The load_per_vertex_{input,output} intrinsics simply mean that they're reading an arrayed input/output, which have one element per invocation. Most accesses to those use gl_InvocationID as the subscript. However, it's totally possible to read any element of the array. For example, an evaluation shader might read gl_in[2].gl_Position, or a control shader might read output[0]. For threads processing a single patch, an input/output load is convergent if and only if both sources (the per-vertex-array subscript and the offset) are convergent. For threads processing multiple patches, we continued to mark them divergent. Reviewed-by: Jason Ekstrand <[email protected]> Acked-by: Daniel Schürmann <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5613>
* nir: only uniforms with dynamically_uniform offset are dynamically_uniformJose Maria Casanova Crespo2020-06-231-2/+2
| | | | | | | | | | | | Previously all nir_intrinsic_load_uniform that were used as sources were considered to be dynamically_uniform but when offsets of load_uniform are indirect it can not be determined. This fixes artefacts in Google Maps 3D view in V3D. Fixes: 886d46b08971 ("nir: Add a function to determine if a source is dynamically uniform") Reviewed-by: Neil Roberts <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5587>
* glsl,driconf: add allow_glsl_120_subset_in_110 for SPECviewperf13Marek Olšák2020-06-234-4/+9
| | | | | Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5459>
* nir: Add an option for lowering TessLevelInner/Outer to vecsBrian Ho2020-06-222-0/+30
| | | | | | | | | | | | The GLSL to NIR compiler supports the LowerTessLevel flag to convert gl_TessLevelInner/Outer from their GLSL declarations as arrays of floats to vec4/vec2s to better match how they are represented in hardware. This commit adds the similar support to the SPIR-V to NIR compiler so turnip can use the same IR3/NIR tess lowering passes as freedreno. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5059>
* nir: Support sysval tess levels in SPIR-V to NIRBrian Ho2020-06-222-2/+19
| | | | | | | | | | This commit adds a tess_levels_are_sysvals flag to spirv_to_nir_options similar to GLSLTessLevelsAsInputs in the GLSL to NIR compiler options. This will be used by turnip as the tess IR3 lowering pass (ir3_nir_lower_tess) operates on TessLevelInner and TessLevelOuter in the DS as sysvals. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5059>
* nir: slight correction to cube_face_coord constant foldingRhys Perry2020-06-221-2/+2
| | | | | | | | ACO does the division with a rcp and then a multiplication. Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5547>
* nir/scheduler: Add an option to specify what stages share memory for I/ONeil Roberts2020-06-222-8/+29
| | | | | | | | | | | The scheduler has code to handle hardware that shares the same memory for inputs and outputs. Seeing as the specific stages that need this is probably hardware-dependent, this patch makes it a configurable option instead of hard-coding it to everything but fragment shaders. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5561>
* nir/schedule: Store a pointer to the scoreboard in nir_deps_stateNeil Roberts2020-06-221-15/+15
| | | | | | | | | | | | | nir_deps_state is a struct used as a closure for calculating the dependencies. Previously it had two fields copied out of the scoreboard. The closure is initialised in two seperate places. In order to make it easier to access other members of the scoreboard in the callbacks in later patches, the closure now just contains a pointer to the scoreboard and the two bits of copied information are removed. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5561>
* nir/scheduler: Handle nir_intrinsic_load_per_vertex_inputNeil Roberts2020-06-221-0/+1
| | | | | | | | | | | load_per_vertex_input should probably be handled in the same way as a regular load_input. I think the nir_schedule pass was written before V3D had geometry shader support, so that is probably why it hasn’t taken this into account until now. Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5561>
* nir/lower_images: handle dec and incKarol Herbst2020-06-182-0/+4
| | | | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Gert Wollny <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5480>
* nir/lower_images: fix for array of arraysKarol Herbst2020-06-181-2/+9
| | | | | | Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5480>
* glsl_to_nir: fix vote_any/vote_allRob Clark2020-06-181-3/+4
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505>
* glsl_to_nir: fix shader_clockRob Clark2020-06-181-1/+0
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505>
* glsl_to_nir: fix is_helper_invocationRob Clark2020-06-181-1/+0
| | | | | | | Reported-by: Karol Herbst <[email protected]> Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505>
* spirv: drop some dead codeRob Clark2020-06-181-6/+0
| | | | | | | | | | This case is never hit, we don't have a nir intrinsic for this spirv opcode. And when we do, I'm not sure if it would be vectorized or not. So best just to drop this case. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505>
* spirv: atomic_counter_read_deref is not vectorizedRob Clark2020-06-181-4/+1
| | | | | | | Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3141 Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5505>
* spirv: do not set num_components for non-vectorized mbcnt_amd intrinsicSamuel Pitoiset2020-06-171-1/+2
| | | | | | | Fixes: 167fa2887f0 ("nir/validate: validate intr->num_components") Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Rob Clark <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5493>
* glsl: small optimisation fix for uniform array resizingTimothy Arceri2020-06-171-15/+10
| | | | | | | | | The fix in the previous patch removed an erronous attempt to skip resizing variable types in each stage. Now that has been removed iterating over each shader stage is no longer required here. Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5487>
* glsl: fix uniform array resizing in the nir linkerTimothy Arceri2020-06-171-44/+42
| | | | | | | | | | | | | | | | | | | | | | The initial support tried to match uniform variables from different shaders based on the variables pointer. This will obviously never work, instead here we use the variables name whcih also means we must disable this optimisation for spirv. Using the base variable name works because when collecting uniform references we never iterate past the first array dimension, and only support resizing 1D arrays (we also don't support resizing arrays inside structs). We also drop the resized bool as we can't skip processing the var just because is was resized in another shader, we must resize the var in all shaders. Fixes: a34cc97ca3e1 ("glsl: when NIR linker enable use it to resize uniform arrays") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3130 Reviewed-by: Tapani Pälli <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5487>
* nir/intrinsics: Put the _intel intrinsics together at the endJason Ekstrand2020-06-161-12/+12
| | | | | | | | | All the other driver-specific intrinsics are at the end of the file so Intel's should go there too. Reviewed-by: Sagar Ghuge<[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5503>
* nir/validate: validate intr->num_componentsRob Clark2020-06-161-0/+18
| | | | | | | | | | Validate that num_components is only set for vectorized instructions, to prevent other nir passes or driver backends from mistakenly relying on num_components for non-vectorized instructions. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5371>
* spriv: don't set num_components for non-vectorised intrinsicsRob Clark2020-06-162-5/+5
| | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5371>
* nir/lower-atomics-to-ssbo: don't set num_componentsRob Clark2020-06-161-7/+8
| | | | | | | | | Of the possible intrinsics generated, only load_ssbo is vectorized (and store_ssbo is never generated) Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5371>
* nir/builder: don't set intr->num_componentsRob Clark2020-06-161-1/+0
| | | | | | | | The "load-sysval" intrinsics are not vectorized. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5371>
* mesa/gles3: add support for GL_EXT_shader_group_voteDave Airlie2020-06-163-1/+22
| | | | | | | | This is the GLES equivalent to ARB_shader_group_vote. Passes: KHR-GLES31.core.shader_group_vote.* Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5490>
* nir: do not try to merge xfb-outputsErik Faye-Lund2020-06-151-0/+12
| | | | | | | | | | | | It's tricky to merge XFB-outputs correctly, because we need there to not be any overlaps when we get to `nir_gather_xfb_info_with_varyings` later on. We currently trigger an assert there if we end up merging here. So let's not even try. This is an optimization, and we can optimize this in safe cases later if needed. For now, let's play it safe. Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5329>
* spirv: fix using OpSampledImage with OpUndef instead of OpType{Image,Sampler}Samuel Pitoiset2020-06-151-4/+22
| | | | | | | | | | | | | | This seems valid per the SPIR-V spec to use OpSampledImage with OpUndef instead of OpTypeImage or OpTypeSampler. When the image operand is undefined, SPIRV->NIR emits an undef instruction that can be removed later by the compiler. This fixes shader compilation crashes with Red Dead Redemption II. Cc: [email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5230>
* glsl: fix incorrect optimisation in opt_constant_variable()Timothy Arceri2020-06-121-0/+9
| | | | | | | | | | | | | | | When handling function inputs the optimisation pass incorrectly assumes the inputs are undefined. Here we simply change things to assume inputs have always been assigned a value. Any further optimisations will be taken care of once function inlining takes place. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2984 Fixes: 65122e9e8038 ("ir_constant_variable: New pass to mark constant-assigned variables constant.") Reviewed-by: Danylo Piliaiev <[email protected]> Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5413>
* nir/print: print tex dest typeRob Clark2020-06-111-15/+25
| | | | | | | Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5431>
* nir: Properly preserve metadata in more casesJason Ekstrand2020-06-1111-22/+78
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
* nir: Call nir_metadata_preserve on !progressJason Ekstrand2020-06-1141-84/+85
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
* nir: Add a nir_shader_preserve_all_metadata helperJason Ekstrand2020-06-112-0/+11
| | | | | | | | | There are some passes which really work on the shader level and it's easier if we have a helper which preserves metadata on the whole shader. Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
* nir: Add a nir_metadata_all enum valueJason Ekstrand2020-06-111-0/+9
| | | | | | Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5171>
* nir: Replace the zs_output_pan intrinsic with combined_output_panIcecream952020-06-101-1/+1
| | | | | | | | Depth and stencil writes are combined with color writes, so we need this intrinsic which has sources for color, RT, depth and stencil. Reviewed-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5065>
* nir: Remove nir_intrinsic_output_u8_as_fp16_panAlyssa Rosenzweig2020-06-101-6/+0
| | | | | | | Now unused in favour of nir_intrinsic_load_output, happily. Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5287>
* glsl: fix crash on glsl macro redefinitionAndrii Simiklit2020-06-101-0/+3
| | | | | | | | | | | | | | In case shader contains two equal macro defines, first one with trailing spaces and the second one without. `#define A 1 ` `#define A 1` The parser crashes Fixes: 0346ad37741b11d640c1c4970b275c1f0c7f9e75 ("glsl: ignore trailing whitespace when define redefined") Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Signed-off-by: Andrii Simiklit <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5312>
* nir: use bitfield_insert instead of bfi in nir_lower_double_opsBen Skeggs2020-06-091-1/+3
| | | | | | | | | NVIDIA hardware doesn't have an equivilant to bfi, but we do already have a lowering for bitfield_insert->bfi. Signed-off-by: Ben Skeggs <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5373>
* nir: Fix logic that ends combine barrier sequenceCaio Marcelo de Oliveira Filho2020-06-081-1/+1
| | | | | | | | | | | The combination must stop when we see a scoped barrier that have execution scope, i.e. it has control barrier behavior. The code was mistakenly looking at the wrong scope. Fixes: 345b5847b42 ("nir: Replace the scoped_memory barrier by a scoped_barrier") Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>
* spirv: Memory semantics is optional for OpControlBarrierCaio Marcelo de Oliveira Filho2020-06-081-9/+9
| | | | | | | | Fixes: 3ed2123d77d ("spirv: Use scoped barriers for SpvOpControlBarrier") Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>
* nir: Fix printing execution scope of a scoped barrierCaio Marcelo de Oliveira Filho2020-06-081-1/+4
| | | | | | | | Fixes: 345b5847b42 ("nir: Replace the scoped_memory barrier by a scoped_barrier") Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5365>
* glsl: inline functions with unsupported return type before converting to nirDanylo Piliaiev2020-06-081-0/+6
| | | | | | | | | | | | | glsl_to_nir doesn't expect non-vector/scalar return types in functions. Fixes: 7e60d5a501f311fa5e7bca5335adc6013dc1aeb9 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3058 Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3060 Signed-off-by: Danylo Piliaiev <[email protected]> Tested-by: Witold Baryluk <[email protected]> Reviewed-by: Witold Baryluk <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5333>
* nir/lower_explicit_io: fix NON_UNIFORM access for UBO loadsSamuel Pitoiset2020-06-081-1/+1
| | | | | | | | | | Make sure to propagate the NON_UNIFORM access for UBO loads, so that non-uniform loads are correctly lowered. Cc: <[email protected]> Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Rhys Perry <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5311>
* nir/spirv/glsl450: increase asin(x) precisionArcady Goldmints-Orlov2020-06-081-9/+33
| | | | | | | | | | | | | | | | | | asin(x) is now implemented using a piecewise approximation, which improves the precision for |x| < 0.5 Previously, we were using a polynomial approximation for both the asin() and acos() functions. Unfortunately, for asin(), this polynomial does not have enough precision to satisfy the Vulkan CTS requiremenents, which define the asin() precision based on the precision of atan2(x, sqrt(1.0 - x*x)). The piecewise approximation gives the needed precision in the problematic range. v2: Skip the piecewise approximation for acos Closes: #1843 Acked-by: Francisco Jerez <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3809>
* glsl: fix potential slow compile times for GLSLOptimizeConservativelyTimothy Arceri2020-06-071-1/+14
| | | | | | | | | | | | See code comment for full description of the change. Fixes: 0a5018c1a483 ("mesa: add gl_constants::GLSLOptimizeConservatively") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3034 Tested-by: Witold Baryluk <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5346>