summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi
Commit message (Collapse)AuthorAgeFilesLines
* tgsi: Allow TXF from buffers.José Fonseca2012-12-041-0/+1
| | | | | | | There is more work necessary to properly support buffers in shaders, but this gets things a bit further along. Reviewed-by: Brian Paul <[email protected]>
* tgsi: Increase maximum number of temps to 4096.José Fonseca2012-12-041-1/+1
| | | | | | | To match Shader Model 4 limits, as specified in http://msdn.microsoft.com/en-us/library/windows/desktop/ff471378.aspx Reviewed-by: Brian Paul <[email protected]>
* gallivm,llvmpipe: handle TXF (texelFetch) instruction, including offsetsRoland Scheidegger2012-11-271-0/+1
| | | | | | | | | | | | | This also adds some code to handle per-quad lods for more than 4-wide fetches, because otherwise I'd have to integrate the texelFetch function into the splitting stuff... (but it is not used yet outside texelFetch). passes piglit fs-texelFetch-2D, fails fs-texelFetchOffset-2D due to I believe a test error (results are undefined for out-of-bounds fetches, we return whatever is at offset 0, whereas the test expects [0,0,0,1]). Texel offsets are only handled by texelFetch for now, though the interface can handle it for everything. Reviewed-by: José Fonseca <[email protected]>
* tgsi: Lift the requirement of indirection being done by ADDR register.José Fonseca2012-11-091-1/+0
| | | | | | | For drivers with native integer / SM4 support this is just an hindrance. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* softpipe: add ARB_texture_cube_map_array support (v1.1)Dave Airlie2012-11-092-30/+103
| | | | | | | | | | | | | This adds support to the softpipe texture sampler and tgsi exec. In order to handle the extra input to the texture sampling, I've had to expand the interfaces to take a c1 value for storing the texture compare value for the TEX2 case. v1.1: add comments (Brian) Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* gallium: add defines/shader opcode for texture cube map arrayDave Airlie2012-11-093-2/+9
| | | | | | | | | | | | | | | | This just adds the texture target and capability along with 3 new opcodes required to support this extension. As this extension requires some texture opcodes with samp + 5 args, we need to use another src register, this is only required for TEX, TXL and TXB opcodes to implement this spec. TEX2 is required for shadow cube map arrays TXL2 is required for cube map array sampler + explicit lod TXB2 is required for cube map array sampler + lod bias Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* mesa: bump MAX_VARYING to 32Marek Olšák2012-10-291-1/+1
| | | | | | | | | | | | | | | | | We're starting to get apps utilizing more than 16 varyings and most current hardware supports 32 anyway. Tested with r600g. swrast, softpipe and llvmpipe still advertise 16 varyings. This fixes a WebGL crash after launching this demo: https://developer.mozilla.org/en-US/demos/detail/falling-cubes Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54402 NOTE: This is a candidate for the stable branches. Acked-by: Kenneth Graunke <[email protected]>
* tgsi: silence MSVC signed/unsigned comparison warningsBrian Paul2012-10-172-2/+2
| | | | Reviewed-by: Jose Fonseca <[email protected]>
* tgsi: Add support to parse IMM[x] too.José Fonseca2012-10-171-0/+28
| | | | Thanks to Brian for pointing this out.
* tgsi: Dump register number when dumping immediates.José Fonseca2012-10-121-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For example: VERT DCL IN[0] DCL OUT[0], POSITION DCL OUT[1], GENERIC[12] DCL CONST[0..4] DCL TEMP[0], LOCAL DCL TEMP[1], LOCAL IMM[0] UINT32 {4294967295, 0, 0, 0} IMM[1] FLT32 { 0.0000, 1.0000, 0.0000, 0.0000} 0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx 1: F2I TEMP[0].x, -TEMP[0] 2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx 3: F2I TEMP[1].x, -TEMP[1] 4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx 5: IF TEMP[0].xxxx :0 6: MOV TEMP[0], IMM[1].xyxy 7: ELSE :0 8: MOV TEMP[0], IMM[1].yxxy 9: ENDIF 10: MOV OUT[1], TEMP[0] 11: MOV OUT[0], IN[0] 12: END instead of VERT DCL IN[0] DCL OUT[0], POSITION DCL OUT[1], GENERIC[12] DCL CONST[0..4] DCL TEMP[0], LOCAL DCL TEMP[1], LOCAL IMM UINT32 {4294967295, 0, 0, 0} IMM FLT32 { 0.0000, 1.0000, 0.0000, 0.0000} 0: SEQ TEMP[0].x, CONST[3].xxxx, IMM[0].xxxx 1: F2I TEMP[0].x, -TEMP[0] 2: SEQ TEMP[1].x, CONST[4].xxxx, IMM[0].xxxx 3: F2I TEMP[1].x, -TEMP[1] 4: AND TEMP[0].x, TEMP[0].xxxx, TEMP[1].xxxx 5: IF TEMP[0].xxxx :0 6: MOV TEMP[0], IMM[1].xyxy 7: ELSE :0 8: MOV TEMP[0], IMM[1].yxxy 9: ENDIF 10: MOV OUT[1], TEMP[0] 11: MOV OUT[0], IN[0] 12: END
* Remove useless checks for NULL before freeingMatt Turner2012-09-051-16/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Same as earlier commit, except for "FREE" This patch has been generated by the following Coccinelle semantic patch: // Remove useless checks for NULL before freeing // // free (NULL) is a no-op, so there is no need to avoid it @@ expression E; @@ + FREE (E); + E = NULL; - if (unlikely (E != NULL)) { - FREE(E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; type T; @@ + FREE ((T) E); + E = NULL; - if (unlikely (E != NULL)) { - FREE((T) E); ( - E = NULL; | - E = 0; ) ... - } @@ expression E; @@ + FREE (E); - if (unlikely (E != NULL)) { - FREE (E); - } @@ expression E; type T; @@ + FREE ((T) E); - if (unlikely (E != NULL)) { - FREE ((T) E); - } Reviewed-by: Brian Paul <[email protected]>
* tgsi: include u_debug.hBrian Paul2012-09-011-0/+1
|
* gallium: add TGSI support for multisample texturesMarek Olšák2012-08-153-1/+6
| | | | | | | | | | The only allowed instructions are TXQ_LZ and TXF. TXQ_LZ is like TXQ, but without the LOD parameter (which is always zero with MSAA textures) The 3rd or the 4th texcoord component in TXF should contain the sample index for a 2D_MSAA or 2D_ARRAY_MSAA texture, respectively.
* gallium/tgsi: fix TGSI text parserMarek Olšák2012-08-151-77/+97
| | | | | | | | The problem was that the string matching succeeded e.g. for "2D" when there was actually "2D_MSAA" and then failed parsing "_MSAA". To prevent similar failures in the future, let's fix this kind of error everywhere.
* gallium/tgsi: fixup texture name stringsMarek Olšák2012-08-041-4/+4
| | | | Reviewed-by: Brian Paul <[email protected]>
* 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