summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Generate code for constant ir_quadop_bitfield_insert expressionsIan Romanick2016-08-301-4/+21
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_triop_vector_insert expressionsIan Romanick2016-08-301-2/+25
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_vector_extract expressionsIan Romanick2016-08-301-1/+21
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_mul expressionsIan Romanick2016-08-301-2/+54
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_triop_fma and ir_triop_bitfield_extract ↵Ian Romanick2016-08-301-5/+13
| | | | | | | | | | | | expressions ir_triop_bitfield_extract is a little weird because the second and third operand and aways int, so they may differ in type from the first operand. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_dot expressionsIan Romanick2016-08-301-1/+18
| | | | | | | | v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_lshift and ir_binop_rshift expressionsIan Romanick2016-08-301-2/+13
| | | | | | | | | | | | | | | | The code generated is quite different from what was previously used. I believe that it is still correct by the GLSL spec, and I believe, due to C rules about shifts, the behavior will be the same. Section 5.9 (Expressions) of the GLSL 4.50 spec says: The result is undefined if the right operand is negative, or greater than or equal to the number of bits in the left expression's base type. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant ir_binop_ldexp expressionsIan Romanick2016-08-301-4/+19
| | | | | | | | | | | | ldexp is weird because its two operands have different types. Add support for directly specifying the exact signatures of all the possible variations of an operation. v2: Use tuple() instead of () for clarity. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant unary expressions that don't assign the ↵Ian Romanick2016-08-301-8/+18
| | | | | | | | | | | | | | destination These are operations like the pack functions that have separate functions that assign multiple outputs from a single input. v2: Correct the source and destination types. They were previously transposed. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for some constant binary expression that are horizontalIan Romanick2016-08-301-3/+7
| | | | | | | | | | Only operations where the implementation is identical code regardless of type. The only such operations are ir_binop_all_equal and ir_binop_any_nequal. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant unary expression that are horizontalIan Romanick2016-08-301-6/+16
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant expressions that have an output type the ↵Ian Romanick2016-08-301-11/+33
| | | | | | | | | | | differs from the input types v2: Remove extra int() cast in find_lsb. Suggested by Matt. 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant binary expressions that combine vector and ↵Ian Romanick2016-08-301-15/+51
| | | | | | | | | | scalar operands v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant binary expressions that have one operand typeIan Romanick2016-08-301-6/+10
| | | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant unary expression that have different ↵Ian Romanick2016-08-301-12/+33
| | | | | | | | | | implementations for each source type v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate code for constant unary expression that map one type to anotherIan Romanick2016-08-301-24/+57
| | | | | | | | | ir_unop_i2b is omitted because its source can either be int or uint. That makes it special. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Begin generating code for the most basic constant expressionsIan Romanick2016-08-301-17/+158
| | | | | | | | | | | Unary operations where all of the supported types use the same C expression to evaluate them. v2: 'for (a, b) in d' => 'for a, b in d'. Suggested by Dylan. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Convert tuple into a classIan Romanick2016-08-301-127/+138
| | | | | | | | | This makes things a little more clear now, and it will make future changes... possible. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Compact a bunch of things onto one lineIan Romanick2016-08-301-66/+20
| | | | | | | Even though they are much too long for that. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Sort constant expression handling by IR operand enum valueIan Romanick2016-08-301-318/+319
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Trivial whitespace and punctuation changesIan Romanick2016-08-301-66/+76
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Sort GLSL type enums in switch-statements in enum orderIan Romanick2016-08-301-28/+28
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Always use correct float types in constant expression handlingIan Romanick2016-08-301-5/+5
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Extract ir_quadop_bitfield_insert implementation to a separate functionIan Romanick2016-08-301-25/+23
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Extract ir_triop_bitfield_extract implementation to a separate functionIan Romanick2016-08-301-24/+42
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Extract ir_binop_ldexp implementation to a separate functionIan Romanick2016-08-301-11/+28
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Use find_msb_uint to implement ir_unop_find_lsbIan Romanick2016-08-301-10/+9
| | | | | | | | | | (X & -X) calculates a value with only the least significant bit of X set. Since there is only one bit set, the LSB is the MSB. v2: Remove extra int() cast. Suggested by Matt. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Extract ir_unop_find_msb implementation to a separate functionIan Romanick2016-08-301-15/+34
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Extract ir_unop_bitfield_reverse implementation to a separate functionIan Romanick2016-08-301-13/+27
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Use _mesa_bitcount to implement constant ir_unop_bit_countIan Romanick2016-08-301-9/+2
| | | | | Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Delete spurious comment about mod not taking integer operandsIan Romanick2016-08-301-6/+1
| | | | | | | This hasn't been true since we added support for GLSL 1.30. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Delete spurious comment about updating ir_expression::get_num_operandsIan Romanick2016-08-301-3/+0
| | | | | | | This hasn't been necessary since 007f48815. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Do not generate comments or extra whitespace in expression filesIan Romanick2016-08-301-301/+216
| | | | | | | | The comments and whitespace can live in the Python code. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Just access the ir_expression_operation strings table directlyIan Romanick2016-08-305-29/+7
| | | | | | | | | | | | | | The operator_string functions gave us some protection against a malformed table. Now that the table is generated from the same data that generates the enum, this is not a concern. Just cut out the middle man. text data bss dec hex filename 7531892 273992 28584 7834468 778b64 i965_dri-64bit-before.so 7531828 273992 28584 7834404 778b24 i965_dri-64bit-after.so Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Generate ir_expression_operation_strings.h from PythonIan Romanick2016-08-306-153/+44
| | | | | | | | | | | | 'diff -ud' is clean. v2: Massive rebase. v3: With much help from José Fonseca, fix the SCons build. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Pull operator_strs out to its own fileIan Romanick2016-08-303-115/+140
| | | | | | | | | | No change except to the copyright symbol. The next patch will generate this file with Python, and Unicode + Python = pure rage. v2: Massive rebase. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Generate the ir_last_* valuesIan Romanick2016-08-301-28/+20
| | | | | | | | | | This ensures that they remain correct if the list is rearranged or new opcodes are added. I checked a diff of before and after to ensure that each ir_last_ had the same value. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* glsl: Generate ir_expression_operation.h from PythonIan Romanick2016-08-3011-341/+411
| | | | | | | | | | | | | There are differences in where end-of-line comments are placed, but 'diff -wud' is clean. v2: Massive rebase. v3: With much help from José Fonseca, fix SCons build. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Matt Turner <[email protected]> Acked-by: Dylan Baker <[email protected]>
* anv: Rework pipeline cachingJason Ekstrand2016-08-308-432/+320
| | | | | | | | | | | | | | | | | | | The original pipeline cache the Kristian wrote was based on a now-false premise that the shaders can be stored in the pipeline cache. The Vulkan 1.0 spec explicitly states that the pipeline cache object is transiant and you are allowed to delete it after using it to create a pipeline with no ill effects. As nice as Kristian's design was, it doesn't jive with the expectation provided by the Vulkan spec. The new pipeline cache uses reference-counted anv_shader_bin objects that are backed by a large state pool. The cache itself is just a hash table mapping keys hashes to anv_shader_bin objects. This has the added advantage of removing one more hand-rolled hash table from mesa. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97476 Acked-by: Kristian Høgsberg Kristensen <[email protected]>
* anv: Add a struct for storing a compiled shaderJason Ekstrand2016-08-303-0/+160
| | | | | | | | | | | | | | | | This new anv_shader_bin struct stores the compiled kernel (as an anv_state) as well as all of the metadata that is generated at shader compile time. The struct is very similar to the old cache_entry struct except that it is reference counted and stores the actual pipeline_bind_map. Similarly to cache_entry, much of the actual data is floating-size and stored after the main struct. Unlike cache_entry, which was storred in GPU-accessable memory, the storage for anv_shader_bin kernels comes from a state pool. The struct itself is reference-counted so that it can be used by multiple pipelines at a time without fear of allocation issues. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]> Acked-by: Kristian Høgsberg Kristensen <[email protected]>
* anv: Add pipeline_has_stage guards a few placesJason Ekstrand2016-08-304-10/+40
| | | | | | | | | All of these worked before because they were depending on prog_data to be null. Soon, we won't be able to depend on a nice prog_data pointer and it's nice to be more explicit anyway. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv: Remove unused fields from anv_pipeline_bind_mapJason Ekstrand2016-08-301-2/+0
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Properly handle OOM during shader compilationJason Ekstrand2016-08-302-15/+30
| | | | | Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/allocator: Correctly set the number of bucketsJason Ekstrand2016-08-301-1/+1
| | | | | | | | | | | | The range from ANV_MIN_STATE_SIZE_LOG2 to ANV_MAX_STATE_SIZE_LOG2 should be inclusive and we have asserts that ensure that you never try to allocate a state larger than (1 << ANV_MAX_STATE_SIZE_LOG2). However, without adding 1 to the difference, we allocate 1 too few bucckts and so, even though we have an assert, anything landing in the last bucket will fail to allocate properly.. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/pipeline: Fix bind maps for fragment output arraysJason Ekstrand2016-08-301-1/+1
| | | | | | | Found by inspection. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* anv/descriptor_set: memset anv_descriptor_set_layoutJason Ekstrand2016-08-301-2/+1
| | | | | | | | We hash this data structure so we can't afford to have uninitialized data even if it is just structure padding. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "12.0" <[email protected]>
* docs/helpwanted: fix GL3.txt/features.txt linkEric Engestrom2016-08-301-2/+2
| | | | | | | | Fixes: f926cf5bd0ade3273b32 ("docs: Rename GL3.txt to features.txt") Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Ian Romanick <[email protected]> CC: Andreas Boll <[email protected]>
* anv/wayland: fix assert typoEric Engestrom2016-08-301-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* anv/meta: fix unreachable() typoEric Engestrom2016-08-301-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* st/nine: fix unreachable() typoEric Engestrom2016-08-301-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>