summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/tgsi/tgsi_exec.h
Commit message (Collapse)AuthorAgeFilesLines
* tgsi, softpipe: Constify tgsi_sampler in query_lod vfuncKrzesimir Nowak2015-09-111-1/+1
| | | | | | | | | | A followup from previous commit - since all functions called by query_lod take pointers to const sp_sampler_view and const sp_sampler, which are taken from tgsi_sampler subclass, we can the tgsi_sampler as const itself now. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
* tgsi,softpipe: capitalize the tgsi_sampler_control enum valuesBrian Paul2015-09-111-7/+8
| | | | | | | We use capitalized enum values everywhere else. This improves understanding a bit too. Reviewed-by: Roland Scheidegger <sroland@vmware.com>
* tgsi: Add code for handling lodq opcodeKrzesimir Nowak2015-09-101-0/+10
| | | | | | | | | | | | This introduces new vfunc in tgsi_sampler just for this opcode. I decided against extending get_samples vfunc to return the mipmap level and LOD - the function's prototype is already too scary and doing the sampling for textureQueryLod would be a waste of time. v2: - splitted too long lines Reviewed-by: Brian Paul <brianp@vmware.com>
* gallium: replace INLINE with inlineIlia Mirkin2015-07-211-3/+3
| | | | | | | | | | | | | | | | Generated by running: git grep -l INLINE src/gallium/ | xargs sed -i 's/\bINLINE\b/inline/g' git grep -l INLINE src/mesa/state_tracker/ | xargs sed -i 's/\bINLINE\b/inline/g' git checkout src/gallium/state_trackers/clover/Doxyfile and manual edits to src/gallium/include/pipe/p_compiler.h src/gallium/README.portability to remove mentions of the inline define. Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Acked-by: Marek Olšák <marek.olsak@amd.com>
* softpipe,llvmpipe: fix PIPE_SHADER_CAP_MAX_INPUTS valueMarek Olšák2015-06-251-1/+1
| | | | | | | | | | PIPE_MAX_SHADER_INPUTS was recently bumped to 80 because of tessellation. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91099 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91101 Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Roland Scheidegger <sroland@vmware.com>
* tgsi/ureg: don't emit in/out arrays if drivers don't support ranged declarationsMarek Olšák2015-06-051-0/+1
| | | | | | Softpipe, llvmpipe, r300g, and radeonsi pass tests. Other drivers need testing. Freedreno and nv30 are definitely broken. Other drivers seem to be alright.
* tgsi: handle TG4 opcode in tgsi execDave Airlie2015-05-201-1/+2
| | | | | | | This just adds a new modifier interface for drivers to implement. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* gallium: add FMA and DFMA opcodes (v3)Marek Olšák2015-03-161-0/+1
| | | | | | | | | Needed by ARB_gpu_shader5. v2: select DMAD for FMA with double precision v3: add and select DFMA Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* gallium: add shader cap for dldexp/dfracexp supportIlia Mirkin2015-02-191-0/+1
| | | | | Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>
* gallium: add a cap to enable double rounding opcodesIlia Mirkin2015-02-191-0/+2
| | | | | Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu> Reviewed-by: Dave Airlie <airlied@redhat.com>
* softpipe/tgsi: expose doubles for softpipe.Dave Airlie2015-02-201-1/+1
| | | | | Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
* gallium: add PIPE_SHADER_CAP_MAX_OUTPUTS and use it in st/mesaMarek Olšák2014-10-211-0/+2
| | | | | | | | With 5 shader stages and various combinations of enabled and disabled shaders, the maximum number of outputs in one shader doesn't have to be equal to the maximum number of inputs in the following shader. v2: return 32 for softpipe and llvmpipe
* gallium: remove PIPE_SHADER_CAP_MAX_ADDRSMarek Olšák2014-08-111-3/+0
| | | | | | | | | | | | | | | This limit is fixed in Mesa core and cannot be changed. It only affects ARB_vertex_program and ARB_fragment_program. The minimum value for ARB_vertex_program is 1 according to the spec. The maximum value for ARB_vertex_program is limited to 1 by Mesa core. The value should be zero for ARB_fragment_program, because it doesn't support ARL. Finally, drivers shouldn't mess with these values arbitrarily. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
* gallium: rename shader cap MAX_CONSTS to MAX_CONST_BUFFER_SIZEMarek Olšák2014-07-281-4/+4
| | | | | | | | | | This new name isn't so confusing. I also changed the gallivm limit, because it looked wrong. Reviewed-by: Brian Paul <brianp@vmware.com> v2: use sizeof(float[4])
* gallium: Add PIPE_SHADER_CAP_DOUBLESTom Stellard2014-07-021-0/+2
| | | | | | | This is for reporting whether or not double precision floating-point operations are supported. Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* tgsi_exec: use defines for max inputs/outputsDave Airlie2014-06-111-1/+1
| | | | | | | | | This fixes the limits for GL 3.2, and subsequently fixes some segfaults in some varying packing tests and max varying tests after the limits bumped. Reviewed-by: Roland Scheidegger <sroland@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* tgsi/gs: bound max output vertices in shaderDave Airlie2014-06-111-0/+1
| | | | | | | | | This limits the number of emitted vertices to the shaders max output vertices, and avoids us writing things into memory that isn't big enough for it. Reviewed-by: Zack Rusin <zackr@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* tgsi: add missing switch cases in tgsi_exec_get_shader_param()Brian Paul2014-05-071-2/+8
| | | | | | | | Add cases for PIPE_SHADER_CAP_MAX_SAMPLER_VIEWS and PIPE_SHADER_CAP_PREFERRED_IR. Remove default switch case so we learn of missing cases at compile time. Reviewed-by: José Fonseca <jfonseca@vmware.com>
* s/Tungsten Graphics/VMware/José Fonseca2014-01-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tungsten Graphics Inc. was acquired by VMware Inc. in 2008. Leaving the old copyright name is creating unnecessary confusion, hence this change. This was the sed script I used: $ cat tg2vmw.sed # Run as: # # git reset --hard HEAD && find include scons src -type f -not -name 'sed*' -print0 | xargs -0 sed -i -f tg2vmw.sed # # Rename copyrights s/Tungsten Gra\(ph\|hp\)ics,\? [iI]nc\.\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./g /Copyright/s/Tungsten Graphics\(,\? [iI]nc\.\)\?\(, Cedar Park\)\?\(, Austin\)\?\(, \(Texas\|TX\)\)\?\.\?/VMware, Inc./ s/TUNGSTEN GRAPHICS/VMWARE/g # Rename emails s/alanh@tungstengraphics.com/alanh@vmware.com/ s/jens@tungstengraphics.com/jowen@vmware.com/g s/jrfonseca-at-tungstengraphics-dot-com/jfonseca-at-vmware-dot-com/ s/jrfonseca\?@tungstengraphics.com/jfonseca@vmware.com/g s/keithw\?@tungstengraphics.com/keithw@vmware.com/g s/michel@tungstengraphics.com/daenzer@vmware.com/g s/thomas-at-tungstengraphics-dot-com/thellstom-at-vmware-dot-com/ s/zack@tungstengraphics.com/zackr@vmware.com/ # Remove dead links s@Tungsten Graphics (http://www.tungstengraphics.com)@Tungsten Graphics@g # C string src/gallium/state_trackers/vega/api_misc.c s/"Tungsten Graphics, Inc"/"VMware, Inc"/ Reviewed-by: Brian Paul <brianp@vmware.com>
* tgsi: remove TGSI_FILE_(IMMEDIATE|TEMP)_ARRAYChristian König2013-03-191-2/+0
| | | | | | Nobody seems to be using it, and only nv50 had a partial implementation. Signed-off-by: Christian König <christian.koenig@amd.com>
* tgsi: add texel offsets and derivatives to sampler interfaceRoland Scheidegger2013-03-021-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Something I never got around to implement, but this is the tgsi execution side for implementing texel offsets (for ordinary texturing) and explicit derivatives for sampling (though I guess the ordering of the components for the derivs parameters is debatable). There is certainly a runtime cost associated with this. Unless there are different interfaces used depending on the "complexity" of the texture instructions, this is impossible to avoid. Offsets are always active (I think checking if they are active or not is probably not worth it since it should mostly be an add), whereas the sampler_control is extended for explicit derivatives. For now softpipe (the only user of this) just drops all those new values on the floor (which is the part I never implemented...). Additionally this also fixes (discovered by accident) inconsistent projective divide for the comparison coord - the code did do the projection for shadow2d targets, but not shadow1d ones. This also drops checking for projection modifier on array targets, since they aren't possible in any extension I know of (hence we don't actually know if the array layer should also be divided or not). Reviewed-by: Brian Paul <brianp@vmware.com>
* softpipe/draw/tgsi: simplify driver/tgsi sampler interfaceRoland Scheidegger2013-02-281-9/+13
| | | | | | | | | | | | | | | Use a single sampler adapter instead of per-sampler-unit samplers, and just pass along texture unit and sampler unit in the calls. The reason is that for dx10-style sample opcodes pre-wired samplers including all the texture state aren't really feasible (and for sample_i/sviewinfo we don't even have samplers). Of course right now softpipe doesn't actually do anything more than just look up all its pre-wired per-texunit/per-samplerunit sampler as it did before so this doesn't really achieve much except one more function call, however this is now all softpipe's fault (fixing that in a way which doesn't suck is still an unsolved problem). Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
* softpipe: clean up lod computationRoland Scheidegger2013-02-081-6/+8
| | | | | | | | | | | | | | | This should handle the new lod_zero modifier more correctly. The runtime-conditional is a bit more complex however we now also do scalar lod computation when appropriate which should more than make up for it. The refactoring should also fix an issue with explicit lods (lod clamp wasn't applied to them). Also, always pass lod as the 5th element from tgsi executor, which simplifies things (get rid of annoying conditionals later). v2: based on Brian's feedback, use switch in a couple of places, fix up some function parameter names, fix up comments. Reviewed-by: Brian Paul <brianp@vmware.com>
* tgsi: add support for new SQRT opcodeBrian Paul2013-02-041-0/+2
|
* 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 <brianp@vmware.com>
* softpipe: add ARB_texture_cube_map_array support (v1.1)Dave Airlie2012-11-091-0/+13
| | | | | | | | | | | | | 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 <brianp@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* gallium/tgsi: Split sampler views from shader resources.Francisco Jerez2012-05-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* gallium: Move duplicated helper macros to tgsi_exec.hTom Stellard2012-01-301-0/+13
|
* gallium: Prefix #defines in tgsi_exec.h with TGSI_Tom Stellard2012-01-301-18/+18
|
* gallium: Unify defines of CHAN_[XYZW] in tgsi_exec.hTom Stellard2012-01-301-0/+4
|
* tgsi/softpipe: add VertexID support.Dave Airlie2012-01-111-1/+1
| | | | | | | | | | 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 <airlied@redhat.com>
* gallium: introduce GLSL based interpolation rules. (v2)Dave Airlie2012-01-101-1/+1
| | | | | | | | | | | | 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 <airlied@redhat.com>
* gallium: add and use PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERSMarek Olšák2011-09-301-0/+2
| | | | | | | | | This removes: - PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS - PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS in favor of the that new per-shader cap. Reviewed-by: Brian Paul <brianp@vmware.com>
* tgsi: add support for texture offsets to the TGSI IR. (v2)Dave Airlie2011-09-021-1/+2
| | | | | | | | | | | | | This adds tokens for texture offsets, to store 4 * swizzled vec 3 for use in TXF and other opcodes. It also contains TGSI exec changes for softpipe to use this code, along with GLSL->TGSI support for TXF. v2: add some more comments, add back padding I removed. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* tgsi: add TXF support.Dave Airlie2011-08-251-0/+3
| | | | | | | | | | | This is a straight texel fetch with no filtering or clamping. It uses integers to specify the i/j/k (from EXT_gpu_shader4). To enable this I had to add another hook into the tgsi sampler so that we could easily bypass all the filtering sample does. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Brian Paul <brianp@vmware.com>
* tgsi: add TXQ support. (v2)Dave Airlie2011-08-251-0/+2
| | | | | | | | | | this adds another callback in the sampler struct containing get_dims entry point. This is used to query the driver for the texture resource dimensions for the resource bound to the current sampler. v2: remove unusued variable, fix indent Signed-off-by: Dave Airlie <airlied@redhat.com>
* gallium: add PIPE_SHADER_CAP_INTEGERSBryan Cain2011-08-011-0/+2
|
* tgsi: defer allocation of huge inputs/outputs until we have a gsZack Rusin2011-03-021-2/+4
|
* gallium: implement modern sampling schemeZack Rusin2011-01-241-0/+1
| | | | | | | | | | | largely a merge of the previously discussed origin/gallium-resource-sampling but updated. the idea is to allow arbitrary binding of resources, the way opencl, new gl versions and dx10+ require, i.e. DCL RES[0], 2D, FLOAT LOAD DST[0], SRC[0], RES[0] SAMPLE DST[0], SRC[0], RES[0], SAMP[0]
* tgsi: add support for system values to TGSI interpreterBrian Paul2010-12-081-0/+7
|
* gallium: add PIPE_SHADER_CAP_SUBROUTINESMarek Olšák2010-11-221-0/+2
| | | | | | | | | | | This fixes piglit/glsl-vs-main-return and glsl-fs-main-return for the drivers which don't support RET (i915g, r300g, r600g, svga). ir_to_mesa does not currently generate subroutines, but it's a matter of time till it's added. It would then break all the drivers which don't implement them, so this CAP makes sense. Signed-off-by: Marek Olšák <maraeo@gmail.com>
* tgsi: fill out CAPs for indirect addressingMarek Olšák2010-11-121-0/+5
|
* tgsi/exec: Get rid of obsolete condition codes.Michal Krol2010-11-041-23/+4
|
* gallium: introduce get_shader_param (ALL DRIVERS CHANGED) (v3)Luca Barbieri2010-09-141-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes in v3: - Also change trace, which I forgot about Changes in v2: - No longer adds tessellation shaders Currently each shader cap has FS and VS versions. However, we want a version of them for geometry, tessellation control, and tessellation evaluation shaders, and want to be able to easily query a given cap type for a given shader stage. Since having 5 duplicates of each shader cap is unmanageable, add a new get_shader_param function that takes both a shader cap from a new enum and a shader stage. Drivers with non-unified shaders will first switch on the shader and, within each case, switch on the cap. Drivers with unified shaders instead first check whether the shader is supported, and then switch on the cap. MAX_CONST_BUFFERS is now per-stage. The geometry shader cap is removed in favor of checking whether the limit of geometry shader instructions is greater than 0, which is also used for tessellation shaders. WARNING: all drivers changed and compiled but only nvfx tested
* gallium: implement bounds checking for constant buffersBrian Paul2010-07-291-0/+10
| | | | | | Plumb the constant buffer sizes down into the tgsi interpreter where we can do bounds checking. Optional debug code warns upon out-of-bounds reading. Plus add a few other assertions in the TGSI interpreter.
* gallium: add a temporary array register fileZack Rusin2010-06-181-0/+2
| | | | | | | | | | | | | | like normal temporaries, but allows to define a number of distinct arrays, all of which make it explicit that they contain /indexable/ registers. as a side-effect we're adding support for multi-dimensional destination registers. The whole thing looks like this: DCL TEMPX[0][0..128] # 0 array with 128 registers ADD TEMPX[0][0], IN[0], IMM[0] ADD TEMPX[0][1], IN[0], IMM[0] ABS OUT[0], TEMPX[0][TEMP[0]]
* gallium: add a new register file - immediate arrayZack Rusin2010-06-181-0/+2
| | | | | | allows one to specify a safe (bound checked) array filled with immediates. it works just like a const array and declares much like our current immediates.
* softpipe: Adverstise (tgsi_exec's) shader limits.José Fonseca2010-05-121-4/+5
|
* gallium/tgsi: remove unused tgsi_exec_labels codeBrian Paul2010-05-061-13/+0
|
* gallium: Remove loop register file.José Fonseca2010-05-031-4/+0
| | | | | It was only used for D3D's REP/END/BGNFOR/ENDFOR. D3D's aL register is just like another address register now.