Commit graph

75191 commits

Author SHA1 Message Date
Jason Ekstrand
164b3ca164 nir/builder: Add a nir_ssa_undef helper 2015-11-13 17:54:43 -08:00
Jason Ekstrand
ffbc31d13b nir/spirv: Add support for creating image variables 2015-11-13 17:54:43 -08:00
Jason Ekstrand
453239f6a5 nir/spirv: Add support for image types 2015-11-13 17:54:43 -08:00
Jason Ekstrand
0572444a0e nir/types: Add image type helpers 2015-11-13 17:54:43 -08:00
Jason Ekstrand
d5ba7a26d9 glsl/types: Add a get_image_instance helper 2015-11-13 17:54:43 -08:00
Chad Versace
738eaa8acf isl: Embed brw_device_info in isl_device
Suggested-by: Jason Ekstrand <jason.ekstrand@intel.com>
2015-11-13 11:14:03 -08:00
Chad Versace
ba467467f4 anv: Use enum isl_tiling everywhere
In anv_surface and anv_image_create_info, replace member
'uint8_t tile_mode' with 'enum isl_tiling'.

As a nice side-effect, this patch also reduces bug potential because the
hardware enum values for tile modes are unstable across hardware
generations.
2015-11-13 10:44:09 -08:00
Chad Versace
af392916ff anv/device: Embed isl_device
Embed struct isl_device into anv_physical_device and anv_device.  It
will later be used for surface layout calculations.
2015-11-13 10:44:09 -08:00
Chad Versace
a4a2ea3f79 isl: Add enum isl_tiling and a query func
The query func is isl_tiling_get_extent.
2015-11-13 10:44:07 -08:00
Chad Versace
652727b029 isl: Add structs isl_extent2d, isl_extent3d
They are nowhere used yet.
2015-11-13 10:31:49 -08:00
Chad Versace
b1bb270590 isl: Add struct isl_device
The struct is incomplete (it contains only the gen). And it's nowhere
used yet.

It will be used later for surface layout calculations.
2015-11-13 10:31:37 -08:00
Chad Versace
477383e9ac anv: Strip trailing whitespace from anv_device.c 2015-11-13 10:27:40 -08:00
Chad Versace
c6493dff79 anv: Strip trailing space in anv_private.h 2015-11-12 12:24:01 -08:00
Chad Versace
addc2a9d02 anv: Remove redundant fields anv_format::bs,bw,bh,bd
Instead, use the equivalent fields in anv_format::isl_layout.
2015-11-12 12:23:49 -08:00
Chad Versace
cbc31f453d anv/formats: Re-indent the fmt() macro
Use one line per struct member.
2015-11-12 12:21:46 -08:00
Chad Versace
1bea1669c5 anv: Use enum isl_format in anv_format
This patch begins using isl.h in Anvil. More refactors will follow.

Change type of anv_format::surface_format from uint16_t -> enum
isl_format.
2015-11-12 12:21:46 -08:00
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