summaryrefslogtreecommitdiffstats
path: root/src/glsl/nir/nir_print.c
Commit message (Collapse)AuthorAgeFilesLines
* nir: Expose nir_print_instr() for debug printsEric Anholt2015-01-231-2/+7
| | | | | | | | | It's nice to have this present in your default cases so you can see what instruction is triggering an abort. v2: Just pass a NULL state, now that it won't crash when you do. Reviewed-by: Jason Ekstrand <[email protected]>
* nir: When asked to print with a NULL state, just use bare variable names.Eric Anholt2015-01-231-6/+16
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* nir: Add a nir_foreach_phi_src helper macroJason Ekstrand2015-01-201-1/+1
| | | | Reviewed-by: Connor Abbott <cwabbott02gmail.com>
* util/hash_set: Rework the API to know about hashingJason Ekstrand2015-01-151-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the set API required the user to do all of the hashing of keys as it passed them in. Since the hashing function is intrinsically tied to the comparison function, it makes sense for the hash set to know about it. Also, it makes for a somewhat clumsy API as the user is constantly calling hashing functions many of which have long names. This is especially bad when the standard call looks something like _mesa_set_add(ht, _mesa_pointer_hash(key), key); In the above case, there is no reason why the hash set shouldn't do the hashing for you. We leave the option for you to do your own hashing if it's more efficient, but it's no longer needed. Also, if you do do your own hashing, the hash set will assert that your hash matches what it expects out of the hashing function. This should make it harder to mess up your hashing. This is analygous to 94303a0750 where we did this for hash_table Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir/tex_instr: Add a nir_tex_src struct and dynamically allocate the src arrayJason Ekstrand2015-01-151-2/+2
| | | | | | | | This solves a number of problems. First is the ability to change the number of sources that a texture instruction has. Second, it solves the delema that may occur if a texture instruction has more than 4 sources. Reviewed-by: Connor Abbott <[email protected]>
* nir/print: Various cleanups recommended by EricJason Ekstrand2015-01-151-33/+12
| | | | | Cc: Eric Anholt <[email protected]> Reviewed-by: Connor Abbott <[email protected]>
* nir: Rename parallel_copy_copy to parallel_copy_entry and add a foreach macroJason Ekstrand2015-01-151-3/+3
| | | | | | | | | | parallel_copy_copy was a silly name. Also, things were getting long and annoying, so I added a foreach macro. For historical reasons, several of the original iterations over parallel copy entries in from_ssa used the _safe variants of the loop. However, all of these no longer ever remove an entry so it's ok to make them all use the normal iterator. Reviewed-by: Connor Abbott <[email protected]>
* nir: Make load_const SSA-onlyJason Ekstrand2015-01-151-26/+6
| | | | | | | | As it was, we weren't ever using load_const in a non-SSA way. This allows us to substantially simplify the load_const instruction. If we ever need a non-SSA constant load, we can do a load_const and an imov. Reviewed-by: Connor Abbott <[email protected]>
* nir: Remove predicationJason Ekstrand2015-01-151-30/+0
| | | | | | | | We stopped generating predicates in glsl_to_nir some time ago. Right now, it's all dead untested code that I'm not convinced always worked in the first place. If we decide we want them back, we can revert this patch. Reviewed-by: Connor Abbott <[email protected]>
* nir/tex_instr: Rename the indirect source type and add an array sizeJason Ekstrand2015-01-151-2/+2
| | | | | | | | | In particular, we rename nir_tex_src_sampler_index to _sampler_offset and add a sampler_array_size field to nir_tex_instr. This way we can pass the size of sampler arrays through to backends even after removing the variable information and, with it, the type. Reviewed-by: Connor Abbott <[email protected]>
* nir: Make texture instruction names more consistentJason Ekstrand2015-01-151-2/+2
| | | | | | | | This commit renames nir_instr_as_texture to nir_instr_as_tex and renames nir_instr_type_texture to nir_instr_type_tex to be consistent with nir_tex_instr. Reviewed-by: Connor Abbott <[email protected]>
* nir: Use an integer index for specifying structure fieldsJason Ekstrand2015-01-151-13/+22
| | | | | | | Previously, we used a string name. It was nice for translating out of GLSL IR (which also does that) but cumbersome the rest of the time. Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a concept of a wildcard array dereferenceJason Ekstrand2015-01-151-0/+3
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: Make array deref direct vs. indirect an enumJason Ekstrand2015-01-151-3/+6
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir/print: Don't reindex thingsJason Ekstrand2015-01-151-4/+0
| | | | | | | These indices should now be reasonably stable/consistent. Redoing the indices in the print functions makes it harder to debug problems. Reviewed-by: Connor Abbott <[email protected]>
* nir: Add a parallel copy instruction typeJason Ekstrand2015-01-151-0/+21
| | | | Reviewed-by: Connor Abbott <[email protected]>
* nir: add a printerConnor Abbott2015-01-151-0/+912
This is similar to ir_print_visitor.cpp. v2: Jason Ekstrand <[email protected]>: whitespace fixes