Commit graph

70521 commits

Author SHA1 Message Date
Chad Versace
5ce5a7d021 anv/image: Stop including gen8_pack.h in common file 2016-01-20 15:42:17 -08:00
Chad Versace
8ab527de03 isl: Add a README
Most of the file-level comment in isl.h is moved to the README.
2016-01-20 15:24:40 -08:00
Kristian Høgsberg Kristensen
7b7a7c2bfc vk: Make maxSamplerAllocationCount more reasonable
We can't allocate 4 billion samplers. Let's go with 64k.
2016-01-20 14:36:52 -08:00
Kristian Høgsberg Kristensen
8ef002dd7a vk/tests: Add stub for anv_gem_get_bit6_swizzle() 2016-01-20 13:47:40 -08:00
Kristian Høgsberg Kristensen
420e8664cb vk/tests: Add isl include path 2016-01-20 13:47:40 -08:00
Kenneth Graunke
b76e4458f9 nir/spirv/glsl450: Use fabs not iabs in ldexp.
This was just wrong.
2016-01-20 12:18:02 -08:00
Kristian Høgsberg Kristensen
947ebd9c71 isl: Add ish.h to libsil_la_SOURCES 2016-01-20 12:03:46 -08:00
Jason Ekstrand
21b2d87408 nir/spirv/glsl450: Implement FrexpStruct 2016-01-20 11:36:41 -08:00
Jason Ekstrand
c7896d1868 spirv/nir/glsl450: Use vtn_create_ssa_value to create SSA values 2016-01-20 11:36:26 -08:00
Jason Ekstrand
e45748bade anv/device: Default to scalar GS on BDW+ 2016-01-20 11:16:44 -08:00
Jason Ekstrand
34f9a5f301 nir/spirv: Pull texture dimensionality out of the image when available 2016-01-20 11:11:30 -08:00
Jason Ekstrand
59ef7c6507 anv/meta: fix UpdateBuffer in the case where we do multiple updates 2016-01-20 07:56:48 -08:00
Jason Ekstrand
a0516cfbac anv/meta: Fix a finishme 2016-01-20 07:33:41 -08:00
Jason Ekstrand
c7203aa621 nir/spirv: Move OpPhi handling to vtn_cfg.c
Phi handling is somewhat intrinsically tied to the CFG.  Moving it here
makes it a bit easier to handle that.  In particular, we can now do SSA
repair after we've done the phi node second-pass.  This fixes 6 CTS tests.
2016-01-19 19:00:00 -08:00
Jason Ekstrand
891564adb9 nir/spirv: Handle OpLine and OpNoLine in foreach_instruction
This way we don't have to explicitly handle them everywhere.
2016-01-19 19:00:00 -08:00
Kenneth Graunke
e79f8a4926 nir: Lower ldexp to arithmetic.
This is a port of Matt's GLSL IR lowering pass to NIR.  It's required
because we translate SPIR-V directly to NIR, bypassing GLSL IR.

I haven't introduced a lower_ldexp flag, as I believe all current NIR
consumers would set the flag.  i965 wants this, vc4 doesn't implement
this feature, and st_glsl_to_tgsi currently lowers ldexp
unconditionally anyway.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2016-01-19 18:10:30 -08:00
Kenneth Graunke
b3cc10f3b2 nir: Let nir_opt_algebraic rules contain unsigned constants > INT_MAX.
struct.pack('i', val) interprets `val` as a signed integer, and dies
if `val` > INT_MAX.  For larger constants, we need to use 'I' which
interprets it as an unsigned value.

This patch makes us use 'I' for all values >= 0, and 'i' for negative
values.  This should work in all cases.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
2016-01-19 18:10:30 -08:00
Jason Ekstrand
eb2a119da2 anv/meta: Implement UpdateBuffer 2016-01-19 16:53:35 -08:00
Jason Ekstrand
0ae1bd321e anv/meta: Implement CmdFillBuffer 2016-01-19 16:53:35 -08:00
Jason Ekstrand
46eef31311 anv/meta_clear: Call emit_clear directly in ClearImage
Using the load op means that we end up with recursive meta.  We shouldn't
be doing that.
2016-01-19 16:53:35 -08:00
Jason Ekstrand
6325a75011 anv/meta_clear: Do save/restore in actual entry points 2016-01-19 16:53:35 -08:00
Jason Ekstrand
56dbf13045 anv: Add support for VK_WHOLE_SIZE several places 2016-01-19 16:53:35 -08:00
Kenneth Graunke
549be68258 nir/spirv/glsl450: Implement Frexp. 2016-01-19 16:46:03 -08:00
Kenneth Graunke
68c9ca1a94 nir/spirv/glsl450: Blindly implement Atan2.
This is untested and probably broken.

We already passed the atan2 CTS tests before implementing this opcode.
Presumably, glslang or something was giving us a plain Atan opcode
instead of Atan2.  I don't know why.
2016-01-19 16:14:05 -08:00
Kenneth Graunke
2ab3efa0ad nir/spirv/glsl450: Implement Atan. 2016-01-19 16:14:05 -08:00
Kenneth Graunke
bc9d9bc2e3 nir/spirv/glsl450: Implement Asin and Acos. 2016-01-19 16:14:05 -08:00
Jason Ekstrand
5e57a87dcf anv/pipeline: Fix point size 2016-01-19 12:03:13 -08:00
Jason Ekstrand
3276610ea6 getX/state: Set LOD pre-clamp to OpenGL mode
This gets us another couple hundred sampler tests
2016-01-18 17:51:35 -08:00
Jason Ekstrand
580b2e85e4 isl/device: Add a flag for bit 6 swizzling 2016-01-18 17:21:05 -08:00
Jason Ekstrand
587842a0ca anv/gem: Add a helper for getting bit6 swizzling information 2016-01-18 17:21:05 -08:00
Jason Ekstrand
c2a6f4302e nir/spirv: Patch through image qualifiers 2016-01-18 17:21:05 -08:00
Jason Ekstrand
56c8a5f2b8 nir/spirv: Implement ImageQuerySize for storage iamges
SPIR-V only has one ImageQuerySize opcode that has to work for both
textures and storage images.  Therefore, we have to special-case that one a
bit and look at the type of the incoming image handle.
2016-01-18 17:21:05 -08:00
Jason Ekstrand
bb8cadd169 nir/spirv: Insert movs around image intrinsics
Image intrinsics always take a vec4 coordinate and always return a vec4.
This simplifies the intrinsics a but but also means that they don't
actually match the incomming SPIR-V.  In order to compensate for this, we
add swizzling movs for both source and destination to get the right number
of components.
2016-01-18 17:21:05 -08:00
Jason Ekstrand
6f956b0b22 anv/meta: Improve meta clear cleanup a bit 2016-01-18 14:07:46 -08:00
Jason Ekstrand
45d17fcf9b anv: Misc allocation scope fixes 2016-01-18 14:04:13 -08:00
Jason Ekstrand
378af64e30 anv/meta: Add a meta allocator that uses SCOPE_DEVICE
The Vulkan spec requires all allocations that happen for device creation to
happen with SCOPE_DEVICE.  Since meta calls into other things that allocate
memory, the easiest way to do this is with an allocator.
2016-01-18 14:03:24 -08:00
Jason Ekstrand
3dfa6a881c anv/meta: Initialize a handle to null 2016-01-18 13:05:02 -08:00
Jason Ekstrand
d49298c702 gen8: Fix border color
The border color packet is specified as a 64-byte aligned address relative
to dynamic state base address.  The way the packing functions are currently
set up, we need to provide it with (offset >> 6) because it just shoves the
bits in where the PRM says they go and isn't really aware that it's an
address.
2016-01-18 12:16:31 -08:00
Jason Ekstrand
bfcc744892 genX/pack: Add a __gen_fixed helper and use it for TextureLODBias
The __gen_fixed helper properly clamps the value and also handles negative
values correctly.  Eventually, we need to make the scripts generate this
and use it for more things.
2016-01-18 11:35:04 -08:00
Jason Ekstrand
5a67df2546 anv/pack: Make TextureLODBias a proper 4.8 float
XXX: We need to update the generators so this doesn't get stompped.
2016-01-18 10:36:53 -08:00
Jason Ekstrand
15e6af0708 nir/spirv: Handle if's where the merge is also a break or continue 2016-01-18 10:10:47 -08:00
Jason Ekstrand
14ebd0fdd7 nir/spirv: Hanle continues that use SSA values from the loop body
Instead of emitting the continue before the loop body we emit it
afterwards.  Then, once we've finished with the entire function, we run
nir_repair_ssa to add whatever phi nodes are needed.
2016-01-18 09:43:12 -08:00
Jason Ekstrand
61ba97522e nir/lower_returns: Repair SSA after doing return lowering 2016-01-18 09:43:12 -08:00
Jason Ekstrand
b11825590d nir: Add a pass to repair SSA form 2016-01-18 09:43:12 -08:00
Jason Ekstrand
a7a5e8a2de nir/vars_to_ssa: Use the new nir_phi_builder helper
The efficiency should be approximately the same.  We do a little more work
per phi node because we have to sort the predecessors.  However, we no
longer have to walk the blocks a second time to pop things off the stack.
The bigger advantage, however, is that we can now re-use the phi placement
and per-block SSA value tracking in other passes.
2016-01-18 09:18:42 -08:00
Jason Ekstrand
8aab4a7bd2 nir: Add a phi node placement helper
Right now, we have phi placement code in two places and there are other
places where it would be nice to be able to do this analysis.  Instead of
repeating it all over the place, this commit adds a helper for placing all
of the needed phi nodes for a value.
2016-01-18 09:18:42 -08:00
Jason Ekstrand
b1f1200e80 util/bitset: Allow iterating over const bitsets 2016-01-18 09:18:42 -08:00
Jason Ekstrand
f509a89082 nir/lower_system_values: Lower vertexID to id+base if needed 2016-01-15 16:15:50 -08:00
Jason Ekstrand
6b64dddd71 anv/batch_chain: Remove padding from the BO before emitting BUFFER_END 2016-01-15 15:59:58 -08:00
Jason Ekstrand
67bf74f020 anv/batch_chain: Don't call current_batch_bo() again
We call it once at the top of the function and then hold on to the pointer.
It shouldn't have changed, so there's no reason to query for it again.
2016-01-15 15:49:32 -08:00