summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi
Commit message (Collapse)AuthorAgeFilesLines
* gallium/tgsi: Don't declare temps individually when they are all similar.José Fonseca2012-07-021-8/+19
| | | | | | | | | | | | tgsi_ureg was recently enhanced to support local temporaries, and as result temps are declared individually. This change avoids many TEMP register declarations on common shaders. (And fixes performance regression due to mismatches against performance sensitive shaders.) Reviewed-by: Brian Paul <[email protected]>
* tgsi: Initialize Padding struct fields.Vinson Lee2012-05-231-0/+4
| | | | | | | Fix uninitialized scalar variable defects report by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/tgsi/text: Ensure ret is initialized in parse_immediate_data.Vinson Lee2012-05-171-0/+4
| | | | | | | Fix uninitialized scalar variable defect reported by Coverity. Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/tgsi: s/TGSI_BUFFER/TGSI_TEXTURE_BUFFER/José Fonseca2012-05-111-2/+2
| | | | | | For consistency. Reviewed-by: Brian Paul <[email protected]>
* gallium/tgsi: Redefine the TGSI_TEXTURE_UNKNOWN texture target.José Fonseca2012-05-112-2/+3
| | | | | | | | | Some code relies on the existing of an invalid texture target. It seems safer to bring it back than to deal with unintended consequences. This partially reverts commit a4ebb04214bab1cd9bd41967232ec89441e31744. Reviewed-by: Brian Paul <[email protected]>
* gallium/tgsi/text: Replace open-coded integer parsing with parse_int().Francisco Jerez2012-05-111-17/+3
|
* gallium/tgsi/text: Parse immediates of non-float data types.Francisco Jerez2012-05-111-18/+48
|
* gallium/tgsi: Fix tgsi_build_full_immediate() for non-float data types.Francisco Jerez2012-05-111-22/+8
|
* gallium/tgsi/text: Make label parsing optional for branch instructions.Francisco Jerez2012-05-111-10/+9
| | | | | Structured branch instructions like IF, ELSE, BGNLOOP, ENDLOOP no longer require a label argument, make it optional for them.
* gallium/tgsi/ureg: Support local temporary emission.Francisco Jerez2012-05-112-6/+60
|
* gallium/tgsi/ureg: Lift the restriction on releasing temporaries over ↵Francisco Jerez2012-05-111-27/+22
| | | | UREG_MAX_TEMP.
* gallium/tgsi: Introduce the "LOCAL" register declaration modifier.Francisco Jerez2012-05-113-26/+46
| | | | | | | | | | | | | | | | | | | | | | | This change will be useful to implement function parameter passing on top of TGSI. As we don't have a proper stack, a register-based calling convention will be used instead, which isn't necessarily a bad thing given that GPUs often have plenty of registers to spare. Using the same register space for local temporaries and inter-procedural communication caused some inefficiencies, because in some cases the register allocator would lose the freedom to merge temporary values together into the same physical register, leading to suboptimal register (and sometimes, as a side effect, instruction) usage. The LOCAL declaration modifier specifies that the value isn't intended for parameter passing and as a result the compiler doesn't have to give any guarantees of it being preserved across function boundaries. Ignoring the LOCAL flag doesn't change the semantics of a valid program in any way, because local variables are just supposed to get a more relaxed treatment. IOW, this should be a backwards-compatible change.
* gallium/tgsi: Add support for atomic opcodes.Francisco Jerez2012-05-111-1/+12
|
* gallium/tgsi: Add support for barriers.Francisco Jerez2012-05-111-0/+4
|
* gallium/tgsi: Define system values used to query the compute grid parameters.Francisco Jerez2012-05-111-1/+5
|
* gallium/tgsi: Add resource write-back support.Francisco Jerez2012-05-114-0/+11
| | | | | Define a new STORE opcode with a role dual to the LOAD opcode, and add flags to specify that a shader resource is intended for writing.
* gallium/tgsi: Add support for raw resources.Francisco Jerez2012-05-113-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | Normal resource access (e.g. the LOAD TGSI opcode) is supposed to perform a series of conversions to turn the texture data as it's found in memory into the target data type. In compute programs it's often the case that we only want to access the raw bits as they're stored in some buffer object, and any kind of channel conversion and scaling is harmful or inefficient, especially in implementations that lack proper hardware support to take care of it -- in those cases the conversion has to be implemented in software and it's likely to result in a performance hit even if the pipe_buffer and declaration data types are set up in a way that would just pass the data through. Add a declaration flag that marks a resource as typeless. No channel conversion will be performed in that case, and the X coordinate of the address vector will be interpreted in byte units instead of elements for obvious reasons. This is similar to D3D11's ByteAddressBuffer, and will be used to implement OpenCL's constant arguments. The remaining four compute memory spaces can also be understood as raw resources.
* gallium/tgsi: Define the TGSI_BUFFER texture target.Francisco Jerez2012-05-112-2/+2
| | | | | | This texture type was already referred to by the documentation but it was never defined. Define it as 0 to match the pipe_texture_target enumeration values.
* gallium/tgsi: Introduce the compute processor.Francisco Jerez2012-05-114-4/+8
|
* gallium/tgsi: Move interpolation info from tgsi_declaration to a separate token.Francisco Jerez2012-05-119-48/+97
| | | | | | Move Interpolate, Centroid and CylindricalWrap from tgsi_declaration to a separate token -- they only make sense for FS inputs and we need room for other flags in the top-level declaration token.
* gallium/tgsi: Split sampler views from shader resources.Francisco Jerez2012-05-1112-107/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit splits the current concept of resource into "sampler views" and "shader resources": "Sampler views" are textures or buffers that are bound to a given shader stage and can be read from in conjunction with a sampler object. They are analogous to OpenGL texture objects or Direct3D SRVs. "Shader resources" are textures or buffers that can be read and written from a shader. There's no support for floating point coordinates, address wrap modes or filtering, and, unlike sampler views, shader resources are global for the whole graphics pipeline. They are analogous to OpenGL image objects (as in ARB_shader_image_load_store) or Direct3D UAVs. Most hardware is likely to implement shader resources and sampler views as separate objects, so, having the distinction at the API level simplifies things slightly for the driver. This patch introduces the SVIEW register file with a declaration token and syntax analogous to the already existing RES register file. After this change, the SAMPLE_* opcodes no longer accept a resource as input, but rather a SVIEW object. To preserve the functionality of reading from a sampler view with integer coordinates, the SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS) but take a SVIEW register instead of a RES register as argument.
* tgsi: Fix conflict with fortify printf redirect in glibc.Johannes Obermayr2012-04-071-17/+17
| | | | | | | | | | | | | | | | Fixes clang error: tgsi/tgsi_dump.c:72:12: error: no member named '__printf_chk' in 'struct dump_ctx' ctx->printf( ctx, "%u", e ); ~~~ ^ /usr/include/bits/stdio2.h:109:3: note: expanded from macro 'printf' __printf_chk (__USE_FORTIFY_LEVEL - 1, __VA_ARGS__) ^ Idea stolen from: http://www.mail-archive.com/[email protected]/msg210998.html Reviewed-by: Brian Paul <[email protected]>
* tgsi: remove trailing comma to silence warningBrian Paul2012-02-271-1/+1
|
* gallivm: Fix TGSI_OPCODE_ARR's translation.José Fonseca2012-02-211-0/+1
| | | | | | | | | | | | | Like TGSI_OPCODE_ARL, destination should be an integer. This fixes invalid LLVM IR on an internal state tracker (currently Mesa never emits this opcode). In the future consider making ADDR register also a integer-as-float array, like all other register kinds, or simply replace ADDR & ARR/ARL with integer temp and instructions. Reviewed-by: Dave Airlie <[email protected]>
* tgsi: add source/destination type from opcodes. (v2)Dave Airlie2012-02-172-0/+112
| | | | | | | | | | | These two functions produce the src/dst types for an opcode. MOV is special since it can be used to mov float->float and int->int, so just return VOID. v2: use a new enum for the opcode type as per Jose's suggestion. Signed-off-by: Dave Airlie <[email protected]>
* gallium: Move duplicated helper macros to tgsi_exec.hTom Stellard2012-01-302-46/+45
|
* gallium: Prefix #defines in tgsi_exec.h with TGSI_Tom Stellard2012-01-302-68/+68
|
* gallium: Unify defines of CHAN_[XYZW] in tgsi_exec.hTom Stellard2012-01-303-248/+241
|
* tgsi: Add output_mode to struct tgsi_opcode_info v2Tom Stellard2012-01-302-162/+201
| | | | | | v2: - Rename output_type to output_mode - Add shorthand definitions for TGSI_OUTPUT_*
* tgsi: add TGSI_TEXTURE_SHADOWCUBEMAPDave Airlie2012-01-113-0/+4
| | | | | | | | This adds support for shadow cubemap texture sampling instructions. This is required for GL 3.0. Signed-off-by: Dave Airlie <[email protected]>
* tgsi: add ISSG supportDave Airlie2012-01-112-0/+15
| | | | | | | This adds integer version of SSG that GLSL 1.30 can produce. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* tgsi_scan: add support to count number of output clip distancesDave Airlie2012-01-112-0/+5
| | | | | | Just add support to the scanner to count the number of clip distances. Signed-off-by: Dave Airlie <[email protected]>
* tgsi/softpipe: add VertexID support.Dave Airlie2012-01-112-5/+11
| | | | | | | | | | This required changing the system value semantics, so we stored a system value per vertex, instance id is the only other system value we currently support, so I span it across the channels. This passes the 3 vertexid-* piglit tests + lots of instanceid tests. Signed-off-by: Dave Airlie <[email protected]>
* gallium: introduce GLSL based interpolation rules. (v2)Dave Airlie2012-01-103-2/+7
| | | | | | | | | | | | This introduces an unspecified interpolation paramter that is only allowed for color semantics, so a specified GLSL interpolation will override the ShadeModel specified interpolation, but not vice-versa. This fixes a lot of the interpolation tests in piglit. v2: rename from unspecified to color Signed-off-by: Dave Airlie <[email protected]>
* Squash-merge branch 'gallium-clip-state'Marek Olšák2012-01-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gallium/auxiliary/tgsi/tgsi_strings.c src/mesa/state_tracker/st_atom_clip.c commit d919791f2742e913173d6b335128e7d4c63c0840 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 17:59:22 2012 +0100 d3d1x: adapt to new clip state commit cfec82bca3fefcdefafca3f4555285ec1d1ae421 Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:16:51 2012 +0100 gallium/docs: update for clip state changes commit c02bfeb81ad9f62041a2285ea6373bbbd602912a Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 14:21:43 2012 +0100 tgsi: add TGSI_PROPERTY_PROHIBIT_UCPS commit d4e0a785a6a23ad2f6819fd72e236acb9750028d Author: Brian Paul <[email protected]> Date: Thu Jan 5 08:30:00 2012 -0700 tgsi: consolidate TGSI string arrays in new tgsi_strings.h There was some duplication between the tgsi_dump.c and tgsi_text.c files. Also use some static assertions to help catch errors when adding new TGSI values. v2: put strings in tgsi_strings.c file instead of the .h file. Reviewed-by: Dave Airlie <[email protected]> commit c28584ce0d8c62bd92c8f140729d344f88a0b3cd Author: Christoph Bumiller <[email protected]> Date: Fri Jan 6 12:48:09 2012 +0100 gallium: extend user_clip_plane_enable to apply to clip distances commit f1d5016c07f786229ed057effbe55fbfd160b019 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 02:39:09 2012 +0100 nvfx: adapt to new clip state commit 6f6fa1c26bd19f797c1996731708e3569c9bfe24 Author: Marek Olšák <[email protected]> Date: Fri Jan 6 01:41:39 2012 +0100 st/mesa: fix DrawPixels with GL_DEPTH_CLAMP commit c86ad730aa1c017788ae88a55f54071bf222be12 Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:51:30 2012 +0100 nv50: adapt to new clip state commit 3a8ae6ac243bae5970729dc4057fe02d992543dc Author: Christoph Bumiller <[email protected]> Date: Tue Jan 3 23:32:36 2012 +0100 nvc0: adapt to new clip state commit 6243a8246997f8d2fcc69ab741a2c2dea080ff11 Author: Marek Olšák <[email protected]> Date: Thu Dec 29 01:32:51 2011 +0100 draw: initalize pt.user.planes in draw_init This fixes a crash in glean/fpexceptions. commit e3056524b19b56d473f4faff84ffa0eb41497408 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:26:55 2011 +0100 svga: adapt to new clip state commit c5bfa8b37d6d489271df457229081d6bbb51b4b7 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:11:51 2011 +0100 r600g: adapt to new clip state commit f11890905362f62627c4a28a8255b76eb7de7df2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 14:10:26 2011 +0100 r300g: adapt to new clip state commit e37465327c79a01112f15f6278d9accc5bf3103f Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:39:16 2011 +0100 draw: adapt to new clip state This adds a regression in the LLVM clipping path. Can anybody see anything wrong with the code? It works for every other case, just glean/fpexceptions crashes when doing the "Infinite clip plane test". commit b474d2b18c72d965eefae4e427c269cba5ce6ba2 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:14:59 2011 +0100 u_blitter: don't save/set/restore clip state commit 9dd240ea91f523a677af45e8d0adb9e661e28602 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 13:11:56 2011 +0100 gallium: don't cso_save/set/restore clip state The enable bits are in the rasterizer state. commit a4f7031179f5f4ad524b34b394214b984ac950f6 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 12:58:55 2011 +0100 gallium: default depth_clip to 1 depth_clip = !depth_clamp commit fe21147a00ab90e549d63fe12ee4625c9c2ffcc3 Author: Marek Olšák <[email protected]> Date: Mon Dec 26 06:14:19 2011 +0100 trace,util: update state logging to new clip state Also dump the other missing flags. commit 2a3b96e84ac872dcc5bc1de049fe76bb58d64b23 Author: Marek Olšák <[email protected]> Date: Sun Dec 25 10:43:43 2011 +0100 st/mesa: adapt to new clip state commit b7b656a42fca19d7c85267f42649a206a85a2c72 Author: Marek Olšák <[email protected]> Date: Sat Dec 17 15:45:19 2011 +0100 gallium: move state enable bits from clip_state to rasterizer_state
* gallium: add an IABS opcode to TGSIBryan Cain2012-01-072-0/+5
| | | | | | This is a necessary operation that is missing from TGSI. Reviewed-by: Brian Paul <[email protected]>
* gallium: add new semantic for clip vertex.Dave Airlie2012-01-071-1/+2
| | | | | | This is to match the gl_ClipVertex output from GLSL 1.20. Signed-off-by: Dave Airlie <[email protected]>
* gallium: add support for clip distancesBryan Cain2012-01-053-10/+37
|
* tgsi: consolidate TGSI string arrays in new tgsi_strings.hBrian Paul2012-01-055-232/+253
| | | | | | | | | | There was some duplication between the tgsi_dump.c and tgsi_text.c files. Also use some static assertions to help catch errors when adding new TGSI values. v2: put strings in tgsi_strings.c file instead of the .h file. Reviewed-by: Dave Airlie <[email protected]>
* tgsi/softpipe: disable FAST_MATHDave Airlie2012-01-031-1/+1
| | | | | | | In the interest of softpipe preferring correctness over speed and passing more piglit tests, set this to off by default. For speed you really want llvmpipe. Signed-off-by: Dave Airlie <[email protected]>
* softpipe: reorder LIT to fix fp-lit-src-equals-dstDave Airlie2011-12-311-8/+8
| | | | | | | This reorders the LIT operation like the r600 one to fix the fp-lit-src-equals-dst piglit test. Signed-off-by: Dave Airlie <[email protected]>
* softpipe: fix shadow1d tests.Dave Airlie2011-12-191-1/+13
| | | | | | | This fixes the piglit glsl-1.10 shadow1D related tests. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* softpipe: fix shadow 2d texture array samplingDave Airlie2011-12-191-1/+10
| | | | | | | | | The 4th texcoord is used in this case for the comparison. This fixes piglit glsl-fs-shadow2DArray* on softpipe. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* softpipe: fix texture sampling from 1D texture arrayDave Airlie2011-12-191-0/+13
| | | | | | | | | This is the first part of a fix to piglit glsl-fs-shadow1DArray also fix the passing of unused r[2] in the normal 1D case. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium: utility helper functions for stream outputMarek Olšák2011-12-152-6/+21
|
* gallium: interface changes necessary to implement transform feedback (v5)Marek Olšák2011-12-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Namely: - EXT_transform_feedback - ARB_transform_feedback2 - ARB_transform_feedback_instanced The old interface was not useful for OpenGL and had to be reworked. This interface was originally designed for OpenGL, but additional changes have been made in order to make st/d3d1x support easier. The most notable change is the stream-out info must be linked with a vertex or geometry shader and cannot be set independently. This is due to limitations of existing hardware (special shader instructions must be used to write into stream-out buffers), and it's also how OpenGL works (stream outputs must be specified prior to linking shaders). Other than that, each stream output buffer has a "view" into it that internally maintains the number of bytes which have been written into it. (one buffer can be bound in several different transform feedback objects in OpenGL, so we must be able to have several views around) The set_stream_output_targets function contains a parameter saying whether new data should be appended or not. Also, the view can optionally be used to provide the vertex count for draw_vbo. Note that the count is supposed to be stored in device memory and the CPU never gets to know its value. OpenGL way | Gallium way ------------------------------------ BeginTF = set_so_targets(append_bitmask = 0) PauseTF = set_so_targets(num_targets = 0) ResumeTF = set_so_targets(append_bitmask = ~0) EndTF = set_so_targets(num_targets = 0) DrawTF = use pipe_draw_info::count_from_stream_output v2: * removed the reset_stream_output_targets function * added a parameter append_bitmask to set_stream_output_targets, each bit specifies whether new data should be appended to each buffer or not. v3: * added PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME for ARB_tfb2, note that the draw-auto subset is always required (for d3d10), only the pause/resume functionality is limited if the CAP is not advertised v4: * update gallium/docs v5: * compactified struct pipe_stream_output_info, updated dump/trace
* gallium: implement ARB_conservative_depthMarek Olšák2011-12-103-0/+22
| | | | This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.
* gallium: add PIPE_SHADER_CAP_OUTPUT_READVadim Girlin2011-11-211-1/+0
| | | | | | | It's intended to indicate whether the driver/hardware supports reading of the values written into shader outputs. Signed-off-by: Vadim Girlin <[email protected]>
* gallium: add TGSI_SEMANTIC_VERTEXIDChristoph Bumiller2011-11-144-0/+6
|
* Remove tgsi_sse2.José Fonseca2011-11-082-3186/+0
| | | | tgsi_exec is simple. llvm is fast. tgsi_sse2 ends up being neither.