summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
Commit message (Collapse)AuthorAgeFilesLines
...
* anv: Rework pipeline cachingJason Ekstrand2016-08-301-42/+30
| | | | | | | | | | | | | | | | | | | 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 <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97476 Acked-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
* anv: Add a struct for storing a compiled shaderJason Ekstrand2016-08-301-0/+47
| | | | | | | | | | | | | | | | This new anv_shader_bin struct stores the compiled kernel (as an anv_state) as well as all of the metadata that is generated at shader compile time. The struct is very similar to the old cache_entry struct except that it is reference counted and stores the actual pipeline_bind_map. Similarly to cache_entry, much of the actual data is floating-size and stored after the main struct. Unlike cache_entry, which was storred in GPU-accessable memory, the storage for anv_shader_bin kernels comes from a state pool. The struct itself is reference-counted so that it can be used by multiple pipelines at a time without fear of allocation issues. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org> Acked-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
* anv: Add pipeline_has_stage guards a few placesJason Ekstrand2016-08-301-0/+7
| | | | | | | | | All of these worked before because they were depending on prog_data to be null. Soon, we won't be able to depend on a nice prog_data pointer and it's nice to be more explicit anyway. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Remove unused fields from anv_pipeline_bind_mapJason Ekstrand2016-08-301-2/+0
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/allocator: Correctly set the number of bucketsJason Ekstrand2016-08-301-1/+1
| | | | | | | | | | | | The range from ANV_MIN_STATE_SIZE_LOG2 to ANV_MAX_STATE_SIZE_LOG2 should be inclusive and we have asserts that ensure that you never try to allocate a state larger than (1 << ANV_MAX_STATE_SIZE_LOG2). However, without adding 1 to the difference, we allocate 1 too few bucckts and so, even though we have an assert, anything landing in the last bucket will fail to allocate properly.. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Include the pipeline layout in the shader hashJason Ekstrand2016-08-241-0/+3
| | | | | | | | | | | | 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 <jason@jlekstrand.net> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Add an align_down_npot_u32 helperJason Ekstrand2016-07-151-0/+6
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/image: Fix initialization of the ISL tilingNanley Chery2016-07-151-0/+3
| | | | | | | | | | | | | | | If an internal user creates an image with Vulkan tiling VK_IMAGE_TILING_OPTIMAL and an ISL tiling that isn't set, ISL will fail to create the image as anv_image_create_info::isl_tiling_flags will be an invalid value. Correct this by making anv_image_create_info::isl_tiling_flags an opt-in, filtering bitmask, that allows the caller to specify which ISL tilings are acceptable, but not contradictory to the Vulkan tiling. Opt-out of filtering for vkCreateImage. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/dump: Add support for dumping framebuffersJason Ekstrand2016-07-091-0/+10
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv/dump: Take an aspect in dump_image_to_ppmJason Ekstrand2016-07-091-1/+2
| | | | Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv: Add anv_render_pass_attachment::store_opChad Versace2016-06-231-0/+1
| | | | | | | | | | Will be needed for resolving auxiliary surfaces. I didn't add anv_render_pass_attachment::stencil_store_op, as the driver would likely never use it, as stencil surfaces never have auxiliary surfaces. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Use different BOs for different scratch sizes and stagesJason Ekstrand2016-06-221-3/+1
| | | | | | | | | 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 <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Add an allocator for scratch buffersJason Ekstrand2016-06-221-0/+13
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd: Move emit_descriptor_pointers to genX_cmd_buffer.cJason Ekstrand2016-06-211-2/+0
| | | | | | | | It's tiny and fully generic so there's really no reason for it to be in a gen7-specific file. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd: Move flush_descriptor_sets to anv_cmd_buffer.cJason Ekstrand2016-06-211-1/+1
| | | | | | | There's no good reason for recompiling it Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Add proper support for depth clampingJason Ekstrand2016-06-201-1/+4
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/cmd_buffer: Split emit_viewport in twoJason Ekstrand2016-06-201-0/+1
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/pipeline: Store the (set, binding, index) tripple in the bind mapJason Ekstrand2016-06-101-4/+7
| | | | | | | | | | | 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 <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/descriptor_set: Add a type field in debug buildsJason Ekstrand2016-06-101-0/+5
| | | | | | | | This allows for some extra validation and makes it easier to see what's going on when poking around in gdb. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* i965: Store number of threads in brw_cs_prog_dataJordan Justen2016-06-011-1/+0
| | | | | | Cc: "12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: strdup the device path into the physical deviceJason Ekstrand2016-05-271-1/+1
| | | | | This way we don't have to assume that the string coming in is a piece of constant data that exists forever.
* anv/cmd_buffer: Only emit PIPE_CONTROL on-demandJason Ekstrand2016-05-271-0/+40
| | | | | | | | | | | This is in contrast to emitting it directly in vkCmdPipelineBarrier. This has a couple of advantages. First, it means that no matter how many vkCmdPipelineBarrier calls the application strings together it gets one or two PIPE_CONTROLs. Second, it allow us to better track when we need to do stalls because we can flag when a flush has happened and we need a stall. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv/clear: Only clear the render area when doing subpass clearsJason Ekstrand2016-05-271-0/+1
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv: Move push constant allocation to the command bufferJason Ekstrand2016-05-271-1/+1
| | | | | | | | | | 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 <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* vk/intel: use negative VK_NO_PROTOTYPES schemeEric Engestrom2016-05-231-1/+0
| | | | | | | | | | 3d0fac7aca237bbe8ed8e2a362d3b42d0ef8c46c changed all VK_PROTOTYPES to VK_NO_PROTOTYPES This brings the Intel header in line with the rest of the Vulkan code. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Chad Versace <chad.versace@intel.com>
* anv/device: Add a boolean for robust buffer accessJason Ekstrand2016-05-191-0/+1
|
* anv: Port L3 cache programming from i965Jordan Justen2016-05-171-1/+11
| | | | | Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Keep track of whether the data cache should be enabled in L3Jordan Justen2016-05-171-0/+1
| | | | | | | | If images or shader buffers are used, we will enable the data cache in the the L3 config. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Add a devinfo argument to the get_format functionsJason Ekstrand2016-05-171-5/+5
|
* anv: Use 16 bits for the isl_format in anv_formatJason Ekstrand2016-05-171-1/+1
| | | | This way the entire anv_format structure fits in 32 bits
* anv/formats: Use the isl_channel_select enum for the swizzleJason Ekstrand2016-05-171-4/+4
|
* anv/formats: Add an anv_get_format helperJason Ekstrand2016-05-171-5/+9
| | | | | | | | | This commit removes anv_format_for_vk_format and adds an anv_get_format helper. The anv_get_format helper returns the anv_format by-value. Unlike anv_format_for_vk_format the format returned by anv_get_format is 100% accurate and includes any tweaks needed for tiled vs. linear. anv_get_isl_format is now just a wrapper around anv_get_format that picks off just the isl_format.
* anv/format: Simplify anv_formatJason Ekstrand2016-05-171-18/+1
| | | | | | Now that we have VkFormat introspection and we've removed everything that tried to use anv_format for introspection, we no longer need most of what was in anv_format.
* anv: Remove the anv_format member from anv_imageJason Ekstrand2016-05-171-1/+0
|
* anv: Change render_pass_attachment.format to a VkFormatJason Ekstrand2016-05-171-1/+1
|
* anv/image: Add an aspects fieldJason Ekstrand2016-05-171-1/+2
| | | | | This makes several checks easier and allows us to avoid calling anv_format_for_vk_format in a number of cases.
* anv: Make format_for_descriptor return an isl_formatJason Ekstrand2016-05-171-2/+2
|
* anv/wsi: Make WSI per-physical-device rather than per-instanceJason Ekstrand2016-05-171-8/+8
| | | | | This better maps to the Vulkan object model and also allows WSI to at least know the hardware generation which is useful for format checks.
* i965/fs: Organize prog_data by ksp number rather than SIMD widthJason Ekstrand2016-05-141-5/+0
| | | | | | | | | | 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 <kenneth@whitecape.org>
* anv: s/anv_batch_emit_blk/anv_batch_emit/Jason Ekstrand2016-04-201-1/+1
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv: Remove the old emit macroJason Ekstrand2016-04-201-10/+0
| | | | Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv: Add a new block-based batch emit macroJason Ekstrand2016-04-201-0/+9
| | | | | | | | | This new macro uses a for loop to create an actual code block in which to place the macro setup code. One advantage of this is that you syntatically use braces instead of parentheses. Another is that the code in the block doesn't even get executed if anv_batch_emit_dwords fails. Acked-by: Kristian Høgsberg <krh@bitplanet.net>
* anv: fix build without Wayland platformMarcin Ślusarz2016-04-201-3/+0
| | | | Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Replace ::disable_scissor with ::use_rectlistsNanley Chery2016-04-131-1/+0
| | | | | | | | | Meta currently uses screenspace RECTLIST primitives that lie within the framebuffer rectangle. Since this behavior shouldn't change in the future, disable the scissor operation whenever rectlists are used. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
* anv: Delete anv_graphics_pipeline_create_info::disable_viewportNanley Chery2016-04-131-1/+0
| | | | | | | There are no users of this field. Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
* anv/image: Remove the offset parameter from image_view_initJason Ekstrand2016-04-081-1/+0
| | | | | | | The only place we were using this was in meta_blit2d which always creates a new image anyway so we can just use the image offset. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/image: Expose the guts of CreateBufferView for metaJason Ekstrand2016-04-081-0/+5
| | | | Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/blit2d: Refactor in preparation for different src/dst typesJason Ekstrand2016-04-081-3/+6
| | | | Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/blit2d: Add layouts for using a texel buffer sourceJason Ekstrand2016-04-081-2/+4
| | | | Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
* anv/blit2d: Rename the descriptor set and pipeline layoutsJason Ekstrand2016-04-081-2/+2
| | | | Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>