Commit Graph

76902 Commits

Author SHA1 Message Date
Chad Versace 373fd89e4b isl: Document the 3D block extent of isl_format 2015-12-31 11:55:48 -08:00
Jason Ekstrand 1ddcbbf05f nir/spirv: Add a missing break statement in handle_image 2015-12-30 21:57:04 -08:00
Jason Ekstrand 4f9a211b4a Revert "isl: Fix assertion failure for npot pixel formats"
This reverts commit 96d1baa88d.
2015-12-30 21:01:55 -08:00
Jason Ekstrand 0bb103d010 nir/spirv: Handle push constants after decorations 2015-12-30 20:54:27 -08:00
Jason Ekstrand 3421ba1843 anv/device: Place memory types at heapIndex == 0
Previously, they were at heapIndex == 1 even though we only advertised one
heap.
2015-12-30 19:32:43 -08:00
Jason Ekstrand cf6ce424e0 nir/spirv: Fix constant num_elements and allocation
Thanks to the addition of nir_clone, we now have a num_elements field in
nir_constant which we weren't setting.  Also, constants have to be parented
to the variable they initialize, so we have to make a copy.
2015-12-30 18:51:59 -08:00
Jason Ekstrand 601b7d5f98 nir/lower_outputs_to_temporaries: Reparent constant initializers 2015-12-30 18:51:06 -08:00
Jason Ekstrand 7d57528233 nir/clone: Expose nir_constant_clone 2015-12-30 18:44:19 -08:00
Jason Ekstrand fed98df428 nir/gather_info: Add support for end_primitive_with_counter 2015-12-30 17:45:43 -08:00
Jason Ekstrand 5afac62b28 nir/spirv: Handle OpLine 2015-12-30 17:45:43 -08:00
Jason Ekstrand 149f35bbba nir/spirv: Let OpEntryPoint act as an OpName 2015-12-30 17:45:43 -08:00
Jason Ekstrand 5f7f88524c nir/lower_outputs_to_temporaries: Take a nir_function entrypoint 2015-12-30 17:45:43 -08:00
Jason Ekstrand 0fe4580e64 nir/spirv: Add support for multiple entrypoints per shader
This is done by passing the entrypoint name into spirv_to_nir.  It will
then process the shader as if that were the only entrypoint we care about.
Instead of returning a nir_shader, it now returns a nir_function.
2015-12-30 17:45:43 -08:00
Jason Ekstrand e993e45eb1 nir/spirv: Get the shader stage from the SPIR-V
Previously, we depended on it being passed in.
2015-12-30 17:45:43 -08:00
Jason Ekstrand db3a64fcea nir/spirv: Use shader stage for determining variable locations 2015-12-30 17:45:43 -08:00
Jason Ekstrand d7ae2200f9 nir/spirv: Get rid of default GS info
shaderc has been fixed for a while now.
2015-12-30 17:45:43 -08:00
Jason Ekstrand d9c9a117dc nir/spirv: Handle execution modes as decorations
They're basically the same thing.
2015-12-30 17:45:43 -08:00
Jason Ekstrand 2b6bcaf91a nir/spirv: Separate handling of preamble from type/var/const instructions 2015-12-30 17:45:43 -08:00
Chad Versace 96d1baa88d isl: Fix assertion failure for npot pixel formats
When aligning to isl_format_layout::bs (which is the number of bytes in
the pixel), use isl_align_npot() instead of isl_align(), because
isl_align() works only for power-of-2 alignment.

Fixes assertion in
dEQP-VK.pipeline.image.view_type.1d.format.r16g16b16_sfloat.size.512x1.
2015-12-30 16:28:19 -08:00
Jason Ekstrand 07b4f17aaf nir/spirv/GLSL450: Add support for SAbs 2015-12-30 14:41:49 -08:00
Kenneth Graunke e6cd0c0e1c nir/spirv: Implement IsInf and IsNan built-ins. 2015-12-30 14:10:44 -08:00
Jason Ekstrand a7e827192b isl: Tile-align height in image size calculation
This fixes a bunch of gpu hangs on the dEQP-VK.glsl.ShaderExecutor.common
group of CTS tests.
2015-12-30 14:03:47 -08:00
Kenneth Graunke 9f23116bfa Revert "nir/spirv: Update to the 1.0 GLSL.std.450 header"
This reverts commit b33f5d3889,
and also removes the (empty) case statements for the new built-ins.

It doesn't look like glslang has updated yet, so updating the header
just breaks everything, as we no longer agree on opcode numbers.
2015-12-30 13:26:56 -08:00
Jason Ekstrand e6fc170afb anv/allocator: Rework state streams again
If we're going to hav valgrind verify state streams then we need to ensure
that once we choose a pointer into a block we always use that pointer until
the block is freed.  I was trying to do this with the "current_map" thing.
However, that breaks down because you have to use the map from the block
pool to get to the stream_block to get at current_map.  Instead, this
commit changes things to track the stream_block by pointer instead of by
offset into the block pool.
2015-12-30 11:40:38 -08:00
Jason Ekstrand 28243b2fba gen7/8/cmd_buffer: Allocate the correct ammount for COLOR_CALC_STATE
We were allocating 6 bytes when we should have been allocating 6 dwords.
2015-12-30 10:37:57 -08:00
Jason Ekstrand a0b2829f20 anv/stream_alloc: Properly manage valgrind NOACCESS and UNDEFINED status
When I first did the valgrindifying for stream allocators, I misunderstood
some things about valgrind's expectations for NOACCESS and UNDEFINED.
First off, valgrind expects things to be marked NOACCESS before you
allocate out of them.  Since our blocks came from a pool backed by a
mmapped memfd, they came in as UNDEFINED; we needed to mark them as
NOACCESS.  Also, I didn't realize that VALGRIND_MEMPOOL_CHANGE only updated
the mempool allocation state and didn't actually change definedness; we had
to add a VALGRIND_MAKE_MEM_UNDEFINED to get rid of the NOACCESS on the
newly allocated portion.
2015-12-30 10:36:19 -08:00
Kristian Høgsberg Kristensen 91d93f7908 nir/spirv: Lower gl_GlobalInvocationID correctly
Use nir_intrinsic_load_local_invocation_id, not
nir_intrinsic_load_invocation_id (missing 'local'), which is a geometry
shader built-in.
2015-12-30 00:03:54 -08:00
Jason Ekstrand 451fe2670c nir/spirv/cfg: Handle discard 2015-12-29 19:23:25 -08:00
Jason Ekstrand 5693637faa nir/print: Handle variables with var->name == NULL 2015-12-29 16:58:00 -08:00
Jason Ekstrand 8cc55780fd nir/inline_functions: Switch to inlining everything 2015-12-29 16:58:00 -08:00
Kenneth Graunke 7cdcee3bed nir/spirv/glsl450: Enumerate more built-in opcodes. 2015-12-29 16:06:35 -08:00
Kenneth Graunke ccd84848f0 anv/state: Fix reversed MIN vs. MAX in levelCount handling.
The point is to promote a levelCount of 0 to 1 before subtracting 1.
This needs MAX, not MIN.
2015-12-29 15:51:14 -08:00
Jason Ekstrand 2a58cb03d0 nir/spirv: Use instr_rewrite_src for updating phi sources
You can't just add a new source to a phi because use/def information won't
get updated properly.  Instead, you have to use one of the core helpers.
Some day, we may want to add a nir_phi_instr_add_src helper.
2015-12-29 15:44:39 -08:00
Jason Ekstrand 69d5838aee nir/validate: Don't validate the return deref for void function calls 2015-12-29 15:35:29 -08:00
Jason Ekstrand 51b04d03d5 nir/dominance: Handle unreachable blocks
Previously, nir_dominance.c didn't properly handle unreachable blocks.
This can happen if, for instance, you have something like this:

loop {
   if (...) {
      break;
   } else {
      break;
   }
}

In this case, the block right after the if statement will be unreachable.
This commit makes two changes to handle this.  First, it removes an assert
and allows block->imm_dom to be null if the block is unreachable.  Second,
it properly skips unreachable blocks in calc_dom_frontier_cb.
2015-12-29 15:29:27 -08:00
Kenneth Graunke b4a1c9b506 nir/spirv/glsl450: Implement inverse hyperbolic trig built-ins. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 2ea111664c nir/spirv/glsl450: Implement Refract built-in. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 74529a2c50 nir/spirv/glsl450: Implement hyperbolic trig built-ins. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 0b1a436ac8 nir/spirv/glsl450: implement Reflect built-in. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 659a3623b0 nir/spirv/glsl450: Implement FaceForward built-in. 2015-12-29 15:27:03 -08:00
Kenneth Graunke b10af36d93 nir/spirv/glsl450: Implement SmoothStep. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 6a0fa2d758 nir/spirv/glsl450: Implement Cross built-in. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 083fd6ec2a nir/spirv/glsl450: Implement Clamp/SClamp/UClamp. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 034010924e nir/spirv/glsl450: Implement the Log built-in. 2015-12-29 15:27:03 -08:00
Kenneth Graunke ffc5ae7c9e nir/spirv/glsl450: Implement Exp built-in. 2015-12-29 15:27:03 -08:00
Kenneth Graunke 227e250005 nir/spirv/glsl450: Add a helper for doing fclamp(). 2015-12-29 15:27:03 -08:00
Kenneth Graunke 0f801752f2 nir/spirv/glsl450: Add helpers for calculating exp() and log(). 2015-12-29 15:27:03 -08:00
Kenneth Graunke 9c9edd1ce8 nir/spirv/glsl450: Add an 'nb' shortcut variable.
"nb" is shorter and more convenient than "&b->nb", especially
when several operations are composed together into a larger expression
tree.
2015-12-29 15:27:03 -08:00
Jason Ekstrand 5f04a61219 nir/lower_returns: Don't just change the type of a jump.
It doesn't give core NIR the opportunity to update predecessors and
successors.  Instead, we have to remove and re-insert the instruction.
2015-12-29 14:51:47 -08:00
Jason Ekstrand 6fa47c9c17 nir/builder: Add a nir_jump helper 2015-12-29 14:48:34 -08:00