aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_pipeline.c
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* anv: Move push constant allocation to the command bufferJason Ekstrand2016-05-271-22/+0
| | | | | | | | | | Instead of blasting it out as part of the pipeline, we put it in the command buffer and only blast it out when it's really needed. Since the PUSH_CONSTANT_ALLOC commands aren't pipelined, they immediately cause a stall which we would like to avoid. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* i965: Delete brw_wm_prog_key::render_to_fbo and drawable_height.Kenneth Graunke2016-05-201-4/+0
| | | | | | | | | | | | Now that we handle flipping and other gl_FragCoord transformations via a uniform, these key fields have no users. This patch actually eliminates the associated recompiles. The Tomb Raider benchmark's minimum FPS increases from ~1 FPS to a reasonable number. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965, anv: Use NIR FragCoord re-center and y-transform passes.Kenneth Graunke2016-05-201-0/+5
| | | | | | | | | | | | | | This handles gl_FragCoord transformations and other window system vs. user FBO coordinate system flipping by multiplying/adding uniform values, rather than recompiles. This is much better because we have no decent way to guess whether the application is going to use a shader with the window system FBO or a user FBO, much less the drawable height. This led to a lot of recompiles in many applications. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* anv: Port L3 cache programming from i965Jordan Justen2016-05-171-4/+29
| | | | | Signed-off-by: Jordan Justen <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* anv: Keep track of whether the data cache should be enabled in L3Jordan Justen2016-05-171-1/+8
| | | | | | | | If images or shader buffers are used, we will enable the data cache in the the L3 config. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* i965/fs: Add an allow_spilling flag to brw_compile_fsJason Ekstrand2016-05-171-1/+2
| | | | | | | | | This allows us to disable spilling for blorp shaders since blorp state setup doesn't handle spilling. Without this, blorp fails hard if you run with INTEL_DEBUG=spill. Reviewed-by: Francisco Jerez <[email protected]> Tested-by: Francisco Jerez <[email protected]>
* i965/fs: Organize prog_data by ksp number rather than SIMD widthJason Ekstrand2016-05-141-34/+7
| | | | | | | | | | The hardware packets organize kernel pointers and GRF start by slots that don't map directly to dispatch width. This means that all of the state setup code has to re-arrange the data from prog_data into these slots. This logic has been duplicated 4 times in the GL driver and one more time in the Vulkan driver. Let's just put it all in brw_fs.cpp. Reviewed-by: Kenneth Graunke <[email protected]>
* i965/fs: Rework the persample shading key/prog_data bitsJason Ekstrand2016-05-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reworks and simplifies the way we handle persample shading in the shader key and prog_data. The previous approach had three different key bits that had slightly different and hard-to-decern meanings while the new bits are far more clear. This commit changes it to two easily understood bits that communicate everything we need: 1) key->persample_interp: means that the user has requested persample interpolation through the API. This is equivalent to having SAMPLE_SHADING enabled and having MIN_SAMPLE_SHADING_VALUE set high enough that you actually get multiple per-sample invocations. 2) key->multisample_fbo: means that the shader will be running on an actual multi-sampled framebuffer. This commit also adds a new "persample_dispatch" bit to prog_data which indicates that the shader should be run in persample mode. This way the state setup code doesn't have to look at the fragment program or GL state and can just pull that data out of the prog_data. In theory, this shuffle could mean more recompiles. However, in practice, we were shoving enough state into the key before that we were probably hitting a recompile on every per-sample shader anyway. Reviewed-by: Kenneth Graunke <[email protected]>
* anv: fix build breakRob Clark2016-05-111-1/+1
| | | | | | | | | Previous rename of lower-output-to-temps pass predated merging of anv, and apparently vulkan wasn't enabled in my local builds so overlooked this when rebasing. Reported-by: Mark Janes <[email protected]> Signed-off-by: Rob Clark <[email protected]>
* i965: Generalize wm_key->compute_sample_id to wm_key->multisample_fbo.Kenneth Graunke2016-04-201-1/+1
| | | | | | | | | | | | | | | | I'm going to need a key entry meaning "we have a multisample FBO, and multisampling is enabled" in an upcoming patch. This is basically wm_key->compute_sample_id, except that it also checks that the SAMPLE_ID system value is read. The only use of wm_key->compute_sample_id is in emit_sampleid_setup(), which is only called when handling the SAMPLE_ID system value. So we can just eliminate the check and generalize the field. v2: Also update the Vulkan driver. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* i965: Delete now dead persample_2x FS program key flag.Kenneth Graunke2016-04-201-3/+0
| | | | | | | | | | This was only used by the old gl_SampleID calculations. The new code doesn't need to handle 2x specially. v2: Delete it from the Vulkan driver, too. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* anv/lower_push_constants: Stop treating scalar speciallyJason Ekstrand2016-04-201-4/+1
| | | | | | | | | | All of the code that did something special based on vec4 vs. scalar is bogus. In the backend, everything is now in units of bytes and the vec4 backend can handle full std140 packing so we don't need to do anything special anymore. Signed-off-by: Jason Ekstrand <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94998
* anv/pipeline: Use the right mask for lower_indirect_derefsJason Ekstrand2016-04-141-3/+3
|
* spirv: Move to compiler/Jason Ekstrand2016-04-141-1/+1
| | | | | | While it does rely on NIR, it's not really part of the NIR core. At the moment, it still builds as part of libnir but that can be changed later if desired.
* Merge remote-tracking branch 'public/master' into vulkanJason Ekstrand2016-04-131-1/+1
|
* Merge remote-tracking branch 'origin/master' into vulkanJordan Justen2016-03-171-6/+0
|
* anv: Compact render targetsJason Ekstrand2016-03-081-5/+43
| | | | | | | Previously, we would always emit all of the render targets in the subpass. This commit changes it so that we compact render targets just like we do with other resources. Render targets are represented in the surface map by using a descriptor set index of UINT16_MAX.
* anv/pipeline: Move binding table setup to its own helperJason Ekstrand2016-03-071-21/+18
|
* anv: Quiet pTessellationState warningKristian Høgsberg Kristensen2016-03-061-3/+3
| | | | | | Some application pass a dummy for pTessellationState which results in a lot of noise. Only warn if we're actually given tessellation shadear stages.
* anv: Always use point size from the shaderKristian Høgsberg Kristensen2016-03-051-6/+0
| | | | | | | | | | | | There is no API for setting the point size and the shader is always required to set it. Section 24.4: "If the value written to PointSize is less than or equal to zero, or if no value was written to PointSize, results are undefined." As such, we can just always program PointWidthSource to Vertex. This simplifies anv_pipeline a bit and avoids trouble when we enable the pipeline cache and don't have writes_point_size in the prog_data.
* anv: Also cache the struct anv_pipeline_binding mapsKristian Høgsberg Kristensen2016-03-051-27/+57
| | | | | This is state the we generate when compiling the shaders and we need it for mapping resources from descriptor sets to binding table indices.
* anv: Simplify pipeline cache control flow a bitKristian Høgsberg Kristensen2016-03-051-35/+27
| | | | | No functional change, but the control flow around searching the cache and falling back to compiling is a bit simpler.
* anv: Store prog data in pipeline cache streamKristian Høgsberg Kristensen2016-03-051-46/+58
| | | | | We have to keep it there for the cache to work, so let's not have an extra copy in struct anv_pipeline too.
* anv: Remove left-over bits of sparse-descriptor codeKristian Høgsberg Kristensen2016-03-051-4/+0
|
* anv: Compile shader stages in pipeline order.Kenneth Graunke2016-03-031-22/+26
| | | | | | Instead of the arbitrary order modules might be specified in. Acked-by: Jason Ekstrand <[email protected]>
* Merge remote-tracking branch 'origin/master' into vulkanKenneth Graunke2016-03-011-7/+2
|
* anv/pipeline: Follow push constant alignment restrictions on BDW+ and HSW gt3Jason Ekstrand2016-02-291-1/+8
|
* anv/pipeline: Avoid a division by zeroJason Ekstrand2016-02-291-1/+1
|
* anv/pipeline: Use dynamic checks for max push constantsJason Ekstrand2016-02-291-7/+8
| | | | | The GEN_GEN macros aren't available in anv_pipeline since it only gets compiled once for the whold driver.
* anv/pipeline: Set FS URB space to zero if the FS is unusedJordan Justen2016-02-281-1/+4
| | | | Signed-off-by: Jordan Justen <[email protected]>
* anv/pipeline: Set stage URB size to zero if it is unusedJordan Justen2016-02-281-1/+1
| | | | Signed-off-by: Jordan Justen <[email protected]>
* anv: Set max_hs_threads/max_ds_threadsKristian Høgsberg Kristensen2016-02-241-2/+2
|
* anv: Allocate more push constant space.Kenneth Graunke2016-02-241-5/+11
| | | | | | | | | | | | | | | Previously we allocated 4kB of push constant space for VS, GS, and PS (for a total of 12kB) no matter what. This works, but doesn't fully utilize the space - we have 16kB or 32kB of space. This makes anv use the same method as brw - divide up the space evenly among all active shader stages. This means HS and DS would get space, if those shader stages existed. In the future, we can probably do better by inspecting how many push constants each shader stage uses, and weight things accordingly. But this is strictly better than the old code, and ideally we'd justify a fancier solution with actual performance data.
* anv: Properly size the push constant L3 area.Kenneth Graunke2016-02-241-3/+8
| | | | | We were assuming it was 32kB everywhere, reducing the available URB space. It's actually 16kB on Ivybridge, Baytrail, and Haswell GT1-2.
* anv: Emit 3DSTATE_PUSH_CONSTANT_ALLOC_* via a loop.Kenneth Graunke2016-02-241-0/+6
| | | | Now we're emitting HS and DS packets as well.
* anv: Emit 3DSTATE_URB_* via a loop.Kenneth Graunke2016-02-241-6/+14
| | | | | | | | | | Rather than keeping separate {vs,hs,ds,gs}_start fields, we now store an array indexed by the shader stage (MESA_SHADER_*). The 3DSTATE_URB_* commands are also sequentially numbered. This makes it easy to just emit them in a loop. This simplifies the code a little, and also will make it easier to add more credible HS and DS code later.
* anv/pipeline: Use nir's num_images for allocating image_paramsJason Ekstrand2016-02-181-3/+2
|
* anv/pipeline: Don't leak the binding mapJason Ekstrand2016-02-181-0/+5
|
* Move the intel vulkan driver to src/intel/vulkanJason Ekstrand2016-02-181-0/+1278