Chad Versace [Mon, 25 Jan 2016 23:08:33 +0000 (15:08 -0800)]
isl/tests: Rename t_assert_offset()
Rename it to t_assert_offset_el(), clarifying that the offset in units
of surface elements, not samples.
Chad Versace [Mon, 25 Jan 2016 20:15:07 +0000 (12:15 -0800)]
isl: Add func isl_surf_get_image_offset_el()
This replaces function isl_surf_get_image_offset_sa()
Chad Versace [Mon, 25 Jan 2016 20:23:57 +0000 (12:23 -0800)]
isl: Fix row pitch for compressed formats
When calculating row pitch, the row's width in samples must be divided
by the format's block width. The commit below accidentally removed the
division.
commit
eea2d4d05987b4f8ad90a1588267f9495f1e9e99
Author: Chad Versace <chad.versace@intel.com>
Date: Tue Jan 5 14:28:28 2016 -0800
Subject: isl: Don't align phys_slice0_sa.width twice
Chad Versace [Mon, 25 Jan 2016 19:45:12 +0000 (11:45 -0800)]
isl: Add func isl_surf_get_tile_info()
Kenneth Graunke [Wed, 27 Jan 2016 23:07:18 +0000 (15:07 -0800)]
vtn: Fix atan2 for non-scalars.
The if/then/else block was bogus, as it can only take a scalar
condition, and we need to select component-wise. The GLSL IR
implementation of atan2 handles this by looping over components,
but I decided to try and do it vector-wise, and messed up.
For now, just bcsel. It means that we do the atan1 math even if
all components hit the quick case, but it works, and presumably
at least one component will hit the expensive path anyway.
Kenneth Graunke [Wed, 27 Jan 2016 22:20:47 +0000 (14:20 -0800)]
vtn: Fix Modf.
We were botching this for negative numbers - floor of a negative rounds
the wrong way. Additionally, both results are supposed to retain the
sign of the original.
To fix this, just take the abs of both values, then put the sign back.
There's probably a better way to do this, but this works for now.
Kenneth Graunke [Wed, 27 Jan 2016 20:21:04 +0000 (12:21 -0800)]
i965: Fix SIN/COS precision problems.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Kristian Høgsberg Kristensen [Wed, 27 Jan 2016 19:36:44 +0000 (11:36 -0800)]
anv: Put back code to grow shader scratch space
This was lost in commit
a71e614d33e8d869bbaced8948349a7180783ab7.
Kenneth Graunke [Wed, 27 Jan 2016 07:09:45 +0000 (23:09 -0800)]
anv: Update the device limits.
Fixes dEQP-VK.api.info.device.properties. I haven't tested any others.
Jason Ekstrand [Wed, 27 Jan 2016 06:10:11 +0000 (22:10 -0800)]
gen7/cmd_buffer: SCISSOR_RECT structs are tightly packed
The pointer has to be 32-byte aligned, but the structs themselves are 2
dwords each, tightly packed.
Jason Ekstrand [Wed, 27 Jan 2016 05:52:59 +0000 (21:52 -0800)]
anv/pipeline: Set MaximumVPIndex in 3DSTATE_CLIP
Jason Ekstrand [Wed, 27 Jan 2016 05:45:21 +0000 (21:45 -0800)]
anv/pipeline: Only lower input indirects if EmitNoIndirectInput is set
Jason Ekstrand [Wed, 27 Jan 2016 01:28:16 +0000 (17:28 -0800)]
anv/formats: Use is_power_of_two instead of is_rgb to determine renderability
Jason Ekstrand [Wed, 27 Jan 2016 01:10:57 +0000 (17:10 -0800)]
HACK/i965/surface_formats: Mark A4B4G4R4 as being supported
The table has this marked as unsupported on all gens, but I don't really
believe that given how early it is in the table. I've tested and it seems
to work on Broadwell. The Bspec says that it sould be renderable on SKL+
but alpha blending is questionable.
Side note: We really need to audit the format table again.
Jordan Justen [Tue, 26 Jan 2016 19:10:56 +0000 (11:10 -0800)]
anv: Support swizzled formats.
Some formats require a swizzle in order to map them to actual hardware
formats. This allows us to turn on two new Vulkan formats.
Jason Ekstrand [Wed, 27 Jan 2016 04:16:43 +0000 (20:16 -0800)]
anv/image: Do swizzle remapping in anv_image.c
TODO: At some point, we really need to make an image_view_init_info that's
a flyweight and stop stuffing everything into image_view.
Jason Ekstrand [Tue, 26 Jan 2016 23:59:43 +0000 (15:59 -0800)]
HACK: Expose support for stencil blits
If someone actually tries to use them, they won't work, but at least we
don't fail to return format properties now.
Kenneth Graunke [Wed, 27 Jan 2016 01:02:35 +0000 (17:02 -0800)]
vtn: Delete references to IMix opcode.
This is being removed in SPIR-V.
Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15452
Ben Widawsky [Tue, 26 Jan 2016 23:42:08 +0000 (15:42 -0800)]
i965/skl: Utilize new 5th bit for gateway messages
Cc: Jordan Justen <jordan.l.justen@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
Jason Ekstrand [Tue, 26 Jan 2016 23:44:18 +0000 (15:44 -0800)]
genX/pipeline: Don't make vertex bindings with holes
Jason Ekstrand [Tue, 26 Jan 2016 23:44:02 +0000 (15:44 -0800)]
anv/cmd_buffer: Put base_instance in the second component
Francisco Jerez [Tue, 26 Jan 2016 22:50:52 +0000 (14:50 -0800)]
anv/image: clflush surface state map in anv_fill_buffer_surface_state().
Some of its users had the required clflush on non-LLC platforms, some
didn't. Put the clflush in anv_fill_buffer_surface_state() so we
don't forget.
Francisco Jerez [Tue, 26 Jan 2016 22:45:46 +0000 (14:45 -0800)]
anv/image: clflush the right state map in anv_fill_image_surface_state().
It was clflushing the nonrt_surface_state structure regardless of
which state structure was actually being initialized.
Francisco Jerez [Tue, 26 Jan 2016 20:23:08 +0000 (12:23 -0800)]
anv/image: Upload raw buffer surface state for untyped storage image and texel buffer access.
Francisco Jerez [Tue, 26 Jan 2016 20:20:01 +0000 (12:20 -0800)]
anv/image: Fix image parameter initialization.
Francisco Jerez [Tue, 26 Jan 2016 03:20:57 +0000 (19:20 -0800)]
isl/gen9: Fix slice offset calculation for 1D array images.
The X component of the offset is set to the layer index times layer
height which is obviously bogus, return the vertical offset of the
slice as Y component instead. Fixes a few image load/store tests that
use 1D arrays on SKL when forcing it to fall back to untyped reads and
writes.
Jason Ekstrand [Tue, 19 Jan 2016 01:30:59 +0000 (17:30 -0800)]
i965/fs_surface_builder: Mask signed integers after conversion
Jason Ekstrand [Tue, 5 Jan 2016 21:55:00 +0000 (13:55 -0800)]
anv/image: Actually fill out brw_image_param structs
Jason Ekstrand [Tue, 5 Jan 2016 21:54:02 +0000 (13:54 -0800)]
anv/image_view: Add base mip and base layer fields
These will be needed by image_load_store
Jason Ekstrand [Tue, 26 Jan 2016 20:09:33 +0000 (12:09 -0800)]
gen7: Add support for base vertex/instance
Jason Ekstrand [Tue, 26 Jan 2016 20:08:31 +0000 (12:08 -0800)]
gen8: Add support for base vertex/instance
Jason Ekstrand [Tue, 26 Jan 2016 19:48:23 +0000 (11:48 -0800)]
nir/spirv: Add proper support for InstanceIndex
Jason Ekstrand [Tue, 26 Jan 2016 19:48:07 +0000 (11:48 -0800)]
nir/lower_io: Lower INSTNACE_INDEX
Jason Ekstrand [Tue, 26 Jan 2016 19:47:23 +0000 (11:47 -0800)]
glsl/enums: Add an enum for Vulkan instance index
Jason Ekstrand [Tue, 26 Jan 2016 18:52:56 +0000 (10:52 -0800)]
genX/pipeline: Break emit_vertex_input out into common code
It's mostly the same and contains some non-trivial logic, so it really
should be shared. Also, we're about to make some modifications here that
we would really like to share.
Kristian Høgsberg Kristensen [Tue, 26 Jan 2016 22:53:00 +0000 (14:53 -0800)]
anv: Remove long unused anv_aub.h
Kristian Høgsberg Kristensen [Tue, 26 Jan 2016 22:43:07 +0000 (14:43 -0800)]
anv: Dirty fragment shader descriptors in meta restore
We need to reemit render targets, so dirtying VK_SHADER_STAGE_VERTEX_BIT
doesn't help us much.
Kristian Høgsberg Kristensen [Tue, 26 Jan 2016 22:41:06 +0000 (14:41 -0800)]
anv: Reemit STATE_BASE_ADDRESS after second level cmd buffers
Otherwise the primary batch will continue using the state base addresses
set by the secondary. Fixes remaining renderpass tests.
Chad Versace [Tue, 26 Jan 2016 19:01:24 +0000 (11:01 -0800)]
anv/meta: Fix sample mask in clear pipelines
Once we begin emitting the correct sample mask,
genX_3DSTATE_SAMPLE_MASK_pack will hit an assertion if the mask contains
too many bits.
Jason Ekstrand [Tue, 26 Jan 2016 00:10:12 +0000 (16:10 -0800)]
i965/compiler: Set nir_options.vertex_id_zero_based
Jason Ekstrand [Mon, 25 Jan 2016 23:52:53 +0000 (15:52 -0800)]
HACK/i965: Default to scalar GS on BDW+
Jason Ekstrand [Mon, 25 Jan 2016 23:50:31 +0000 (15:50 -0800)]
Merge remote-tracking branch 'mattst88/nir-lower-pack-unpack' into vulkan
Jason Ekstrand [Mon, 25 Jan 2016 23:33:08 +0000 (15:33 -0800)]
gen7/state: Apply min/mag filters individually for samplers
This fixes tests which apply different min and mag filters, and depend on
the min filter to be correct.
Ben Widawsky [Mon, 25 Jan 2016 23:26:25 +0000 (15:26 -0800)]
gen8/state: Apply min/mag filters individually for samplers
This fixes tests which apply different min and mag filters, and depend on the
min filter to be correct.
Jason Ekstrand [Mon, 25 Jan 2016 23:00:38 +0000 (15:00 -0800)]
i965/fs: Feel free to spill partial reads/writes
Now that we properly handle write-masking, this should be safe.
Jason Ekstrand [Mon, 25 Jan 2016 20:42:01 +0000 (12:42 -0800)]
i965/fs: Properly write-mask spills
For unspills (scratch reads), we can just set WE_all all the time because
we always unspill into a new GRF. For spills, we have two options: If the
instruction has a 32-bit-per-channel destination and "normal" regioning,
then we just do a regular write and it will interleave channels from
different control-flow paths properly. If, on the other hand, the the
regioning is non-normal, then we have to unspill, run the instruction, and
spill afterwards. In this second case, we need to do the spill with
we_ALL.
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 23:14:47 +0000 (15:14 -0800)]
anv: Remove a few finished finishme
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 23:12:43 +0000 (15:12 -0800)]
anv: Remove stale assert
This goes back to when we didn't have the subpass number in the command
buffer begin info.
Matt Turner [Mon, 25 Jan 2016 19:07:28 +0000 (11:07 -0800)]
i965/gen7+: Use NIR for lowering of pack/unpack opcodes.
Matt Turner [Mon, 25 Jan 2016 18:49:15 +0000 (10:49 -0800)]
i965/vec4: Implement nir_op_pack_uvec2_to_uint.
And mark nir_op_pack_uvec4_to_uint unreachable, since it's only produced
by lowering pack[SU]norm4x8 which the vec4 backend does not need.
Matt Turner [Mon, 25 Jan 2016 19:07:02 +0000 (11:07 -0800)]
nir: Add lowering support for unpacking opcodes.
Matt Turner [Mon, 25 Jan 2016 19:05:52 +0000 (11:05 -0800)]
nir: Add lowering support for packing opcodes.
Matt Turner [Thu, 21 Jan 2016 02:56:37 +0000 (18:56 -0800)]
i965/fs: Implement support for extract_word.
The vec4 backend will lower it.
Matt Turner [Thu, 21 Jan 2016 17:09:29 +0000 (09:09 -0800)]
nir: Add opcodes to extract bytes or words.
The uint versions zero extend while the int versions sign extend.
Nanley Chery [Thu, 31 Dec 2015 00:00:47 +0000 (16:00 -0800)]
anv/meta: Fix CopyBuffer when size matches HW limit
Perform a copy when the copy_size matches the HW limit (max_copy_size).
Otherwise the current behavior is that we fail the following assertion:
assert(height < max_surface_dim);
because the values are equal.
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 19:34:32 +0000 (11:34 -0800)]
anv: Don't use uninitialized barycentric_interp_modes
If we don't have a fragment shader, wm_prog_data in undefined.
Kristian Høgsberg Kristensen [Mon, 25 Jan 2016 19:24:19 +0000 (11:24 -0800)]
anv: Disable fs dispatch for depth/stencil only pipelines
Fixes most renderpass bugs.
Matt Turner [Thu, 21 Jan 2016 19:46:22 +0000 (11:46 -0800)]
glsl: Remove 2x16 half-precision pack/unpack opcodes.
i965/fs was the only consumer, and we're now doing the lowering in NIR.
Matt Turner [Thu, 21 Jan 2016 23:30:57 +0000 (15:30 -0800)]
i965/fs: Switch from GLSL IR to NIR for un/packHalf2x16 lowering.
Matt Turner [Thu, 21 Jan 2016 23:46:47 +0000 (15:46 -0800)]
nir: Add lowering of nir_op_unpack_half_2x16.
Matt Turner [Thu, 21 Jan 2016 17:30:05 +0000 (09:30 -0800)]
i965: Make separate nir_options for scalar/vector stages.
We'll want to have different lowering options set for scalar/vector
stages.
Matt Turner [Thu, 21 Jan 2016 17:19:53 +0000 (09:19 -0800)]
i965: Move brw_compiler_create() to new brw_compiler.c.
A future patch will want to use designated initalizers, which aren't
available in C++, but this is C.
Matt Turner [Thu, 21 Jan 2016 17:54:19 +0000 (09:54 -0800)]
nir: Make argument order of unop_convert match binop_convert.
Strangely the return and parameter types were reversed.
Jason Ekstrand [Sat, 23 Jan 2016 06:57:02 +0000 (22:57 -0800)]
anv/cmd_buffer: Zero out binding tables and samplers in state_reset
This fixes a use of an undefined value if the client uses push constants in
a stage without ever setting any descriptors on GEN8-9.
Jason Ekstrand [Sat, 23 Jan 2016 06:04:09 +0000 (22:04 -0800)]
nir/opcodes: Properly flush denormals in fquantize2f16
Jason Ekstrand [Sat, 23 Jan 2016 05:24:53 +0000 (21:24 -0800)]
i965/nir: Properly flush denormals in nir_op_fquantize2f16
Jason Ekstrand [Sat, 23 Jan 2016 03:14:41 +0000 (19:14 -0800)]
anv/format: Add a helpful comment about format names
Jason Ekstrand [Sat, 23 Jan 2016 03:03:27 +0000 (19:03 -0800)]
anv/formats: Add support for 3 more formats
Jason Ekstrand [Sat, 23 Jan 2016 03:02:55 +0000 (19:02 -0800)]
anv/pipeline: Add a default L3$ setup
Chad Versace [Sat, 23 Jan 2016 01:51:24 +0000 (17:51 -0800)]
anv/formats: Rename ambiguous func parameter
vkGetPhysicalDeviceImageFormatProperties has multiple 'flags'
parameters.
Chad Versace [Sat, 23 Jan 2016 01:47:59 +0000 (17:47 -0800)]
anv/formats: Advertise multisample formats
Teach vkGetPhysicalDeviceImageFormatProperties() to advertise
multisampled formats.
Chad Versace [Sat, 23 Jan 2016 01:16:20 +0000 (17:16 -0800)]
anv/image: Drop assertion that samples == 1
Chad Versace [Sat, 23 Jan 2016 01:06:55 +0000 (17:06 -0800)]
isl: Fix gen8_choose_msaa_layout()
Gen8 requires any Y tiling, not any *standard* Y tiling.
Chad Versace [Sat, 23 Jan 2016 01:06:44 +0000 (17:06 -0800)]
isl: Add func isl_tiling_is_any_y()
Chad Versace [Thu, 21 Jan 2016 01:03:29 +0000 (17:03 -0800)]
anv/meta: Assert correct sample counts for blit funcs
Add assertions to:
anv_CmdBlitImage
anv_CmdCopyImage
anv_CmdCopyImageToBuffer
anv_CmdCopyBufferToImage
Chad Versace [Thu, 21 Jan 2016 00:34:23 +0000 (16:34 -0800)]
anv: Add anv_image::samples
It's set but not yet used.
Chad Versace [Thu, 21 Jan 2016 00:04:28 +0000 (16:04 -0800)]
anv: Use isl_device_get_sample_counts()
Use it in vkGetPhysicalDeviceProperties.
Chad Versace [Wed, 20 Jan 2016 23:53:54 +0000 (15:53 -0800)]
isl: Add func isl_device_get_sample_counts()
Nanley Chery [Fri, 22 Jan 2016 23:07:12 +0000 (15:07 -0800)]
gen8/state: Remove SKL special-casing for MinimumArrayElement
MinimumArrayElement carries the same meaning for BDW and SKL.
Suggested by Jason.
No regressions in dEQP-VK.pipeline.image.view_type.cube_array.*
Fixes a number of cube tests, including cube_array_base_slice
and cube_base_slice tests.
Chad Versace [Fri, 22 Jan 2016 22:48:36 +0000 (14:48 -0800)]
anv/state: Dedupe code for lowering surface format
Add helper anv_surface_format().
Francisco Jerez [Fri, 22 Jan 2016 23:57:02 +0000 (15:57 -0800)]
anv/meta: Set sampler type and instruction arrayness consistently in blit shader.
Francisco Jerez [Fri, 22 Jan 2016 23:57:01 +0000 (15:57 -0800)]
anv/meta: Fix meta blit fragment shader for 1D arrays.
Jason Ekstrand [Sat, 23 Jan 2016 00:34:13 +0000 (16:34 -0800)]
genX/state: Set CubeSurfaceControlMode to OVERRIDE
This makes it act like the address mode is set to TEXCOORDMODE_CUBE
whenever this sampler is combined with a cube surface. This *should* be
what we need for Vulkan. Interestingly, the PRM contains a programming
note for this field that says simply, "This field must be set to
CUBECTRLMODE_PROGRAMMED". However, emprical evidence suggests that it does
what the PRM says it does and OVERRIDE is just fine.
Jason Ekstrand [Sat, 23 Jan 2016 00:13:36 +0000 (16:13 -0800)]
gen8/state: Divide depth by 6 for cube maps for GEN8
For Broadwell cube maps, MinimumArrayElement is in terms of 2d slices (a
multiple of 6) but Depth is in terms of whole cubes.
Nanley Chery [Fri, 22 Jan 2016 20:17:25 +0000 (12:17 -0800)]
gen8_state: Enable all cube faces
These fields are ignored for non-cube surfaces. For cube surfaces
these fields should be enabled when using TEXCOORDMODE_CLAMP and
TEXCOORDMODE_CUBE.
TODO: Determine if these are the only two modes used in Vulkan.
Jason Ekstrand [Fri, 22 Jan 2016 19:57:49 +0000 (11:57 -0800)]
isl/format_layout: R11G11B10_FLOAT is unsigned
Jason Ekstrand [Fri, 22 Jan 2016 19:57:01 +0000 (11:57 -0800)]
anv/image: Move common code to anv_image.c
Jason Ekstrand [Fri, 22 Jan 2016 19:40:56 +0000 (11:40 -0800)]
anv/state: Refactor surface state setup into a "fill" function
Francisco Jerez [Fri, 22 Jan 2016 03:21:35 +0000 (19:21 -0800)]
anv/state: Add missing clflushes for storage image surface state.
Francisco Jerez [Fri, 22 Jan 2016 03:21:34 +0000 (19:21 -0800)]
anv/state: Factor out surface state calculation from genX_image_view_init.
Some fields of the surface state template were dependent on the
surface type, which is dependent on the usage of the image view, which
wasn't known until the bottom of the function after the template had
been constructed. This caused failures in all image load/store CTS
tests using cubemaps. Refactor the surface state calculation into a
function that is called once for each required usage.
Jason Ekstrand [Fri, 22 Jan 2016 19:09:24 +0000 (11:09 -0800)]
i965/nir: Temporariliy disable mul+add fusion
We don't want to do this in the long-run but it's needed for passing the
NoContraction tests at the moment. Eventually, we want to plumb this
through NIR properly.
Chad Versace [Fri, 22 Jan 2016 17:48:11 +0000 (09:48 -0800)]
isl: Fix indentation of isl_format_layout comment
Chad Versace [Fri, 22 Jan 2016 17:46:48 +0000 (09:46 -0800)]
isl/tests: Give tests less cryptic names
Chad Versace [Fri, 22 Jan 2016 16:32:00 +0000 (08:32 -0800)]
isl: Fix isl_surf_get_image_offset_sa for gen4_3d layout
Bug found by unit test
test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0.
Chad Versace [Fri, 22 Jan 2016 16:31:29 +0000 (08:31 -0800)]
isl/tests: Add test for bdw 3d surface
test_bdw_3d_r8g8b8a8_unorm_256x256x256_levels09_tiley0
Currently fails.
Chad Versace [Fri, 22 Jan 2016 15:17:34 +0000 (07:17 -0800)]
isl/tests: Remove copy-paste assertion
Chad Versace [Fri, 22 Jan 2016 15:17:06 +0000 (07:17 -0800)]
isl/tests: Fix build
isl_device_init() acquired a new param for bit6 swizzling.
Francisco Jerez [Thu, 21 Jan 2016 22:14:07 +0000 (14:14 -0800)]
anv/batch_chain: Fix patching up of block pool relocations on Gen8+.
Relocations are 64 bits on Gen8+. Most CTS tests that send
non-trivial work to the GPU would fail when run from a single deqp-vk
invocation because they were effectively relying on reloc presumed
offsets to be wrong so the kernel would come and apply relocations
correctly.
Jason Ekstrand [Fri, 22 Jan 2016 00:03:06 +0000 (16:03 -0800)]
nir/spirv: Ignore cull distance
Jason Ekstrand [Fri, 22 Jan 2016 00:00:47 +0000 (16:00 -0800)]
nir/lower_system_values: Use the correct invication id for CS