summaryrefslogtreecommitdiffstats
path: root/src/panfrost
Commit message (Collapse)AuthorAgeFilesLines
* panfrost: Fix linear depth texturesAlyssa Rosenzweig2020-01-142-11/+27
| | | | | | | | | | | | | | | | As pointed out by Boris, what we were calling PAN_LINEAR depth textures was in fact u-interleaved tiled (!), but we never noticed since we flipped the flag used for sampling, leading to all sorts of fun bugs when attempting to directly acess depth textures from the CPU. Which begs the question -- if what we called LINEAR was tiled, how do we actually render linear depth textures? It turns out the flags for AFBC form a mali_block_format 2-bit code just like their render-target counterparts, so we can render to any of the above. Signed-off-by: Alyssa Rosenzweig <[email protected]> Reported-by: Boris Brezillon <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3393> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3393>
* pan/midgard: Fix midgard_compile.h includesAfonso Bordado2020-01-141-0/+1
| | | | | | | We now use enum mali_format which is defined in panfrost-job.h Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3243> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3243>
* panfrost: Remove unneeded phi nodesBoris Brezillon2020-01-131-0/+1
| | | | | | | | | Add a pass to remove unneeded phi nodes as done in other drivers. Signed-off-by: Boris Brezillon <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3294> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3294>
* pan/midgard: Support indirect UBO offsetsAlyssa Rosenzweig2020-01-102-22/+7
| | | | | | | | | ...in case we have arrays in a UBO block that we'd like to access indirectly. Signed-off-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3352> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3352>
* panfrost: Add negative lod bias supportIcecream952020-01-101-9/+11
| | | | Reviewed-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Don't double-flip Z/W for 2D arraysAlyssa Rosenzweig2020-01-071-2/+5
| | | | | | | | | We need to mindful that we don't clobber the shadow comparator. Fixes dEQP-GLES3.functional.shaders.texture_functions.texture.sampler2darrayshadow_* Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* pan/midgard: Account for z/w flip in texelFetchAlyssa Rosenzweig2020-01-071-0/+9
| | | | | | | | | Required for proper txf of 2D arrays. Fixes dEQP-GLES3.functional.shaders.texture_functions.texelfetch.*2darray* Signed-off-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Tomeu Vizoso <[email protected]>
* panfrost: Fix Android buildRoman Stratiienko2020-01-041-0/+1
| | | | | | | Include missing `encoder/pan_props.c` into the build. Signed-off-by: Roman Stratiienko <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Use upper ALU tags for MFBD writeoutAlyssa Rosenzweig2020-01-023-2/+22
| | | | | | It's not clear yet what the distinction is. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Identity ld_color_buffer as 32-bitAlyssa Rosenzweig2020-01-023-4/+4
| | | | | | I'm not sure why I mistakenly identified it as an 8-bit op before. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Remove old commentAlyssa Rosenzweig2020-01-021-1/+0
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Generate MRT writeout loopsAlyssa Rosenzweig2020-01-025-31/+84
| | | | | | | | They need a very particular form; the naive way we did before is not sufficient in practice, it doesn't look like. So let's follow the rough structure of the blob's writeout since this is fixed code anyway. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Generalize IS_ALU and quadword_sizeAlyssa Rosenzweig2020-01-028-98/+53
| | | | | | There are more ALU tags, let's do some cleanup while we're at it. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Use better heuristic for shader terminationAlyssa Rosenzweig2020-01-021-24/+17
| | | | | | | | | This still may not be perfect (in the sense that legal shaders might still get cut off) but this fits how writeout is done with both Panfrost and the blob, so it's good enough for what we need and allows MRT shaders to be sanely disassembled. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix memory corruption in constant combiningAlyssa Rosenzweig2020-01-021-1/+1
| | | | | | | | It's a long story... but we'd try to insert constants that weren't there and end up clobbering fields in the bundle following the constant array... Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Dynamically allocate array of texture pointersTomeu Vizoso2020-01-022-8/+6
| | | | | | | | With 3D textures we can have lots of layers, so better allocate it dynamically at runtime. Signed-off-by: Tomeu Vizoso <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Optimize branches with inverted argumentsAfonso Bordado2019-12-313-0/+26
| | | | | | | | | | Remove the invert on arguments to branches, and invert the branch condition instead. This saves one instruction per inverted argument. Closes #2088 Signed-off-by: Afonso Bordado <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Move midgard_is_branch_unit to helpersAfonso Bordado2019-12-312-7/+6
| | | | | Signed-off-by: Afonso Bordado <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Remove prepacked_branchAlyssa Rosenzweig2019-12-316-39/+6
| | | | | | It's an ugly hack that's no longer used. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Convert fragment writeout to proper branchesAlyssa Rosenzweig2019-12-311-3/+14
| | | | | | | This eliminates the only use of prepacked_branch, which is a such a hack anyway. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove MRT indirection in blend shadersAlyssa Rosenzweig2019-12-301-0/+4
| | | | | | | | | | Since we have a separate blend shader for each render target, let's simplify this structure and reduce the options memory footprint by 88% or something goofy like that. Should also enable separate blending per render target. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Implement integer varyingsAlyssa Rosenzweig2019-12-302-0/+54
| | | | | | | | | We need to actually work out the varying format on demand, rather than assuming rgba32f. Fixes dEQP-GLES3.functional.fragment_out.basic.int.* Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Identify glProvokingVertex flagAlyssa Rosenzweig2019-12-301-0/+6
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Implement flat shadingAlyssa Rosenzweig2019-12-302-6/+17
| | | | | | We need to shuffle around some lowerings but it's just a flag. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Use type-appropriate st_varyAlyssa Rosenzweig2019-12-301-0/+16
| | | | | | We would like to store (u)ints as well. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix Makefile.sourcesCaio Marcelo de Oliveira Filho2019-12-281-1/+1
| | | | | | | Add missing `\`. Fixes Android build. Reviewed-by: Eric Engestrom <[email protected]> Fixes: de077c20788e9cccd0ef ("panfrost: Remove mali_alt_func")
* panfrost: Remove 32-bit next_job pathAlyssa Rosenzweig2019-12-272-11/+3
| | | | | | | | | | It has been unused for a while; let's just remove the abstraction. Technically the hardware does support 32-bit job descriptors, but we don't and we can't keep them from breaking so let's not pretend they work. Signed-off-by: Alyssa Rosenzweig <[email protected]> Suggested-by: Boris Brezillon <[email protected]>
* panfrost; Update comment about work/uniform_countAlyssa Rosenzweig2019-12-271-3/+1
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove mali_alt_funcAlyssa Rosenzweig2019-12-276-38/+56
| | | | | | | | | | There's only one way to encode comparison functions in the command stream, not two. It's just that the semantics for texture comparisons are flipped from the semantics of stencil comparison. We can factor out that flip to common Panfrost code, rather than tying it to a second Gallium routine. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add missing #include in common headerAlyssa Rosenzweig2019-12-271-0/+1
| | | | | | Fixes way back when... Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Add pan_attributes.c to Android.mkAlyssa Rosenzweig2019-12-271-0/+1
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Fixes: 31305e1b285 ("panfrost: Move instancing routines to encoder/")
* panfrost: Implement remaining texture wrap modesAlyssa Rosenzweig2019-12-271-5/+9
| | | | | | | | Somehow we have native hardware for all of these. Suspected by staring at the bit pattern; confirmed by poking in various texture wrap modes into the textures mesa demo and seeing what happens. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Inline away MALI_NEGATIVEAlyssa Rosenzweig2019-12-272-9/+5
| | | | | | It's an awfully fancy way to add one... Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove MALI_ATTR_INTERNALAlyssa Rosenzweig2019-12-272-3/+0
| | | | | | | It's a relic from before we understood the varying builtins. It should never actually come up if the builtins are decoded correctly. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Update information on fixed attributes/varyingsAlyssa Rosenzweig2019-12-271-3/+2
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove MALI_SPECIAL_ATTRIBUTE_BASE definesAlyssa Rosenzweig2019-12-271-5/+0
| | | | | | | | | These are conventions by the blob (a convention we happent to follow). They are not at all intrinsic to the hardware, so now that the convention is implemented within the Midgard stack, these defines are wholly unused. Remove them. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix minor typoAlyssa Rosenzweig2019-12-271-1/+1
| | | | | Signed-off-by: Alyssa Rosenzweig <[email protected]> Reported-by: Erik Faye-Lund <[email protected]>
* panfrost: Route gl_VertexID through cmdstreamAlyssa Rosenzweig2019-12-242-0/+43
| | | | | | | | | | | It shows up as a special (magic?) attribute. We could try to be clever and only include the extra record if gl_VertexID is actually read, but honestly that's just extra complexity for no good reason. Might as well just always include it; this won't be a real bottleneck, I don't think. Fixes dEQP-GLES3.functional.shaders.builtin_variable.vertex_id. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Lower gl_VertexID/gl_InstanceID to attributesAlyssa Rosenzweig2019-12-242-0/+35
| | | | | | | We have special records for these, put in a fixed location by convention per the blob. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Factor out emit_attr_readAlyssa Rosenzweig2019-12-241-24/+33
| | | | | | We will load attributes directly for gl_VertexID. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Unset vertex_id_zero_basedAlyssa Rosenzweig2019-12-242-2/+0
| | | | | | We don't want the lowering; we have native gl_VertexID. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Handle gl_VertexID/gl_InstanceIDAlyssa Rosenzweig2019-12-242-22/+46
| | | | | | | | | Just like varyings have special records for point coordinates (etc), attributes have special records for vertex/instance ID. We can parse these fairly easily, although they don't line up exactly with normal attribute records. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Remove pan_shift_oddAlyssa Rosenzweig2019-12-242-88/+15
| | | | | | | | | | | | | | | | | Padded counts are numbers of the form: n = (2k + 1) * 2^s for k, s integers. Rather than explicitly store k and s separately and then compute this formula on demand, it's much cleaner to store the padded number itself, which is what you manipulate most of the time. When you do need k,s it is easy to factor by noticing the bitwise representation: s = ctz(n) k = n >> (s + 1) Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/decode: Fix reference computation for invocationsAlyssa Rosenzweig2019-12-241-4/+3
| | | | | | | Slight bug with instancing. No harm done but let's get rid of the pandecode warning, it's just noise. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Fix off-by-one in pan_invocation.cAlyssa Rosenzweig2019-12-241-13/+9
| | | | | | When instance_count=2, the packing code was broken. Fixes a dEQP test. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Factor out panfrost_compute_magic_divisorAlyssa Rosenzweig2019-12-241-30/+41
| | | | | | | | The algorithm doesn't need to be tangled up in details about the attribute records themselves. We'll need to compute magic divisors for gl_InstanceID in a second. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* panfrost: Move instancing routines to encoder/Alyssa Rosenzweig2019-12-243-0/+256
| | | | | | Nothing Gallium specific or stateful about them. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Compute destination overrideAlyssa Rosenzweig2019-12-241-7/+25
| | | | | | We shift over the mask in this case. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Add mir_upper_override helperAlyssa Rosenzweig2019-12-242-0/+30
| | | | | | Checks if we should emit a dest_override=upper, given a mask. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Enable lower_(un)pack_* loweringAlyssa Rosenzweig2019-12-242-2/+13
| | | | | | | These show up in some blend shaders. Let's use the shared lowering and remove our own. Signed-off-by: Alyssa Rosenzweig <[email protected]>