aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600
Commit message (Collapse)AuthorAgeFilesLines
* r600/sfn: extract class to handle the VS export to different stagesGert Wollny2020-04-288-467/+617
| | | | | | | This code can be shared with the TESS_EVAL shader Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Move some shader base methods to the public interfaceGert Wollny2020-04-281-5/+7
| | | | | | | This will be needed for handling the VS stage export better. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Add methods to valuepool to get a vector of valuesGert Wollny2020-04-282-0/+22
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Move emission of barrier from compute shader to shader baseGert Wollny2020-04-284-11/+14
| | | | | | | Tess shaders also use these barriers. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Emit some LDS instructionsGert Wollny2020-04-282-0/+53
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Handle umul24 and umad24Gert Wollny2020-04-282-1/+5
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Add IR instruction to fetch the TESS parametersGert Wollny2020-04-282-0/+31
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Add TF write instructionGert Wollny2020-04-284-0/+83
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Add LDS instruction to assembly conversionGert Wollny2020-04-281-0/+78
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Add LDS IO instructions to r600 IRGert Wollny2020-04-285-0/+166
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: Don't emit inline constants in the r600 IRGert Wollny2020-04-281-23/+2
| | | | | | | | This can be handled when lowering to assembly, and it makes testing for indirect buffer and sampler access easier. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600/sfn: simplify UBO lowering passGert Wollny2020-04-281-20/+15
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* r600: Handle texcoord semantics in LDS index evaluationGert Wollny2020-04-283-10/+12
| | | | | | | | With NIR the texcoord semantic is enabled, and hence we have to handle index evaluation differently here. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4714>
* st/dri: Set next in template instead of after creation. (v2)Bas Nieuwenhuizen2020-04-271-1/+0
| | | | | | | | | | | | | | | | | This should prevent horrors like Iris has with the delayed calls to iris_resource_finish_aux_import just because info is not available at allocation time. AFAICT all drivers just copy the template except radeonsi/r600 which reset the next pointer. AFAICT there is also no other place we get a state tracker setting next ptrs on a resource. v2: Updated Gallium docs. Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3792>
* r600/sfn: use new temp register allocation when loading single value temporariesGert Wollny2020-04-211-2/+1
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Count only literals that are not inline to split instruction groupsGert Wollny2020-04-211-1/+11
| | | | | | | | An instruction group can only support 4 distinct literals, but inline constants count into this number, so skip them when counting. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Fix using the result of a fetch instruction in next fetchGert Wollny2020-04-211-0/+11
| | | | | | | | | The result of a fetch instruction can't be used as source in the same CF block, so force a new CF block when the result would be used in the same vertex fetch block. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Fix handling of GS inputsGert Wollny2020-04-211-0/+3
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Handle b2b1 like it was a movGert Wollny2020-04-211-0/+1
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Fix null pointer deref in live range evalationGert Wollny2020-04-211-2/+4
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/nir: Pin interpolation results to channelGert Wollny2020-04-213-0/+11
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Implementing instructions blocksGert Wollny2020-04-2112-36/+199
| | | | Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Fix setting alignments when lowering UBOsGert Wollny2020-04-211-1/+1
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600/sfn: Reduce array limit for scratch usageGert Wollny2020-04-211-1/+1
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* r600: Dump a few more variables when requestedGert Wollny2020-04-211-0/+32
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4609>
* Fix promotion of floats to doublesAlbert Astals Cid2020-04-181-12/+12
| | | | | | | | | Use the f variants of the math functions if the input parameter is a float, saves converting from float to double and running the double variant of the math function for gaining no precision at all Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3969>
* meson: inline `inc_common`Eric Engestrom2020-03-281-1/+1
| | | | | | | | | Let's make it clear what includes are being added everywhere, so that they can be cleaned up. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
* r600: Fix build error in sfn_nir_lower_fs_out_to_vector.cppJohn Stultz2020-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | In trying a full build under AOSP, I ran into the following error: In file included from external/mesa3d/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp:33: external/libcxx/include/set:942:26: error: the specified comparator type does not provide a const call operator [-Werror,-Wuser-defined-warnings] static_assert(sizeof(__diagnose_non_const_comparator<_Key, _Compare>()), ""); ^ external/mesa3d/src/gallium/drivers/r600/sfn/sfn_nir_lower_fs_out_to_vector.cpp:78:34: note: in instantiation of template class 'std::__1::multiset<nir_intrinsic_ins tr *, r600::nir_intrinsic_instr_less, std::__1::allocator<nir_intrinsic_instr *> >' requested here using InstrSubSet = std::pair<InstrSet::iterator, InstrSet::iterator>; ^ external/libcxx/include/__tree:967:5: note: from 'diagnose_if' attribute on '__diagnose_non_const_comparator<nir_intrinsic_instr *, r600::nir_intrinsic_instr_less>': _LIBCPP_DIAGNOSE_WARNING(!std::__invokable<_Compare const&, _Tp const&, _Tp const&>::value, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ external/libcxx/include/__config:1244:21: note: expanded from macro '_LIBCPP_DIAGNOSE_WARNING' __attribute__((diagnose_if(__VA_ARGS__, "warning"))) ^ ~~~~~~~~~~~ 1 error generated. Which is pretty opaque to me, but searching the web suggested adding a cost, which seems to resovle it. Reviewed-by: Gert Wollny <[email protected]> Signed-off-by: John Stultz <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4175> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4175>
* Revert "gallium: make handles of set_global_binding 64 bit"Karol Herbst2020-03-101-5/+5
| | | This reverts commit e1ffb72a05f9b50ee47767aaadbab3e47896ee14
* gallium: make handles of set_global_binding 64 bitKarol Herbst2020-03-101-5/+5
| | | | | | | | | | needed by CL Signed-off-by: Karol Herbst <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4072> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4072>
* android: r600/sfn: Add GDS instructionsMauro Rossi2020-03-041-0/+2
| | | | | | | | | | | | Fixes the following building errors: external/mesa/src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp:59: error: undefined reference to 'r600::GDSInstr::GDSInstr(r600::ESDOp, r600::GPRVector const&, std::__1::shared_ptr<r600::Value> const&, std::__1::shared_ptr<r600::Value> const&, std::__1::shared_ptr<r600::Value> const&, int)' ... external/mesa/src/gallium/drivers/r600/sfn/sfn_emitssboinstruction.cpp:256: error: undefined reference to 'r600::RatInstruction::RatInstruction(r600::ECFOpCode, r600::RatInstruction::ERatOp, r600::GPRVector const&, r600::GPRVector const&, int, std::__1::shared_ptr<r600::Value> const&, int, int, int, bool)' Fixes: 32d3435a ("r600/sfn: Add GDS instructions") Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Gert Wollny <[email protected]>
* android: r600/sfn: fix includes and libmesa_nir dependencyMauro Rossi2020-03-041-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | Fixes the following building errors: In file included from external/mesa/src/gallium/drivers/r600/sfn/sfn_debug.cpp:28: In file included from external/mesa/src/gallium/drivers/r600/sfn/sfn_debug.h:34: In file included from external/mesa/src/compiler/nir/nir.h:41: In file included from external/mesa/src/compiler/nir_types.h:36: external/mesa/src/compiler/glsl_types.h:38:10: fatal error: 'main/config.h' file not found #include "main/config.h" ^~~~~~~~~~~~~~~ 1 error generated. In file included from external/mesa/src/gallium/drivers/r600/sfn/sfn_debug.cpp:28: In file included from external/mesa/src/gallium/drivers/r600/sfn/sfn_debug.h:34: external/mesa/src/compiler/nir/nir.h:50:10: fatal error: 'nir_opcodes.h' file not found #include "nir_opcodes.h" ^~~~~~~~~~~~~~~ 1 error generated. Fixes: f718ac62 ("r600/sfn: Add a basic nir shader backend") Signed-off-by: Mauro Rossi <[email protected]> Reviewed-by: Gert Wollny <[email protected]>
* r600/sfn: Don't try to catch exceptions, the driver doesn't throw anyGert Wollny2020-03-021-12/+6
| | | | | | Signed-off-by: Gert Wollny <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3974> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3974>
* r600/sfn: Use static_cast when type is already knownGert Wollny2020-03-028-12/+12
| | | | | | | | | | | In all these cases the type was tested before based, so don't use dynamic_casts. Closes #2566 Signed-off-by: Gert Wollny <[email protected]> Tested-by: Mauro Rossi <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3974>
* r600/sfn: Avoid using dynamic_cast to identify typeGert Wollny2020-03-022-17/+34
| | | | | | | | | | v2: Fix typo (maurossi) Related: #2566 Signed-off-by: Gert Wollny <[email protected]> Tested-by: Mauro Rossi <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3974>
* r600: add missing <array> includeGreg V2020-02-281-0/+1
| | | | | | | | | | | Fixes error with clang/libc++: ../src/gallium/drivers/r600/sfn/sfn_emitaluinstruction.h:69:88: error: implicit instantiation of undefined template 'std::__1::array<unsigned char, 3>' bool emit_alu_op3(const nir_alu_instr& instr, EAluOp opcode, std::array<uint8_t, 3> reorder={0,1,2}); Reviewed-by: Gert Wollny <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3967> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3967>
* gallium/video: remove pipe_video_buffer.chroma_formatPierre-Eric Pelloux-Prayer2020-02-271-1/+0
| | | | | | | | | | chroma_format depends on buffer_format so use the format_to_chroma_format helper instead of storing it next to buffer_format. This avoids bugs where one value is changed without updating the other. Reviewed-by: Marek Olšák <[email protected]> Acked-by: Leo Liu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3738>
* nir/builder: Return an integer from nir_get_texture_sizeJason Ekstrand2020-02-211-1/+1
| | | | | | | | | | It's convenient in a bunch of cases for nir_get_texture_size to return a float but it's very unexpected. This fixes a bug in the R600 NIR code. Fixes: f718ac62688b "r600/sfn: Add a basic nir shader backend" Reviewed-by: Eric Anholt <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3897> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3897>
* r600/sfn: Add some documentationGert Wollny2020-02-101-0/+69
| | | | | | Signed-off-by: Gert Wollny <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add .editorconfig fileGert Wollny2020-02-101-0/+2
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add support for SSBO load and storeGert Wollny2020-02-103-0/+99
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add support for atomic instructionsGert Wollny2020-02-106-0/+228
| | | | | | | v2: fix compilation with gcc-6 Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600: Make sure LLVM is not used for DRAWGert Wollny2020-02-101-0/+5
| | | | | | | | | For some reasone that is not yet clear the piglit gl-1.0-rendermode-feedback makes use of the LLVM pipe draw module and fails there with an assertion. Explicietly disabling LLVM fixes this. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add lowering UBO access to r600 specific codesGert Wollny2020-02-102-2/+105
| | | | | | | | | | r600 reads vec4 from the UBO, but the offsets in nir are evaluated to the component. If the offsets are not literal then all non-vec4 reads must resolve the component after reading a vec4 component (TODO: figure out whether there is a consistent way to deduct the component that is actually read). Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add GDS instructionsGert Wollny2020-02-104-0/+504
| | | | | Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add compute shader skeletonGert Wollny2020-02-107-0/+223
| | | | | | | | | | | This adds some very basic compute shader support. v2: fix compilation with gcc-6 v3: rebase: correct barrier intrinstic Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add VS for TCS shader skeletonGert Wollny2020-02-102-0/+27
| | | | | | | This adds the VS shader type that handles the output to tesselation shaders Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add support for geometry shaderGert Wollny2020-02-107-1/+459
| | | | | | | v2: fix compilation with gcc-6 Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: add emitVertex instructionsGert Wollny2020-02-103-0/+45
| | | | | | | More preparation for GS support Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>
* r600/sfn: Add MemRingOut instructionsGert Wollny2020-02-103-1/+143
| | | | | | | Preparing support for Geometry shaders. Signed-off-by: Gert Wollny <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3225>