Commit graph

75175 commits

Author SHA1 Message Date
Chad Versace
bfb022a235 isl: Generate isl_format_layout.c
Generate an array of struct isl_format_layout, using
isl_format_layout.csv as input.

Each entry follows the patten:

   [ISL_FORMAT_R32G32B32A32_FLOAT] = {
      ISL_FORMAT_R32G32B32A32_FLOAT,
      .bs = 16, .bpb = 128,
      .bw = 1, .bh = 1, .bd = 1,
      .channels = {
          .r = { ISL_SFLOAT, 32 },
          .g = { ISL_SFLOAT, 32 },
          .b = { ISL_SFLOAT, 32 },
          .a = { ISL_SFLOAT, 32 },
          .l = {},
          .i = {},
          .p = {},
      },
      .colorspace = ISL_COLORSPACE_LINEAR,
      .txc = ISL_TXC_NONE,
   },
2015-11-12 12:21:46 -08:00
Chad Versace
7986efc644 isl: Add CSV of format layouts
Add file isl_format_layout.csv, which describes the block layout,
channel layout, and colorspace of all hardware surface formats.
2015-11-12 11:56:16 -08:00
Chad Versace
67362698a9 isl: Add enum isl_format 2015-11-12 11:34:45 -08:00
Jason Ekstrand
3a3d79b38e anv/gen7: Implement the VS state depth-stall workaround 2015-11-10 16:42:34 -08:00
Jason Ekstrand
750b8f9e98 anv/gen7: Properly handle a GS with zero invocations 2015-11-10 16:41:23 -08:00
Jason Ekstrand
9d18555c8d anv/gen7: Add push constant support 2015-11-10 15:14:11 -08:00
Jason Ekstrand
427978d933 anv/device: Use an actual int64_t in WaitForFences 2015-11-10 15:02:52 -08:00
Jason Ekstrand
d9079648d0 anv/meta: Create a sampler in meta_emit_blit 2015-11-10 14:43:18 -08:00
Jason Ekstrand
b461744c52 anv/gen7: Properly handle VS with VertexID but no vertices 2015-11-10 11:31:31 -08:00
Jason Ekstrand
aafc87402d anv/device: Work around the i915 kernel driver timeout bug
There is a bug in some versions of the i915 kernel driver where it will
return immediately if the timeout is negative (it's supposed to wait
indefinitely).  We've worked around this in mesa for a few months but never
implemented the work-around in the Vulkan driver.

I rediscovered this bug again while working on Ivy Bridge becasuse the
drive in my Ivy Bridge currently has Fedora 21 installed which has one of
the offending kernels.
2015-11-10 11:24:11 -08:00
Jason Ekstrand
06f466a770 anv/nir: Fix codegen in lower_push_constants 2015-11-09 16:29:05 -08:00
Jason Ekstrand
abede04314 anv/gen7: Fix the length of 3DSTATE_SF 2015-11-09 16:04:07 -08:00
Jason Ekstrand
e8c2a52a70 anv/gen7: Properly handle missing color-blend state 2015-11-09 16:04:06 -08:00
Jason Ekstrand
862da6a891 anv/device: Add a newline to the end of a comment 2015-11-09 16:04:06 -08:00
Nanley Chery
9c2b37a9c3 anv/formats: Define ETC2 formats
Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-11-09 15:41:41 -08:00
Nanley Chery
41cf35d1d8 anv/image: Determine the alignment units for compressed formats
Alignment units, i and j, match the compressed format block
width and height respectively.

v2: Don't assert against HALIGN* and VALIGN* enums (Chad)

Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-11-09 15:41:41 -08:00
Nanley Chery
381f602c6b anv/image: Handle compressed format qpitch and padding
Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-11-09 15:41:41 -08:00
Nanley Chery
300f7c2be3 anv/image: Handle compressed format stride and size
These formulas did not take compressed formats into account.

Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-11-09 15:41:41 -08:00
Nanley Chery
7b4244dea0 anv/formats: Add fields for block dimensions
A non-compressed texture is a 1x1x1 block. Compressed
textures could have values which vary in different
dimensions WxHxD.

Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-11-09 15:41:41 -08:00
Nanley Chery
a6c7d1e016 anv/formats: Add surface_format initializer
v2: Rename __brw_fmt to __hw_fmt (Chad)

Suggested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Reviewed-by: Chad Versace chad.versace@intel.com
2015-11-09 15:41:41 -08:00
Nanley Chery
3ee923f1c2 anv: Rename cpp variable to "bs"
cpp (chars-per-pixel) is an integer that fails to give useful data
about most compressed formats. Instead, rename it to "bs" which
stands for block size (in bytes).

v2: Rename vk_format_for_bs to vk_format_for_size (Chad)
    Use "block size" instead of "bs" in error message (Chad)

Reviewed-by: Chad Versace <chad.versace@intel.com>
2015-11-09 15:41:41 -08:00
Jason Ekstrand
17fa3d3572 nir/spirv: Give both block and buffer_block types an interface type 2015-11-07 08:03:25 -08:00
Jason Ekstrand
a10d59c09a nir/spirv: Increment num_ubos/ssbos when creating variables 2015-11-06 16:53:27 -08:00
Jason Ekstrand
046563167c anv/apply_dynamic_offsets: Use the right sized immediate zero 2015-11-06 16:49:24 -08:00
Jason Ekstrand
104525c33b anv/pipeline: Set the right SSBO binding table start index for FS 2015-11-06 15:57:51 -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
1b5c7e7ecd anv/pipeline: Expose is_scalar_shader_stage 2015-11-06 15:12:33 -08:00
Jason Ekstrand
5ba281e794 nir/spirv: Add a helper for determining if a block is externally visable 2015-11-06 15:09:57 -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
f8052351ac anv/device: Increase the block size for instructions 2015-11-06 13:29:47 -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
0360c3608b anv/device: Only support binding UBOs through BufferInfo 2015-11-06 12:52:12 -08:00
Jason Ekstrand
3aa2fc82dd anv: Rework UpdateDescriptorSets
Previously, UpdateDescriptorSets was wrong because it assumed that the
binding was the offset into the descriptor set.
2015-11-06 12:28:03 -08:00
Jason Ekstrand
45b1bbe801 anv: Add a descriptor_index to anv_descriptor_set_binding_layout 2015-11-06 12:16:54 -08:00
Jason Ekstrand
f029e0ce13 anv: Add a layout to anv_descriptor_set 2015-11-06 12:16:54 -08:00
Chad Versace
16119ad884 anv/meta: Finish load clears for stencil attachments
Tested by Crucible "func.depthstencil.stencil_triangles.*" in

  commit c194292d5eadb84e9d7489fc01ce0b653cdd4ca5 (HEAD -> master)
  Author: Chad Versace <chad.versace@intel.com>
  Date:   Wed Nov 4 16:19:24 2015 -0800
  Subject: func.depthstencil: Remove stencil clear workaround for Mesa
2015-11-05 15:45:43 -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
d259af3fbb anv: Remove unused anv_render_pass members
Remove members
  num_color_clear_attachments
  has_depth_clear_attachment
  has_stencil_clear_attachment

The new clear code in anv_meta_clear.c does not use them.
2015-11-04 15:54:38 -08:00
Chad Versace
a9a3071fc4 anv/meta: Rewrite clear code
Fixes Crucible test "func.clear.load-clear.attachments-8".

The old clear code, when clearing attachments for
VK_ATTACHMENT_LOAD_OP_CLEAR, suffered from some fundamental bugs. The
bugs were not fixable with the old code's approach.

    - It assumed that a VkRenderPass contained at most one depthstencil
       attachment.

    - It tried to clear all attachments (color and the sole
      depthstencil) with a single instanced draw call, using the VUE
      header's RenderTargetArrayIndex to specify the instance's target
      color attachment. But the RenderTargetArrayIndex does not select
      entries in the binding table; it only selects an array index of
      a singled layered surface.

    - If at least one attachment of VkRenderPass had
      VK_ATTACHMENT_LOAD_OP_CLEAR,
      then the old code cleared *all* attachments. This was
      a consequence of using a single draw call and single pipeline for
      the clear.

The new clear code fixes those bugs by making a separate draw call for
each attachment, and using one pipeline when clearing color attachments
and a different pipeline for depth attachments.

The new code, like the old code, does not clear stencil attachments. It
is left as a FINISHME.
2015-11-04 15:20:52 -08:00
Chad Versace
49c96a14c5 anv/meta: Clear color attribute is always flat
No behavioral change. This patch just removes an unneeded function
parameter.
2015-11-04 15:15:19 -08:00
Chad Versace
7f82cc718f anv/meta: Use consistent naming for dynamic state mask
Consistently rename bitmasks of Vulkan dynamic state to 'dynamic_mask'.

  anv_meta_saved_state::dynamic_flags -> dynamic_mask
  anv_meta_save(dynamic_state)        -> dynamic_mask
2015-11-04 15:15:19 -08:00
Chad Versace
2bdb9e2ed9 anv/meta: Rename anv_cmd_buffer_save/restore
As the functions are now exposed in anv_meta.h, let's rename them
to clarify that they are meta functions.

    anv_cmd_buffer_save -> anv_meta_save
    anv_cmd_buffer_restore -> anv_meta_restore
2015-11-04 15:15:19 -08:00
Chad Versace
16b2a489db anv: Move meta clear code to new file anv_meta_clear.c
anv_meta.c currently handles blits, copies, clears, and resolves.  The
clear code is about to grow, and anv_meta.c is already busting at the
seams.
2015-11-04 15:15:19 -08:00
Chad Versace
c56727037a anv: Move struct anv_vue_header to anv_private.h
Move it from anv_meta.c to the common header anv_private.h. This allows
us to split the meta blit and meta clear code into separate files.
2015-11-04 15:15:19 -08:00
Jason Ekstrand
b00e3f221b Merge remote-tracking branch 'mesa-public/master' into vulkan 2015-11-03 15:45:04 -08:00
Jason Ekstrand
a1e7b8701a nir: remove sampler_set from nir_tex_instr
Now that descriptor sets are handled in a lowering pass, this is no longer
needed.
2015-11-03 14:58:20 -08:00
Ben Widawsky
5d4b019d2a i965/gen8+: Extract color clear surface state
On future generation platforms the color clear value is stored elsewhere in the
surface state. By extracting this logic, we can cleanly implement the difference
in an upcoming patch.

Should have no functional impact.

v2: Move hunk from the next patch into this patch (Matt)
Whitespace fix (Ben)

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-11-03 13:49:21 -08:00
Ben Widawsky
f3223ebd6c i965/gen8+: Remove redundant zeroing of surface state
The allocate_surface_state already zeroes out the surface state, and doing it
later in the function is destructive for what we want to accomplish when we
split out support for gen9 fast clears (next patch).

NOTE: Only dword 12 actually needed to be fixed, but it seemed more consistent
to remove the other instances as well. I can make an argument both ways (open
coding it, vs. not). I can rework the next patch if requires.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chad Versace <chad.versace@intel.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
2015-11-03 13:49:21 -08:00