aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline.c
Commit message (Collapse)AuthorAgeFilesLines
* anv/pipeline: Replace get_fs_input_map with get_last_vue_prog_dataJason Ekstrand2017-01-131-1/+1
| | | | | | This lets us delete a helper from genX_pipeline.c Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Move nir_lower_wpos_center after dead variable elimination.Kenneth Graunke2017-01-131-3/+3
| | | | | | | | | | | | | | | | When multiple shader stages exist in the same SPIR-V module, we compile all entry points and their inputs/outputs, then dead code eliminate the ones not related to the specific entry point later. nir_lower_wpos_center was being run prior to eliminating those random other variables, which made it trip up, thinking it found gl_FragCoord when it actually found something else like gl_PerVertex[3]. Fixes dEQP-VK.spirv_assembly.instruction.graphics.module.same_module. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Enable tessellation shaders.Kenneth Graunke2017-01-101-0/+1
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Compile TCS/TES shaders.Kenneth Graunke2017-01-101-2/+191
| | | | | | | | v2: Merge more TCS/TES info. v3: Fix caching keys. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Handle patch primitives.Kenneth Graunke2017-01-101-2/+7
| | | | | | | | v2: Use anv_pipeline_has_stage rather than tess_info != NULL. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Iago Toral Quiroga <[email protected]> [v1] Reviewed-by: Jason Ekstrand <[email protected]>
* anv: set input_slots_valid on brw_wm_prog_keyLionel Landwerlin2017-01-101-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | With shaders using a lot of inputs/outputs, like this (from Gtk+) : layout(location = 0) in vec2 inPos; layout(location = 1) in float inGradientPos; layout(location = 2) in flat int inRepeating; layout(location = 3) in flat int inStopCount; layout(location = 4) in flat vec4 inClipBounds; layout(location = 5) in flat vec4 inClipWidths; layout(location = 6) in flat ColorStop inStops[8]; layout(location = 0) out vec4 outColor; we're missing the programming of the input_slots_valid field leading to an assert further down the backend code. v2: Use valid slots of the geometry or vertex stage (Jason) v3: Use helper to find correct vue map (Jason) v4: Set the valid slots off the previous stages (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: enable float64 feature on supported platformsSamuel Iglesias Gonsálvez2017-01-091-1/+5
| | | | | | | | v2: - Remove image_ms_array initialization (Jason) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/pipeline: get map for double input attributesJuan A. Suarez Romero2017-01-091-0/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* spirv: add support for doubles to OpSpecConstantSamuel Iglesias Gonsálvez2017-01-091-1/+4
| | | | | | | | | v2 (Jason): - Fix indent in radv change - Add vtn_u64_literal() helper to take 64 bits (Jason) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/pipeline: Call NIR passes using NIR_PASS_VJason Ekstrand2017-01-071-31/+15
| | | | | | This lets us get validation without having to do it manually. Reviewed-by: Timothy Arceri <[email protected]>
* anv/pipeline: Only call remove_dead_variables onceJason Ekstrand2017-01-071-3/+3
| | | | | | | It can handle multiple modes at a time now so there's no reason to call it repeatedly. Reviewed-by: Timothy Arceri <[email protected]>
* spirv: add interface for drivers to define support extensions.Dave Airlie2016-12-281-1/+1
| | | | | | | | | | | I expect over time the struct contents will change as all drivers support stuff etc, but for now this should be a good starting point. Reviewed-by: Edward O'Callaghan <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* i965: use nir_lower_indirect_derefs() for GLSLTimothy Arceri2016-12-231-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the nir_lower_indirect_derefs() call into brw_preprocess_nir() so thats is called by both OpenGL and Vulkan and removes that call to the old GLSL IR pass lower_variable_index_to_cond_assign() We want to do this pass in nir to be able to move loop unrolling to nir. There is a increase of 1-3 instructions in a small number of shaders, and 2 Kerbal Space program shaders that increase by 32 instructions. The changes seem to be caused be the difference in the GLSL IR vs NIR variable index lowering passes. The GLSL IR pass creates a simple if ladder for arrays of size 4 or less, while the NIR pass implements a binary search for all arrays regardless of size. Shader-db results BDW: total instructions in shared programs: 13021176 -> 13021819 (0.00%) instructions in affected programs: 57693 -> 58336 (1.11%) helped: 20 HURT: 190 total cycles in shared programs: 299805580 -> 299750826 (-0.02%) cycles in affected programs: 2290024 -> 2235270 (-2.39%) helped: 337 HURT: 442 total fills in shared programs: 19984 -> 19984 (0.00%) fills in affected programs: 0 -> 0 helped: 0 HURT: 0 LOST: 4 GAINED: 0 V2: remove the do_copy_propagation() call from the i965 GLSL IR linking code. This call was added in f7741c52111 but since we are moving the variable index lowering to NIR we no longer need it and can just rely on the nir copy propagation pass. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/pipeline: Call nir_lower_constant_initializersJason Ekstrand2016-12-051-0/+13
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* Revert "i965: use nir_lower_indirect_derefs() for GLSL"Jason Ekstrand2016-12-051-0/+10
| | | | | This reverts commit 9404439a754e5640ccd98df40fa694835c0d8759. I didn't intend to push it and it breaks clip and cull distance.
* i965: use nir_lower_indirect_derefs() for GLSLTimothy Arceri2016-12-051-10/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the nir_lower_indirect_derefs() call into brw_preprocess_nir() so thats is called by both OpenGL and Vulkan and removes that call to the old GLSL IR pass lower_variable_index_to_cond_assign() We want to do this pass in nir to be able to move loop unrolling to nir. There is a increase of 1-3 instructions in a small number of shaders, and 2 Kerbal Space program shaders that increase by 32 instructions. Shader-db results BDW: total instructions in shared programs: 8705873 -> 8706194 (0.00%) instructions in affected programs: 32515 -> 32836 (0.99%) helped: 3 HURT: 79 total cycles in shared programs: 74618120 -> 74583476 (-0.05%) cycles in affected programs: 528104 -> 493460 (-6.56%) helped: 47 HURT: 37 LOST: 2 GAINED: 0
* anv: Add an input attachment lowering passJason Ekstrand2016-11-221-0/+3
| | | | Reviewed-by: Jordan Justen <[email protected]>
* anv: Combine ClipDistance and CullDistance arrays.Kenneth Graunke2016-11-221-0/+3
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Handle null in all destructorsJason Ekstrand2016-11-161-0/+6
| | | | | | | | | | This fixes a bunch of new CTS tests which look for exactly this. Even in the cases where we just call vk_free to free a CPU data structure, we still handle NULL explicitly. This way we're less likely to forget to handle NULL later should we actually do something less trivial. Cc: "13.0" <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* anv/pipeline: Get rid of the kernel pointer fieldsJason Ekstrand2016-11-161-22/+0
| | | | | | | | | | Now that we have anv_shader_bin, they're completely redundant with other information we have in the pipeline. For vertex shaders, we also go through way too much work to put the offset in one or the other field and then look at which one we put it in later. Reviewed-by: Timothy Arceri <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* anv/pipeline: Properly cache prog_data::paramJason Ekstrand2016-11-021-1/+2
| | | | | | | | | | | Before we were caching the prog data but we weren't doing anything with brw_stage_prog_data::param so anything with push constants wasn't getting cached properly. This commit fixes that. Signed-off-by: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Timothy Arceri <[email protected]> Cc: "13.0" <[email protected]>
* anv/pipeline: Put actual pointers in anv_shader_binJason Ekstrand2016-11-021-6/+11
| | | | | | | | | | | | | | | While we can simply calculate offsets to get to things such as the prog_data and the key, it's much more user-friendly if there are just pointers. Also, it's a bit more fool-proof. While we're at it, we rework the pipeline cache API to use the brw_stage_prog_data type directly. Signed-off-by: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98012 Reviewed-by: Topi Pohjolainen <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Cc: "13.0" <[email protected]>
* i965: rewrite brw_setup_vue_interpolation()Timothy Arceri2016-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here brw_setup_vue_interpolation() is rewritten not to use the InterpQualifier array in gl_fragment_program which will allow us to remove it. This change also makes the code which is only used by gen4/5 more self contained as it now has its own gen5_fragment_program struct rather than storing the map in brw_context. This means the interpolation map will only get processed once and will get stored in the in memory cache rather than being processed everytime the fs changes. Also by calling this from the fs compile code rather than from the upload code and using the interpolation assigned there we can get rid of the BRW_NEW_INTERPOLATION_MAP flag. It might not seem ideal to add a gen5_fragment_program struct however by the end of this series we will have gotten rid of all the brw_{shader_stage}_program structs and replaced them with a generic brw_program struct so there will only be two program structs which is better than what we have now. V2: Don't remove BRW_NEW_INTERPOLATION_MAP from dirty_bit_map until the following patch to fix build error. V3 - Suggestions by Jason: - name struct gen4_fragment_program rather than gen5_fragment_program - don't use enum with memset() - create interp mode set helper and simplify logic to call it - add assert when calling function to show prog will never be NULL for gen4/5 i.e. no Vulkan Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* nir/i965/anv/radv/gallium: make shader info a pointerTimothy Arceri2016-10-261-9/+9
| | | | | | | | | | When restoring something from shader cache we won't have and don't want to create a nir_shader this change detaches the two. There are other advantages such as being able to reuse the shader info populated by GLSL IR. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: move to using vk_alloc helpers.Dave Airlie2016-10-191-3/+3
| | | | | | | This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* anv: Move Create*Pipelines into genX_cmd_buffer.cJason Ekstrand2016-10-141-106/+0
| | | | | | | | Now that we don't have meta, we have no need for a gen-agnostic pipeline create path. We can, instead, just generate one Create*Pipelines function per gen and be done with it. Signed-off-by: Jason Ekstrand <[email protected]>
* anv/pipeline: Remove support for direct-from-nir shadersJason Ekstrand2016-10-141-73/+54
| | | | Signed-off-by: Jason Ekstrand <[email protected]>
* anv: Get rid of graphics_pipeline_create_info_extraJason Ekstrand2016-10-141-43/+12
| | | | | | | | | Now that we no longer have meta, all pipelines get created via the normal Vulkan pipeline creation mechanics. There is no more need for this bit of extra magic data that we've been passing around. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: Get rid of metaJason Ekstrand2016-10-141-4/+2
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: Fix anv_pipeline_validate_create_info assertions.Kenneth Graunke2016-10-111-7/+9
| | | | | | | | Many of these can be "NULL if the pipeline has rasterization disabled." Also, we should assert that pMultisampleState exists. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/pipeline: Roll compute_urb_partition into emit_urb_setupJason Ekstrand2016-09-131-142/+0
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Topi Pohjolainen <[email protected]>
* anv/pipeline: Lower indirect outputs when EmitNoIndirectOutput is setJason Ekstrand2016-09-061-0/+2
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reported-by: Timothy Arceri <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Refactor pipeline l3 config setupJason Ekstrand2016-09-031-24/+22
| | | | | | | | | Now that we're using gen_l3_config.c, we no longer have one set of l3 config functions per gen and we can simplify a bit. Also, we know that only compute uses SLM so we don't need to look for it in all of the stages. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* intel: s/brw_device_info/gen_device_info/Jason Ekstrand2016-09-031-7/+7
| | | | | | | | | | | | | Generated by: sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.c sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.h sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.c sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.cpp sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.h Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* anv: Rework pipeline cachingJason Ekstrand2016-08-301-70/+91
| | | | | | | | | | | | | | | | | | | The original pipeline cache the Kristian wrote was based on a now-false premise that the shaders can be stored in the pipeline cache. The Vulkan 1.0 spec explicitly states that the pipeline cache object is transiant and you are allowed to delete it after using it to create a pipeline with no ill effects. As nice as Kristian's design was, it doesn't jive with the expectation provided by the Vulkan spec. The new pipeline cache uses reference-counted anv_shader_bin objects that are backed by a large state pool. The cache itself is just a hash table mapping keys hashes to anv_shader_bin objects. This has the added advantage of removing one more hand-rolled hash table from mesa. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97476 Acked-by: Kristian Høgsberg Kristensen <[email protected]>
* anv/pipeline: Properly handle OOM during shader compilationJason Ekstrand2016-08-301-12/+23
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Fix bind maps for fragment output arraysJason Ekstrand2016-08-301-1/+1
| | | | | | | Found by inspection. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* nir: Change nir_shader_get_entrypoint to return an impl.Kenneth Graunke2016-08-251-2/+3
| | | | | | | | | | | | | | | | | Jason suggested adding an assert(function->impl) here. All callers of this function actually want ->impl, so I decided just to change the API. We also change the nir_lower_io_to_temporaries API here. All but one caller passed nir_shader_get_entrypoint(), and with the previous commit, it now uses a nir_function_impl internally. Folding this change in avoids the need to change it and change it back. v2: Fix one call I missed in ir3_compiler (caught by Eric). Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* anv: Include the pipeline layout in the shader hashJason Ekstrand2016-08-241-4/+8
| | | | | | | | | | | | The pipeline layout affects shader compilation because it is what determines binding table locations as well as whether or not a particular buffer has dynamic offsets. Since this affects the generated shader, it needs to be in the hash. This fixes a bunch of CTS tests now that the CTS is using a pipeline cache. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kristian Høgsberg <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Set binding_table.gather_texture_startJason Ekstrand2016-07-221-0/+1
| | | | | | | | This should get texture gather working on gen8+ and mostly working on gen7. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Assert that the number of uniforms from NIR fitsJason Ekstrand2016-07-131-0/+1
|
* anv: Use different BOs for different scratch sizes and stagesJason Ekstrand2016-06-221-20/+0
| | | | | | | | | This solves a race condition where we can end up having different stages stomp on each other because they're all trying to scratch in the same BO but they have different views of its layout. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv: Add proper support for depth clampingJason Ekstrand2016-06-201-0/+2
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Do invariance propagation on SPIR-V shadersJason Ekstrand2016-06-201-0/+3
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* anv: Fix a harmless overflow warningChad Versace2016-06-151-1/+1
| | | | | | | | anv_pipeline_binding::index is a uint8_t, but some code assigned to it UINT16_MAX. Reviewed-by: Anuj Phogat <[email protected]> Reviewd-by: Jason Ekstrand <[email protected]>
* anv/pipeline: Don't dereference NULL dynamic state pointersNanley Chery2016-06-131-22/+48
| | | | | | | | | | | | | | | | Add guards to prevent dereferencing NULL dynamic pipeline state. Asserts of pCreateInfo members are moved to the earliest points at which they should not be NULL. This fixes a segfault seen in the McNopper demo, VKTS_Example09. v3 (Jason Ekstrand): - Fix disabled rasterization check - Revert opaque detection of color attachment usage Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv: Document and rename anv_pipeline_init_dynamic_state()Nanley Chery2016-06-131-3/+16
| | | | | | | | | | | | To reduce confusion, clarify that the state being copied is not dynamic. This agrees with the Vulkan spec's usage of the term. Various sections specify that the various pipeline state which have VkDynamicState enums (e.g. viewport, scissor, etc.) may or may not be dynamic. Signed-off-by: Nanley Chery <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Store the (set, binding, index) tripple in the bind mapJason Ekstrand2016-06-101-2/+4
| | | | | | | | | | | This way the the bind map (which we're caching) is mostly independent of the pipeline layout. The only coupling remaining is that we pull the array size of a binding out of the layout. However, that size is also specified in the shader and should always match so it's not really coupled. This rendering issues in Dota 2. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Refactor specialization constant handling a bitJason Ekstrand2016-06-031-5/+4
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Cc: "12.0" <[email protected]>
* i965: Add uniform for a CS thread local base IDJordan Justen2016-06-011-0/+4
| | | | | | | | | | | | v4: * Force thread_local_id_index to -1 for now, and have fs_visitor::setup_cs_payload look at thread_local_id_index. This enables us to more easily cut over from the old local ID layout to the new layout, as suggested by Jason. Cc: "12.0" <[email protected]> Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>