summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* nir/spirv: Add support for constantsJason Ekstrand2015-05-161-1/+67
|
* nir/spirv: Add basic support for typesJason Ekstrand2015-05-161-4/+85
|
* nir/types: Add more helpers for creating typesJason Ekstrand2015-05-162-0/+59
|
* glsl/types: Expose the function_param and struct_field structs to CJason Ekstrand2015-05-161-4/+4
| | | | | Previously, they were hidden behind a #ifdef __cplusplus so C wouldn't find them. This commit simpliy moves the ifdef.
* glsl/types: Add support for function typesJason Ekstrand2015-05-162-1/+122
|
* glsl: Add GLSL_TYPE_FUNCTION to the base types enumsJason Ekstrand2015-05-1611-0/+13
|
* nir/spirv: Rework the way values are addedJason Ekstrand2015-05-161-13/+7
| | | | | | Instead of having functions to add values and set various things, we just have a function that does a few asserts and then returns the value. The caller is then responsible for setting the various fields.
* nir/spirv: Add stub support for extension instructionsJason Ekstrand2015-05-161-0/+35
|
* REVERT: Add a simple helper program for testing SPIR-V -> NIR translationJason Ekstrand2015-05-162-1/+65
|
* glsl/compiler: Move the error_no_memory stub to standalone_scaffolding.cppJason Ekstrand2015-05-162-6/+6
|
* nir: Add the start of a SPIR-V to NIR translatorJason Ekstrand2015-05-163-0/+493
| | | | | At the moment, it can handle the very basics of strings and can ignore debug instructions. It also has basic support for decorations.
* nir: Import the revision 30 SPIR-V header from KhronosJason Ekstrand2015-05-161-0/+1304
|
* nir: Fix aggressive typos in nir_from_ssa.c.Kenneth Graunke2015-05-081-5/+5
| | | | | | s/agressive/aggressive/g Trivial.
* nir/search: Save/restore the variables_seen bitmask when matchingJason Ekstrand2015-05-081-0/+12
| | | | | | | | | | | | | Shader-db results on Broadwell: total instructions in shared programs: 7152330 -> 7137006 (-0.21%) instructions in affected programs: 1330548 -> 1315224 (-1.15%) helped: 5797 HURT: 76 GAINED: 0 LOST: 8 Reviewed-by: Connor Abbott <[email protected]>
* nir/search: Assert that variable id's are in rangeJason Ekstrand2015-05-081-0/+1
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/search: handle explicitly sized sources in match_valueJason Ekstrand2015-05-081-8/+8
| | | | | | | | | | Previously, this case was being handled in match_expression prior to calling match_value. However, there is really no good reason for this given that match_value has all of the information it needs. Also, they weren't being handled properly in the commutative case and putting it in match_value gives us that for free. Reviewed-by: Connor Abbott <[email protected]>
* nir/nir: Use a linked list instead of a hash set for use/def setsJason Ekstrand2015-05-0814-306/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit switches us from the current setup of using hash sets for use/def sets to using linked lists. Doing so should save us quite a bit of memory because we aren't carrying around 3 hash sets per register and 2 per SSA value. It should also save us CPU time because adding/removing things from use/def sets is 4 pointer manipulations instead of a hash lookup. Running shader-db 50 times with USE_NIR=0, NIR, and NIR + use/def lists: GLSL IR Only: 586.4 +/- 1.653833 NIR with hash sets: 675.4 +/- 2.502108 NIR + use/def lists: 641.2 +/- 1.557043 I also ran a memory usage experiment with Ken's patch to delete GLSL IR and keep NIR. This patch cuts an aditional 42.9 MiB of ralloc'd memory over and above what we gained by deleting the GLSL IR on the same dota trace. On the code complexity side of things, some things are now much easier and others are a bit harder. One of the operations we perform constantly in optimization passes is to replace one source with another. Due to the fact that an instruction can use the same SSA value multiple times, we had to iterate through the sources of the instruction and determine if the use we were replacing was the only one before removing it from the set of uses. With this patch, uses are per-source not per-instruction so we can just remove it safely. On the other hand, trying to iterate over all of the instructions that use a given value is more difficult. Fortunately, the two places we do that are the ffma peephole where it doesn't matter and GCM where we already gracefully handle duplicates visits to an instruction. Another aspect here is that using linked lists in this way can be tricky to get right. With sets, things were quite forgiving and the worst that happened if you didn't properly remove a use was that it would get caught in the validator. With linked lists, it can lead to linked list corruption which can be harder to track. However, we do just as much validation of the linked lists as we did of the sets so the validator should still catch these problems. While working on this series, the vast majority of the bugs I had to fix were caught by assertions. I don't think the lists are going to be that much worse than the sets. Reviewed-by: Connor Abbott <[email protected]>
* util/list: Add a list validation functionJason Ekstrand2015-05-081-0/+9
| | | | | Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util/list: Add list_empty and list_length functionsJason Ekstrand2015-05-081-0/+15
| | | | | | | v2: Don't use C99 when iterating over the list Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util/list: Add C99-based iterator macrosJason Ekstrand2015-05-081-0/+34
| | | | | | | v2: Use LIST_ENTRY instead of container_of in iterators Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* util: Move gallium's linked list to utilJason Ekstrand2015-05-0844-55/+50
| | | | | | | | | The linked list in gallium is pretty much the kernel list and we would like to have a C-based linked list for all of mesa. Let's not duplicate and just steal the gallium one. Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* gallium/double_list: s/INLINE/inline and remove the p_compiler includeJason Ekstrand2015-05-081-7/+6
| | | | | Acked-by: Connor Abbott <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* nir: Use nir_instr_rewrite_src in copy propagationJason Ekstrand2015-05-081-61/+10
| | | | | | | We were rolling our own rewrite_src variant in copy-propagation. Let's stop doing that and use the ones in core NIR. Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a function for rewriting the condition of an if statementJason Ekstrand2015-05-082-0/+23
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Add and use initializer #defines for nir_src and nir_destJason Ekstrand2015-05-086-18/+15
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Modernize the out-of-SSA passJason Ekstrand2015-05-081-103/+36
| | | | | | | | | The out-of-SSA pass was one of the first passes written when getting SSA up-and-going (for obvious reasons). As such, it came before a lot of the nifty SSA-based helpers were introduced. This commit modernizes it so that we're no longer doing nearly as much manual banging on use/def sets. Reviewed-by: Connor Abbott <[email protected]>
* nir/validate: Validate SSA def parent instructionsJason Ekstrand2015-05-081-0/+2
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nv50/ir: only propagate saturate up if some actual folding took placeIlia Mirkin2015-05-081-1/+2
| | | | | | | | | | The former logic would copy the saturate up to any mul with an immediate if there was a subsequent mul with a saturate. However we only want to do that if we collapsed 2 muls by multiplying their immediates (or were able to put the immediate in as a post-multiplier). Signed-off-by: Ilia Mirkin <[email protected]> Cc: [email protected]
* nir: Delete all traces of nir_op_flogIan Romanick2015-05-083-10/+0
| | | | | | | | Nothing produces it, and nothing can consume it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* nir: Don't produce nir_op_flog from GLSL IRIan Romanick2015-05-081-1/+1
| | | | | | | | | All paths that produce GLSL IR for NIR lower ir_unop_log. All paths that consume NIR will explode if they geta nir_op_flog. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* nir: Delete all traces of nir_op_fexpIan Romanick2015-05-083-9/+0
| | | | | | | | Nothing produces it, and nothing can consume it. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* nir: Don't produce nir_op_fexp from GLSL IRIan Romanick2015-05-081-1/+1
| | | | | | | | | All paths that produce GLSL IR for NIR lower ir_unop_exp. All paths that consume NIR will explode if they geta nir_op_fexp. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* prog_to_nir: OPCODE_EXP is not nir_op_fexpIan Romanick2015-05-081-1/+1
| | | | | | | | | It's a weird thing that provides some values related to 2**x. It's also already handled by a case in the switch. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* i965/fs: Improve a comment about stripping trailing zeroesNeil Roberts2015-05-081-3/+6
| | | | | | Originally I wrote that removing the first parameter doesn't work but I didn't know why. I now found a mention of this in the PRM so it's probably worthing adding it to the comment.
* mesa: Implement GetVertexArrayIndexed[64]ivFredrik Höglund2015-05-084-0/+143
| | | | | | v2: Fix the name of the entry point in the error messages. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Add support for querying GL_VERTEX_ATTRIB_ARRAY_LONGFredrik Höglund2015-05-081-0/+5
| | | | | | This parameter was added in OpenGL 4.3 and GL_ARB_direct_state_access. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Add a vao parameter to get_vertex_array_attribFredrik Höglund2015-05-081-9/+16
| | | | | | | | | This is needed to implement glGetVertexArrayIndexediv and glGetVertexArrayIndexed64iv. v2: Make the vao parameter const. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement GetVertexArrayivFredrik Höglund2015-05-084-0/+43
| | | | Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement VertexArrayBindingDivisorFredrik Höglund2015-05-084-16/+58
| | | | Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Add a vao parameter to vertex_binding_divisorFredrik Höglund2015-05-081-4/+6
| | | | | | This is needed to implement VertexArrayBindingDivisor. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement VertexArrayAttribBindingFredrik Höglund2015-05-084-22/+66
| | | | Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Add a vao parameter to vertex_attrib_bindingFredrik Höglund2015-05-081-6/+9
| | | | | | This is needed to implement VertexArrayAttribBinding. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement VertexArrayAttrib[I|L]FormatFredrik Höglund2015-05-084-0/+122
| | | | Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Add a vao parameter to update_array_formatFredrik Höglund2015-05-081-7/+10
| | | | | | This is needed to implement VertexArrayAttrib*Format. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Refactor VertexAttrib[I|L]FormatFredrik Höglund2015-05-081-100/+49
| | | | | | | | The only difference between these functions is the legal types and sizes, so consolidate the code into a single vertex_attrib_format() function and call it from all three entry points. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement VertexArrayVertexBuffersFredrik Höglund2015-05-084-27/+78
| | | | Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement VertexArrayVertexBufferFredrik Höglund2015-05-084-25/+71
| | | | Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Add a vao parameter to bind_vertex_bufferFredrik Höglund2015-05-081-8/+10
| | | | | | | This is needed to implement VertexArrayVertexBuffer and VertexArrayVertexBuffers. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement VertexArrayElementBufferFredrik Höglund2015-05-084-0/+49
| | | | | | v2: Add a doxygen comment. Reviewed-by: Laura Ekstrand <[email protected]>
* mesa: Implement EnableVertexArrayAttribFredrik Höglund2015-05-084-9/+47
| | | | Reviewed-by: Laura Ekstrand <[email protected]>