summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* iris: Fix key->input_vertices for 8_PATCH TCS mode.Kenneth Graunke2019-07-112-1/+10
| | | | | | We were failing to flag the program dirty when it changed. Also, we were unnecessarily setting key->input_vertices for SINGLE_PATCH mode, which would reduce program cache hits. Only set it if needed.
* iris: Only set key->flat_shade if COL0/COL1 are written.Kenneth Graunke2019-07-113-3/+5
| | | | | | This was just laziness on my part, we already added similar checks in the VS key handling. Just need to do it here too. Should improve cache hits.
* iris: Drop comment about var->data.binding not being set.Kenneth Graunke2019-07-111-4/+0
| | | | | I refactored the sampler lowering passes a long time ago to ensure that gl_nir_lower_samplers_as_deref is run and var->data.binding is set.
* iris: Drop comments about missing NOSKenneth Graunke2019-07-111-6/+0
| | | | | These stages don't need NOS. If they do, we can add it - the infrastructure is there if we need it someday.
* iris: Drop a TODO commentKenneth Graunke2019-07-111-1/+0
| | | | This is literally implemented two lines above.
* glsl/builtin types: Set the precision on the depth range paramsNeil Roberts2019-07-111-3/+3
| | | | | | | The members of gl_DepthRangeParameters are declared to be highp in GLSL ES specs. Reviewed-by: Eric Anholt <[email protected]>
* glsl: Add a constructor for glsl_struct_field to specify the precisionNeil Roberts2019-07-111-4/+12
| | | | | | | Adds a third constructor to glsl_struct_field which has an extra parameter to specify the precision. Reviewed-by: Eric Anholt <[email protected]>
* glsl: Add a macro for the default values for glsl_struct_fieldNeil Roberts2019-07-111-14/+12
| | | | | | | | | There are two constructors for glsl_struct_field with different parameters. Instead of repeating them for both constructors, this patch adds a convenience macro. This will make it easier to add a third constructor in a later patch. Reviewed-by: Eric Anholt <[email protected]>
* glsl/builtin_variables: Add a precision to the builtinsNeil Roberts2019-07-111-80/+170
| | | | | | | | | | | | | | | All of the builtin variables mentioned in the GLSL ES spec and the extensions include a precision declaration which is different depending on what the variable is used for. This patch makes it set the corresponding precision when creating the variable. This will make a difference once we start using the precision information for optimisation. Previously all of the builtin variables ended up with a precision of NONE. v2: Made gl_PointSize and gl_FragCoord highp since GLSL ES 3.00. Fixed gl_MaxViewPorts to always be highp. (Eric Anholt) Reviewed-by: Eric Anholt <[email protected]>
* compiler: Save a single copy of the softfp64 shader in the context.Kenneth Graunke2019-07-104-11/+14
| | | | | | | | | | | | | | | | | | We were recompiling the softfp64 library of functions from GLSL to NIR every time we compiled a shader that used fp64. Worse, we were ralloc stealing it to the GL context. This meant that we'd accumulate lots of copies for the lifetime of the context, which was a big space leak. Instead, we can simply stash a single copy in the GL context, and use it for subsequent compiles. Having a single copy should be fine from a memory context point of view: nir_inline_function_impl already clones the necessary nir_function_impl's as it inlines. KHR-GL45.enhanced_layouts.ssb_member_align_non_power_of_2 was previously OOM'ing a system with 16GB of RAM when using softfp64. Now it finishes much more quickly and uses only ~200MB of RAM. Reviewed-by: Jordan Justen <[email protected]>
* radv: fix memory leak when restoring from cacheTimothy Arceri2019-07-111-0/+1
| | | | | | Fixes: 726a31df705b ("radv: Add the concept of radv shader binaries.") Reviewed-by: Samuel Pitoiset <[email protected]>
* freedreno: Generate headers from xml filesKristian H. Kristensen2019-07-1029-23904/+14118
| | | | | Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Rob Clark <[email protected]>
* radv: switch to the new VS exports pathSamuel Pitoiset2019-07-101-116/+2
| | | | | | | It will help for GS as NGG on GFX10. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: set the slot_index correctly for VARYING_SLOT_CLIP_DIST1Samuel Pitoiset2019-07-101-1/+1
| | | | | | | For selecting a different SQ_EXP_POS target. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: add a new function for exporting VS outputsSamuel Pitoiset2019-07-101-0/+128
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: implement new path for exporting generic varyingsSamuel Pitoiset2019-07-101-32/+70
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: use the generic export path for clip/cull distancesSamuel Pitoiset2019-07-101-6/+6
| | | | | | | When they are exported to the next stage. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* radv: remove an extra memcpy when exporting clip/cull distancesSamuel Pitoiset2019-07-101-6/+5
| | | | | | | Cleanup. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
* intel/compiler: Add a "base class" for program keysJason Ekstrand2019-07-1030-240/+183
| | | | | | | | | Right now, all keys have two things in common: a program string ID and a sampler_prog_key_data. I'd like to add another thing or two and need a place to put it. This commit adds a new brw_base_prog_key struct which contains those two common bits. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/program_cache: Cast the key to char * before adding key_sizeJason Ekstrand2019-07-101-1/+1
| | | | | | | | We're about to change the type of key to be brw_base_prog_key and that will mean blindly adding the key size without a cast will lead to the wrong calculation. It's safer to cast to char * first anyway. Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Make the workaround BO a whole pageJason Ekstrand2019-07-101-1/+1
| | | | | | | | I'm not 100% sure how this ever worked because gem_create usually shoots you if the BO size isn't page-aligned. Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Set Stateless Data Port Access MOCSJason Ekstrand2019-07-101-0/+2
| | | | | | | | | | This is the MOCS setting used for the A64 stateless messages which we sometimes use for SSBO operations. Fixes: 48ed2a7bb009 "anv: Implement VK_EXT_buffer_device_address" Fixes: 79fb0d27f3ab "anv: Implement SSBOs bindings with GPU addr..." Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* panfrost: Clamp point sizeAlyssa Rosenzweig2019-07-106-4/+83
| | | | | | | It's not clear the hardware really has a maximum which confuses dEQP; clamp to whatever we report as our maximum. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Auto styleAlyssa Rosenzweig2019-07-104-122/+123
| | | | | | $ astyle *.c *.h --style=linux -s8 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move non-Gallium files outside of GalliumAlyssa Rosenzweig2019-07-1038-92/+196
| | | | | | | | | In preparation for a Panfrost-based non-Gallium driver (maybe Vulkan...?), hoist everything except for the Gallium driver into a shared src/panfrost. Practically, that means the compilers, the headers, and pandecode. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Style main Gallium driverAlyssa Rosenzweig2019-07-1027-819/+819
| | | | | | $ astyle *.c *.h --style=linux -s8 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Apply code stylingAlyssa Rosenzweig2019-07-1011-212/+213
| | | | | | $ astyle *.c *.h --style=linux -s8 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/nir: Apply NIR styleAlyssa Rosenzweig2019-07-104-105/+105
| | | | | | $ astyle *.c *.h --style=linux -s3 Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move midgard/nir* to nir folderAlyssa Rosenzweig2019-07-106-5/+5
| | | | | | | | | | | | | The reason for doing this is two-fold: 1. These passes are likely to be shared with the Bifrost compiler Therefore, we don't want to restrict them to Midgard 2. The coding style is different (NIR-style vs Panfrost-style) The NIR passes are candidates for moving upstream into compiler/nir, so don't block that off for stylistic reasons Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: TypofixAlyssa Rosenzweig2019-07-101-1/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Identify shared tiler structureAlyssa Rosenzweig2019-07-103-135/+142
| | | | | | | This is identical across SFBD/MFBD so pull it out to allow for better code sharing. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Drop unnecessary assertAlyssa Rosenzweig2019-07-101-3/+1
| | | | | | | Just use the #define instead. Signed-off-by: Alyssa Rosenzweig <[email protected]> Suggested-by: Erik Faye-Lund <[email protected]>
* panfrost: Don't expose OES_standard_derivativesAlyssa Rosenzweig2019-07-101-1/+0
| | | | | | This has not been implemented quite yet. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* gallium: get rid of PIPE_CAP_SM3Erik Faye-Lund2019-07-1021-28/+63
| | | | | | | | | | | | | | | | | | | | | PIPE_CAP_SM3 has always been an odd one out of all our caps. While most other caps are fine-grained and single-purpose, this cap encode several features in one. And since OpenGL cares more about single features, it'd be nice to get rid of this one. As it turns, this is now relatively simple. We only really care about three features using this cap, and those already got their own caps. So we can remove it, and make sure all current drivers just give the same response to all of them. The only place we *really* care about SM3 is in nine, and there we can instead just re-construct the information based on the finer-grained caps. This avoids DX9 semantics from needlessly leaking into all of the drivers, most of who doesn't care a whole lot about DX9 specifically. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]>
* gallium: give vertex-shader saturate its own capErik Faye-Lund2019-07-104-1/+5
| | | | | | | | | | Shader Model 3.0 is a big promise to make to the state-tracker, and for instance mobile hardware might support vertex-shader saturate but not some of the other features of SM3. So let's give this its own cap for simplicity. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: give fragment-shader derivatives its own capErik Faye-Lund2019-07-104-1/+5
| | | | | | | | | | Shader Model 3.0 is a big promise to make to the state-tracker, and for instance mobile hardware might support fragment-shader derivatives but not some of the other features of SM3. So let's give this its own cap for simplicity. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* gallium: give fragment-shader texture-lod its own capErik Faye-Lund2019-07-104-1/+7
| | | | | | | | | | Shader Model 3.0 is a big promise to make to the state-tracker, and for instance mobile hardware might support texture lod but not some of the other features of SM3. So let's give this its own cap for simplicity. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* mesa/st: drop needless has_shader_model3 booleanErik Faye-Lund2019-07-102-3/+1
| | | | | | | | | This boolean is only consulted once during init, so there's nothing much saved by storing this in the context. So let's just check directly when we need it instead. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* panfrost: Fix copyright identifier in a few placesAlyssa Rosenzweig2019-07-102-2/+2
| | | | | | | Oops. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Bikeshed pan_screen.c commentAlyssa Rosenzweig2019-07-101-25/+21
| | | | | | | The asterisks were inherited from... softpipe, maybe? Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Check GPU version before loadingAlyssa Rosenzweig2019-07-103-5/+28
| | | | | | | | | | Panfrost is known to only work on a select few CPU/GPU combinations at the moment (tested system-on-chips: RK3288, RK3399, and S912). Whitelist the combinations known to work and refuse to load on others where nothing works yet to avoid user confusion. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Be more honest about PIPE_CAPsAlyssa Rosenzweig2019-07-102-101/+39
| | | | | | | | | | | | | | | A lot of the pan_screen.c code was cargoculted from other drivers. The upshot is that we return true for a lot of PIPE_CAPs that we don't actually support, resulting in us exposing way too many extensions that we don't actually support. Be more careful. Some CAPs we do need to fake to access higher dEQP versions (i.e. in order to debug the features we're hiding behind the CAP). For these, we hide the CAP behind a special PAN_MESA_DEBUG=deqp option to avoid apps randomly using these in-development features. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost/midgard: Hit missed scheduling opportunityAlyssa Rosenzweig2019-07-101-1/+1
| | | | | | | | | | | | | | | | | Don't try to schedule to vmul when that can't possible work (forcing a bundle break). glmark: total bundles in shared programs: 2700 -> 2683 (-0.63%) bundles in affected programs: 695 -> 678 (-2.45%) helped: 14 HURT: 0 helped stats (abs) min: 1 max: 4 x̄: 1.21 x̃: 1 helped stats (rel) min: 1.27% max: 7.69% x̄: 4.30% x̃: 4.77% 95% mean confidence interval for bundles value: -1.68 -0.75 95% mean confidence interval for bundles %-change: -5.63% -2.97% Bundles are helped. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Include shader size for shader-dbAlyssa Rosenzweig2019-07-101-3/+5
| | | | | | | It's easy to forget about, but shader size does matter for things like i-cache, so let's include it in the analysis. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Include loop count for shader-dbAlyssa Rosenzweig2019-07-102-2/+9
| | | | | | | We have to emit it anyway for the report to be happy (with respect to unrolling), so return an actual count rather than dummy numbers. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Dump shader-db statsAlyssa Rosenzweig2019-07-102-0/+40
| | | | | | All the kool kids are doing it. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Flush undefineds to zeroAlyssa Rosenzweig2019-07-105-6/+100
| | | | | | Fixes a buggy dEQP test. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Specify channel count for broadcasting opsAlyssa Rosenzweig2019-07-101-8/+8
| | | | | | | bany/ball type ops read from all 4 channels even though they only write to 1; specify this in the opcode table like we do for dot products. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost/midgard: Don't try to "alias" texture registersAlyssa Rosenzweig2019-07-101-5/+0
| | | | | | It won't work. Just, stop it. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* radv: compute correct number of input vertices for NGGSamuel Pitoiset2019-07-101-1/+24
| | | | | Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>