Commit graph

100 commits

Author SHA1 Message Date
Jason Ekstrand
3fe1f118f8 anv/cmd_buffer: Fix a pointer-cast typo 2015-12-31 12:07:43 -08:00
Kristian Høgsberg Kristensen
fc03723bcd vk: Fill out buffer surface state when updating descriptor set
We can do this when we update the descriptor set instead of on the
fly.
2015-12-28 21:57:56 -08:00
Kristian Høgsberg Kristensen
c4802bc44c vk/gen8: Implement VkEvent for gen8
We use PIPE_CONTROL for setting and resetting the event from cmd buffers
and MI_SEMAPHORE_WAIT in polling mode for waiting on an event.
2015-12-19 22:17:19 -08:00
Jordan Justen
5e82a91324 anv/gen8: Add support for gl_NumWorkGroups
Co-authored-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-18 01:45:11 -08:00
Jason Ekstrand
783a21192c anv: Add support for storage texel buffers 2015-12-14 16:51:12 -08:00
Jason Ekstrand
1f98bf8da0 anv: Pass an isl_format into fill_buffer_surface_state 2015-12-14 16:14:20 -08:00
Jordan Justen
c4219bc6ff anv/cmd_buffer: Gen 8 requires 64 byte alignment for push constant data
See MEDIA_CURBE_LOAD, CURBE Data Start Address & CURBE Total Data Length

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-14 15:39:07 -08:00
Jason Ekstrand
dba28da075 anv/buffer_view: Store a bo + offset instead of buffer pointer
This is what image_view does.  Also, we really need to do this so that we
can properly handle the combined offsets from the buffer and from
pCreateInfo.

This fixes some of the nonzero offset buffer view CTS tests.
2015-12-14 14:10:40 -08:00
Jason Ekstrand
c56186026f anv: Add initial support for texel buffers 2015-12-12 16:11:23 -08:00
Jason Ekstrand
3893e11f4b anv: Use 4 instead of sizeof(gl_constant_value)
We no longer have access to gl_constant_value and, really, it's 4 because
our uniform layout code works entirely in dwords.
2015-12-10 18:55:16 -08:00
Jason Ekstrand
d5c9955d3e Merge remote-tracking branch 'mesa-public/master' into vulkan
This pulls in nir_intrinsic_load/store changes and the switch of all
uniforms in i965 to bytes.  This accounts for the Vulkan changes.
2015-12-10 18:29:36 -08:00
Jordan Justen
f8d5fb4293 anv: Add anv_cmd_buffer_cs_push_constants
Similar to anv_cmd_buffer_push_constants, but handles the compute
pipeline, which requires different setup from the other stages.

This also handles initializing the compute shader local IDs.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2015-12-09 11:02:20 -08:00
Jason Ekstrand
43ac954e25 anv: Add initial support for pushing image params
The helper to fill out the image params data-structure is stilly a dummy,
but this puts the infastructure in place.
2015-12-07 21:08:26 -08:00
Kristian Høgsberg
773592051b vk: clflush all state for non-LLC GPUs 2015-12-04 09:51:47 -08:00
Jason Ekstrand
a5f19f64c3 vk/0.210.0: Remove the VkShaderStage enum
This made for an unfortunately large amount of work since we were using it
fairly heavily internally.  However, gl_shader_stage does basically the
same things, so it's not too bad.
2015-12-03 13:43:54 -08:00
Jason Ekstrand
938a2939c8 vk/0.210.0: We now allocate command buffers; not create them 2015-12-03 13:43:53 -08:00
Jason Ekstrand
fcfb404a58 vk/0.210.0: Rework allocation to use the new pAllocator's 2015-12-03 13:43:53 -08:00
Jason Ekstrand
17486b8664 vk/0.210.0: More fun with flags fields 2015-12-03 13:43:52 -08:00
Jason Ekstrand
2e10ca5748 vk/0.210.0: Misc. function argument renames 2015-12-03 13:43:51 -08:00
Jason Ekstrand
4ab9391fbb vk/0.210.0: Rework dynamic states 2015-11-30 14:19:41 -08:00
Jason Ekstrand
a89a485e79 vk/0.210.0: Rename CmdBuffer to CommandBuffer 2015-11-30 11:48:08 -08:00
Kristian Høgsberg Kristensen
cd4721c062 vk: Add SKL support
Signed-off-by: Kristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
2015-11-25 22:34:10 -08:00
Jason Ekstrand
6f613abc2b anv/cmd_buffer: Add a new genX_cmd_buffer file for shared code
This file contains code that can be shared across gens modulo recompiling.
In particular, we can share STATE_BASE_ADDRESS setup and handling of the
vkPipelineBarrier call.  Not sharing STATE_BASE_ADDRESS setup has already
been a source of bugs and the gen7 and gen8 implementations of
PipelineBarrier were line-for-line identical.

Incidentally, this should fix MOCS settings for dynamic and surface state
on Haswell.
2015-11-18 12:26:57 -08:00
Jason Ekstrand
0508046dc8 anv/cmd_buffer: Pack the 3DSTATE_VF packet on-demand 2015-11-17 08:27:51 -08:00
Jason Ekstrand
cb9e2305f8 anv/cmd_buffer: Move gen-specific stuff into the appropreate files 2015-11-16 12:10:11 -08:00
Jason Ekstrand
002db3ee15 anv/cmd_buffer: Add a default descriptor type case
This silences a bunch of compiler warnings.
2015-11-14 09:16:55 -08:00
Jason Ekstrand
399d5314f6 anv/cmd_buffer: Rework the way we emit UBO surface state
The new mechanism should be able to handle SSBOs as well as properly handle
emitting surface state on gen7 where we need different strides depending on
shader stage.
2015-11-06 15:14:12 -08:00
Jason Ekstrand
220261a0c9 anv: Use VkDescriptorType instead of anv_descriptor_type 2015-11-06 14:09:52 -08:00
Jason Ekstrand
612e35b2c6 anv: Do range-checking in the shader for dynamic buffers 2015-11-06 13:32:52 -08:00
Jason Ekstrand
d7cc9929bb anv: Remove all support for BufferViews
We never *actually* supported them, we just used them for binding UBOs.
Now that we have BufferInfo and we aren't supporting texture buffers yet,
we should get rid of them until we can do them properly.
2015-11-06 13:16:18 -08:00
Jason Ekstrand
a40f682c71 anv/cmd_buffer: Fix SURFACE_STATE for non-view buffer bindings
We were treating it as if it's a BufferView and weren't taking the offset
into account properly.
2015-11-04 19:56:18 -08:00
Jason Ekstrand
1b68120760 anv/cmd_buffer: Don't use an anv_state pointer in emit_binding_table
The anv_state is supposed to be a flyweight so we're not really saving
anything by using a pointer.  Also, we were creating one, setting a pointer
to it, and then having it go out-of-scope which is bad.
2015-11-04 19:56:16 -08:00
Chad Versace
4d1c76485b anv: Drop stale comment in anv_cmd_buffer_emit_binding_table()
When emitting the binding table for the fragment shader stage, we no
longer "walk all of the attachments, [inserting only] the color
attachments into the binding table". Instead, we iterate only over the
subpass's color attachments, which is the minimal possible iteration.

While killing the comment, also rename the variable 'attachments' to
'color_count', as it's no longer a count of all framebuffer attachments
but only the subpass's color attachment count.
2015-11-03 13:46:40 -08:00
Chad Versace
4d4e559b6a vk: Use consistent names for anv_cmd_state dirty bits
Prefix all anv_cmd_state dirty bit tokens with ANV_CMD_DIRTY. For
example:

    old                           -> new
    ANV_DYNAMIC_VIEWPORT_DIRTY    -> ANV_CMD_DIRTY_DYNAMIC_VIEWPORT
    ANV_CMD_BUFFER_PIPELINE_DIRTY -> ANV_CMD_DIRTY_PIPELINE

Change type of anv_cmd_state::dirty and ::compute_dirty from uint32_t to
the self-documenting type anv_cmd_dirty_mask_t.
2015-10-20 11:40:24 -07:00
Jason Ekstrand
2552df41a1 anv/cmd_buffer: Reset the command buffer in BeginCommandBuffer 2015-10-15 18:28:00 -07:00
Jason Ekstrand
03952b1513 anv/device: Add support for combined image and sampler descriptors 2015-10-15 15:17:27 -07:00
Jason Ekstrand
bed7d1e03c anv: Add support for BufferInfo in descriptor sets 2015-10-15 13:45:53 -07:00
Jason Ekstrand
896c1c65d6 anv: Get rid of the descriptor_set_binding struct
We no longer need it as we have a better way to deal with dynamic offsets.
2015-10-14 19:02:29 -07:00
Jason Ekstrand
b37c38c1ca anv: Completely rework descriptor set layouts
This patch reworks a bunch of stuff in the way we do descriptor set
layouts.  Our previous approach had a couple of problems.  First, it was
based on a misunderstanding of arrays in descriptor sets.  Second, it
didn't properly handle descriptor sets where some bindings were missing
stages.  The new apporach should be correct and also makes some operations,
particularly those on the hot-path, a bit easier.

We use the descriptor set layout for four things:

 1) To determine the map from bindings to the actual flattened descriptor
    set in vkUpdateDescriptorSets().

 2) To determine the descriptor <-> binding table entry mapping to use in
    anv_cmd_buffer_flush_descriptor_sets().

 3) To determine the mappings of dynamic indices.

 4) To determine the (set, binding, array index) -> binding table entry
    mapping inside of shaders.

The new approach is directly taylored towards these operations.
2015-10-14 18:38:33 -07:00
Jason Ekstrand
1a52bc3039 anv/pipeline: Add support for dynamic state in pipelines 2015-10-07 09:40:49 -07:00
Jason Ekstrand
daf68a9465 vk/0.170.2: Switch to the new dynamic state model 2015-10-07 09:40:49 -07:00
Jason Ekstrand
55fcca306b anv: Add a dynamic state data structure and basic helpers 2015-10-07 09:36:27 -07:00
Chad Versace
24de3d49ea vk: Embed two surface states in anv_image_view
This prepares for merging VkAttachmentView into VkImageView.  The two
surface states are:

   anv_image_view::color_rt_surface_state:
       RENDER_SURFACE_STATE when using image as a color render target.

   anv_image_view::nonrt_surface_state;
       RENDER_SURFACE_STATE when using image as a non render target.

No Crucible regressions.
2015-10-06 21:22:18 -07:00
Chad Versace
d4446a7e58 vk: Merge anv_attachment_view into anv_image_view
This prepares for merging VkAttachmentView into VkImageView.
2015-10-06 12:13:03 -07:00
Jason Ekstrand
05a26a60c8 vk/0.170.2: Make destructors return void 2015-10-05 20:50:51 -07:00
Jason Ekstrand
8e1ef639b6 vk/0.170.2: Add the subpass field to VkCmdBufferBeginInfo 2015-10-05 20:30:53 -07:00
Chad Versace
9357062348 vk: Merge anv_*_attachment_view into anv_attachment_view
Remove anv_color_attachment_view and anv_depth_stencil_view, merging
them into anv_attachment_view. This prepares for merging
VkAttachmentView into VkImageView.
2015-10-05 17:46:04 -07:00
Chad Versace
f0f4dfa9cc vk: Drop anv_surface_view
Push the members of struct anv_surface_view into anv_image_view and
anv_buffer_view, then remove struct anv_surface_view. Observe that
anv_surface_view::range is not needed for anv_image_view, and so was
dropped there.

This prepares for the merge of VkAttachmentView into VkImageView. Remove
the common parent of anv_buffer_view and anv_image_view (that is,
anv_surface_view) will make the merge easier.
2015-10-05 17:46:04 -07:00
Chad Versace
74193a880f vk: Use consistent names for anv_*_view variables
Rename all anv_*_view variables to follow this convention:
    - sview -> anv_surface_view
    - bview -> anv_buffer_view
    - iview -> anv_image_view
    - aview -> anv_attachment_view
    - cview -> anv_color_attachment_view
    - ds_view -> anv_depth_stencil_attachment_view

This clarifies existing code. And it will reduce noise in the upcoming
commits that merge VkAttachmentView into VkImageView.
2015-10-05 17:46:04 -07:00
Chad Versace
ffd051830d vk: Unionize anv_desciptor
For a given struct anv_descriptor, all members are NULL (in which case
the descriptor is empty) or exactly one member is non-NULL.
To make struct anv_descriptor better reflect its set of valid states,
convert the struct into a tagged union.
2015-10-05 17:46:04 -07:00