summaryrefslogtreecommitdiffstats
path: root/src/panfrost
Commit message (Collapse)AuthorAgeFilesLines
* 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]>
* pan/midgard: Implement shadow cubemapsAlyssa Rosenzweig2019-12-241-26/+22
| | | | | | | | We need to reshuffle to sync up the shadow coordinate temporary with the cubemap coordinate temporary. Once that's in place, it's simple enough (we load the shadow coordinate into .z like 2D). Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Generalize temp coordinate to non-2DAlyssa Rosenzweig2019-12-241-3/+5
| | | | Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Do witchcraft on texture offsetsAlyssa Rosenzweig2019-12-243-49/+49
| | | | | | | | | | | My latest divination spell has uncovered a pattern in the aether. Although the swizzle is unaligned, its format is otherwise standard. Document this, removing the old incorrect understanding of the swizzle (which coincided on common special swizzles only). Fixes dEQP-GLES3.functional.shaders.texture_functions.texelfetchoffset.sampler2d_fixed_fragment Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Fix fallthrough from offset to comparatorAlyssa Rosenzweig2019-12-241-0/+1
| | | | | Fixes: ccbc9a4e678 ("pan/midgard: Implement textureOffset for 2D textures") Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Expand swizzle for texelFetchAlyssa Rosenzweig2019-12-241-0/+6
| | | | | | | We zero the extra components anyway. Fixes dEQP-GLES3.functional.shaders.texture_functions.texelfetch.sampler2d_fixed_fragment Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Clamp LOD register swizzleAlyssa Rosenzweig2019-12-241-0/+4
| | | | | | Fixes register allocation failures with textureLodOffset. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Extend IS_VEC4_ONLY to argumentsAlyssa Rosenzweig2019-12-241-1/+5
| | | | | | I think both need to be aligned at least for ld_cubemap_coords. Signed-off-by: Alyssa Rosenzweig <[email protected]>
* pan/midgard: Bounds check lcra_restrict_rangeAlyssa Rosenzweig2019-12-241-1/+1
| | | | | | | We may call it with sentinel values (~0 in particular) corresponding to unused arguments; ignore these. Signed-off-by: Alyssa Rosenzweig <[email protected]>