summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
Commit message (Collapse)AuthorAgeFilesLines
* freedreno/a6xx: Share shader state constructor and destructorKristian H. Kristensen2019-09-186-190/+76
| | | | | | | Also, swap vs and fs constructor or so fs comes first. Signed-off-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: Track location of gl_Position out as we link itKristian H. Kristensen2019-09-181-3/+5
| | | | | | | | | | | | | | When using xfb and rasterizing, the fragment shader may have fewer inputs than the vertex shader outputs. We can't rely on gl_Position to be placed at fs->total_in, but have to instead remember where we add it in the link map and use that location. Fixes 100+ tesselation dEQPs under dEQP-GLES31.functional.tessellation.primitive_discard.* dEQP-GLES31.functional.tessellation.user_defined_io.* Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: pre-calculate userconst stateobj sizeRob Clark2019-09-124-3/+44
| | | | | | | | The AnTuTu "garden" benchmark overflows the fixed size constbuffer stateobject, so lets be more clever and calculate (a potentially slightly pessimistic) actual size. Signed-off-by: Rob Clark <[email protected]>
* freedreno: fix compiler warningRob Clark2019-09-121-1/+1
| | | | | | | fd6_blitter.c:724:31: warning: passing argument 1 of ‘fd_resource_level_linear’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers] Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a6xx: fix 3d tex layoutRob Clark2019-09-101-3/+4
| | | | | | | Fixes dEQP-GLES3.functional.texture.specification.texstorage3d.size.3d_2x2x2_2_levels Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: don't tile things that are too smallRob Clark2019-09-102-5/+11
| | | | | | | | | | | If the lowest (largest) mipmap level is too small to tile, then don't bother pretending. Note that this requires initializing pipe->screen before fd_resource_level_linear() is called. Signed-off-by: Rob Clark <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* freedreno/a6xx: Implement primitive count queries on GPUKristian H. Kristensen2019-09-0613-18/+123
| | | | | | | | | | The driver can't determine PIPE_QUERY_PRIMITIVES_GENERATED or PIPE_QUERY_PRIMITIVES_EMITTED once we support geometry or tessellation, since these stages add primitives at runtime. Use the WRITE_PRIMITIVE_COUNTS event to write back the primitive counts and implement a hw query for this. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a6xx: Let the GPU track streamout offsetsKristian H. Kristensen2019-09-064-19/+36
| | | | | | | | | | The GPU writes out streamout offsets as it goes to the FLUSH_BASE pointer. We use that value with CP_MEM_TO_REG when appending to the stream so that we don't have to track the offsets with the CPU in the driver. This ensures that streamout continues to work once we enable geometry and tessellation shader stages that add geometry. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: formats updateJonathan Marek2019-09-064-247/+103
| | | | | | | | | | | | | | For render formats, update fd2_pipe2color to only work with HW supported render formats, and remove the format whitelist is_format_supported. This patch enables float render formats (which work). For vertex/texture formats, use a generic function which translates using the bitsize of the channels. Since we fake support for some vertex formats, check for these in is_format_supported to avoid enabling them as sampler formats. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: fix depth gmem restoreJonathan Marek2019-09-061-15/+12
| | | | | | | | | | | | | | Use fd_gmem_restore_format() to avoid trying to use unsupported Z24S8/Z16 render formats for gmem restore. Also apply this change to gmem2mem so it doesn't depend on fd2_pipe2color working with depth formats. gmem2mem/mem2gmem also doesn't need to use the swap/swizzle, since dst/src formats are the same. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: implement polygon offsetJonathan Marek2019-09-061-0/+12
| | | | | | | | | Fixes failures in the following deqp tests: dEQP-GLES2.functional.polygon_offset.* Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: fix SRC_ALPHA_SATURATE for alpha blend functionJonathan Marek2019-09-061-1/+6
| | | | | | | | | Fixes failures in the following deqp tests: dEQP-GLES2.functional.fragment_ops.*src_alpha_saturate* Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: update register state in scalar insertJonathan Marek2019-09-061-0/+6
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: ir2: fix incorrect instruction reorderingJonathan Marek2019-09-061-0/+16
| | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]>
* freedreno/a2xx: ir2: check opcode on the right instruction in export cpJonathan Marek2019-09-061-1/+1
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: fix saturate in cpJonathan Marek2019-09-061-0/+4
| | | | | | Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: set lower_fdphJonathan Marek2019-09-061-0/+1
| | | | | | | | The fdph opcode is not supported. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: remove pointcoord y invertJonathan Marek2019-09-061-4/+2
| | | | | | | | | Fixes the following deqp test: dEQP-GLES2.functional.shaders.builtin_variable.pointcoord Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* freedreno/a2xx: ir2: fix lowering of instructions after float loweringJonathan Marek2019-09-061-3/+2
| | | | | | | | | | | Some instructions generated by int/bool float lowering need to be lowered by opt_algebraic. Fixes: 43dbd7d6 Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Rob Clark <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* nir: allow specifying filter callback in lower_alu_to_scalarVasily Khoruzhick2019-09-061-11/+24
| | | | | | | | | | | | | Set of opcodes doesn't have enough flexibility in certain cases. E.g. Utgard PP has vector conditional select operation, but condition is always scalar. Lowering all the vector selects to scalar increases instruction number, so we need a way to filter only those ops that can't be handled in hardware. Reviewed-by: Qiang Yu <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Vasily Khoruzhick <[email protected]>
* freedreno: Fix the type of single-component scaled vertex attrs.Eric Anholt2019-09-034-12/+12
| | | | | | | | | | This looks like clear copy-and-pasteos, and fixes: dEQP-GLES2.functional.draw.random.40 (on A307 and A630, both tested in the new CI farm) Reviewed-by: Rob Clark <[email protected]>
* freedreno/a3xx: fix sysmem <-> gmem tiles transferKhaled Emara2019-08-302-2/+3
| | | | | | | Tiling mode was missing from fd3_emit_gmem_restore_tex(). emit_gmem2mem_surf() used LINEAR exclusiveley. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a3xx: fix texture tiling parametersKhaled Emara2019-08-301-10/+21
| | | | | | | | * Fix 2D/2DArray/3D tiling parameters: There is a bottom threshold for width and height. * Renable tiling for Cubemap, after setting the right parameters. Reviewed-by: Rob Clark <[email protected]>
* freedreno/a6xx: Fix non-mipmap filtering selection.Eric Anholt2019-08-281-6/+6
| | | | | | | | | | We were clamping the LOD to force non-mipmap filtering, but that means that the HW doesn't get to select between the min and mag filters. Setting MIPFILTER_LINEAR_FAR appears to force non-mipmap filtering. Fixes all failures in dEQP-GLES2.functional.texture.filtering.2d.* Reviewed-by: Rob Clark <[email protected]>
* freedreno/a6xx: move SSBO/image consts to IBO stateobjRob Clark2019-08-131-13/+10
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: move VS driverparams to it's own stateobjRob Clark2019-08-132-5/+15
| | | | | | | | | If driver-params are required, we really should emit it on every draw for correctness. And if not required, we should emit a DISABLE so that un-applied state updates from previous draws don't corrupt the const state. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3+a6xx: same VBO state for draw/binningRob Clark2019-08-133-5/+9
| | | | | | Worth ~+20% on gl_driver2 Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: add fd_emit_take_group()Rob Clark2019-08-132-19/+17
| | | | | | | | | Which takes ownership of the stateobj. Useful for streaming state- objs, to avoid an extra ref/unref Worth ~5% at gl_driver2 Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: track # of driver paramsRob Clark2019-08-131-1/+3
| | | | | | To avoid emitting unneeded const state. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: move immediates to program stateobjRob Clark2019-08-132-6/+9
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: stop using ir3_emit_{vs,fs}_consts()Rob Clark2019-08-133-17/+53
| | | | | | | Should be no functional change. Next step is to re-arrange various const state into different stateobjs. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: push ctx further up call chainRob Clark2019-08-131-21/+22
| | | | | | Move more of the code to deal just w/ screen, without requiring ctx. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: move ring_wfi() further up call chainRob Clark2019-08-131-10/+8
| | | | | | | | | | Hoist them out of code-paths that will eventually be called directly for various a6xx+ const related stateobjs. This ends up duplicating one constlen check in ir3_emit_vs_consts(), to avoid what could otherwise be an unnecessary WFI on older gens. Signed-off-by: Rob Clark <[email protected]>
* freedreno/all: move more emit helpers to screenRob Clark2019-08-139-24/+21
| | | | | | | framebuffer_barrier() still depends on the ctx, but the rest can move to screen. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx-a6xx+ir3: move emit_const* to screenRob Clark2019-08-137-19/+24
| | | | | | | These don't need to be in context, and we'll need them in screen in a later patch. Plus it's a good cleanup. Signed-off-by: Rob Clark <[email protected]>
* freedreno/a6xx: add fd6_emit_init_screen()Rob Clark2019-08-133-0/+9
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: add fd5_emit_init_screen()Rob Clark2019-08-133-0/+9
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: add fd3_emit_init_screen()Rob Clark2019-08-133-0/+8
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a2xx: add fd2_emit_init_screen()Rob Clark2019-08-133-0/+9
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a4xx: add fd4_emit_init_screen()Rob Clark2019-08-133-0/+8
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a2xx: call fd2_emit_ib() directly from fd2Rob Clark2019-08-133-8/+8
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a5xx: call fd5_emit_ib() directly from fd5Rob Clark2019-08-133-16/+16
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a4xx: call fd4_emit_ib() directly from fd4Rob Clark2019-08-133-7/+7
| | | | Signed-off-by: Rob Clark <[email protected]>
* freedreno/a3xx: call fd3_emit_ib() directly from fd3Rob Clark2019-08-133-7/+7
| | | | | | No reason for the indirection when called from a3xx specific code. Signed-off-by: Rob Clark <[email protected]>
* freedreno/ir3: move VS driver-param emitRob Clark2019-08-132-68/+89
| | | | | | | | Move DP emit to it's own function. No functional change, just code motion to prepare for splitting up const state into multiple state- objs on a6xx. Signed-off-by: Rob Clark <[email protected]>
* freedreno: disable tiling for cubemapsKhaled Emara2019-08-121-2/+5
| | | | | Tiling doesn't work quite well with cubemaps. Revert to linear textures, until it's fixed.
* freedreno: add tiling parameters for 2D/2DArray/3DKhaled Emara2019-08-121-2/+19
|
* freedreno: simplified slices setup for a3xxKhaled Emara2019-08-121-12/+3
| | | | a3xx doesn't support ASTC and layout_first always returns false
* freedreno: enable tiled textures for debug buildsKhaled Emara2019-08-129-8/+173
|
* nir: merge and extend nir_opt_move_comparisons and nir_opt_move_load_uboRhys Perry2019-08-121-1/+1
| | | | | | | | | | v2: add to series v3: update Makefile.sources v4: don't remove a comment and break statement v4: use nir_can_move_instr Signed-off-by: Rhys Perry <[email protected]> Reviewed-by: Eric Anholt <[email protected]>