Commit Graph

45 Commits

Author SHA1 Message Date
Michal Krol
c59eda0993 gallium: Add more integer TGSI opcodes. 2010-01-05 09:26:43 +01:00
Zack Rusin
fb0a9aa5e0 gallium: remove TGSI_SEMANTIC_VERTICES
it's a leftover from an early version of geometry shading support.
geometry shaders now encode the primitive size in the PROPERTY token
and don't need special input with their size.
2009-12-25 05:52:20 -05:00
Zack Rusin
89d8577fb3 gallium: add geometry shader support to gallium 2009-12-25 05:52:16 -05:00
Roland Scheidegger
35e8283c69 Merge branch 'gallium-edgeflags'
Conflicts:
	src/mesa/state_tracker/st_draw.c
2009-12-22 20:54:26 +01:00
Zack Rusin
3ff688ea29 tgsi: add properties and system value register
adds support for properties to all parts of the tgsi framework, plus
introduces a new register which will be used for system generated
values.
2009-12-14 16:35:09 -05:00
Keith Whitwell
a08e348a84 gallium: first steps to treat edgeflags as regular vertex element
The idea here is to eliminate the set_edgeflags() call in pipe_context
by treating edgeflags as a regular vertex element.

Edgeflags provoke special treatment in hardware, which means we need to
label them in some way, in this case we'll be passing them through the
vertex shader and labelling the vertex shader output with a new TGSI
semantic (TGSI_SEMANTIC_EDGEFLAG).
2009-12-09 19:03:10 +01:00
Michal Krol
5455e88f1c gallium: Remove tgsi_version token.
Not really needed, never served its purpose.
2009-11-27 09:19:01 +01:00
Keith Whitwell
763426a025 tgsi: reduce repetition of structure name in its members
Rename Semantic.SemanticName to Semantic.Name.  Similar for
SemanticIndex, and the members of the tgsi_version struct.
2009-11-24 14:53:29 +00:00
Keith Whitwell
ba1ca28cc6 gallium: simplify tgsi tokens further
Drop anonymous 'Extended' fields, have every optional token named
explicitly in its parent.  Eg. there is now an Instruction.Label flag,
etc.

Drop destination modifiers and other functionality which cannot be
generated by tgsi_ureg.c, which is now the primary way of creating
shaders.

Pull source modifiers into the source register token, drop the second
negate flag.  The source register token is now full - if we need to
expand it, probably best to move all of the modifiers to a new token
and have a single flag for it.
2009-11-24 13:41:03 +00:00
Michal Krol
57221c5438 gallium: Refactor the instruction predicate TGSI token.
Rename it to tgsi_instruction_predicate -- it's no longer an extended
token. Its presence is indicated by a new flag in tgsi_instruction that
indicates whether an instruction is predicated.

Also, change predicate index representation to match the other
tokens that specify register indices.
2009-11-24 09:05:26 +01:00
Michal Krol
0a7d50ed7e gallium: Cleanup predicate and condition code TGSI tokens.
There is little point in having a special TGSI token just to handle
predicate register updates. Remove tgsi_dst_register_ext_predicate token
and instead use a new PREDICATE register file to update predicates.
Actually, the contents of the obsolete token are being moved
to tgsi_instruction_ext_predicate, where they should be
from the very beginning.

Remove the NVIDIA-specific condition code tokens -- nobody uses them
and they can be emulated with predicates if needed.

Introduce PIPE_CAP_SM3 that indicates whether a driver supports
SM3-level instructions, and in particular predicates.

Add PIPE_CAP_MAX_PREDICATE_REGISTERS that can be used to query the driver
how many predicate registers it supports (currently it would be 1).
2009-11-02 09:44:18 +00:00
Keith Whitwell
da253319f9 gallium: remove extended negate also, and also the ExtSwz token
Likewise, the extended negate functionality hasn't been
used since mesa switched to using tgsi_ureg to build programs,
and has been translating the SWZ opcode internally to a single MAD.
2009-10-23 14:50:02 +01:00
Keith Whitwell
b9cb74c7f8 gallium: remove the swizzling parts of ExtSwizzle
These haven't been used by the mesa state tracker since the
conversion to tgsi_ureg, and it seems that none of the
other state trackers are using it either.

This helps simplify one of the biggest suprises when starting off with
TGSI shaders.
2009-10-23 14:31:24 +01:00
Keith Whitwell
4e1d51786e gallium: remove noise opcodes
Provide a dummy implementation in the GL state tracker (move 0.5 to
the destination regs).

At some point, a motivated person could add a better
implementation of noise.  Currently not even the nvidia
binary drivers do anything more than this.  In any case, the
place to do this is in the GL state tracker, not the poor
driver.
2009-10-23 13:56:07 +01:00
Keith Whitwell
b3f4b56a3b tgsi: remove redundant CND0 opcode
Can be implemented with CMP src2, src1, src0
2009-09-01 17:30:01 +01:00
Michal Krol
cb90c43676 Rename TGSI LOOP instruction to better match theri usage.
The LOOP/ENDLOOP pair is renamed to BGNFOR/ENDFOR as its behaviour
is similar to a C language for-loop.

The BGNLOOP2/ENDLOOP2 pair is renamed to BGNLOOP/ENDLOOP as now
there is no name collision.
2009-07-31 18:14:40 +02:00
Michal Krol
cf8907018e tgsi: Declare a LOOP register.
The only valid usage for LOOP/ENDLOOP instructions
is LOOP[0] as a destination register.
The only valid usage for the remaining instructions
is LOOP[0].x as an indirect register.
2009-07-30 10:34:06 +02:00
Keith Whitwell
d0d98f3ecf gallium: clean up opcode definitions
Remove commented-out opcodes.  Remove information about API mappings
to opcodes, but add a reference to tgsi-instruction-set.txt where
that information is better presented.
2009-07-23 14:39:07 +01:00
Keith Whitwell
78379abcbf gallium: remove deprecated TGSI opcodes
Various opcodes which can be implemented trivially with other TGSI opcodes,
such as matrix multiplication and negation.  These were not used by any
state tracker or implemented by any of the drivers.
2009-07-23 14:38:26 +01:00
Keith Whitwell
ede9f3b52e gallium: remove multiple aliases for TGSI opcodes
This is a source of ongoing confusion.  TGSI has multiple names for
opcodes where the same semantics originate in multiple shader APIs.

For instance, TGSI includes both Mesa/GLSL and DX/SM30 names for
opcodes with the same semantics, but aliases those names to the same
underlying opcode number.

This makes it very difficult to visually inspect two sets of opcodes
(eg in state tracker & driver) and check if they implement the same
functionality.

This patch arbitarily rips out the versions of the opcodes not currently
favoured by the mesa state tracker and leaves us with a single name
for each distinct operation.
2009-07-22 12:42:09 +01:00
Keith Whitwell
fd31f92cea gallium: simplify tgsi_full_immediate struct
Remove the need to have a pointer in this struct by just including
the immediate data inline.  Having a pointer in the struct introduces
complications like needing to alloc/free the data pointed to, uncertainty
about who owns the data, etc.  There doesn't seem to be a need for it,
and it is unlikely to make much difference plus or minus to performance.

Added some asserts as we now will trip up on immediates with more
than four elements.  There were actually already quite a few such asserts,
but the >4 case could be used in the future to specify indexable immediate
ranges, such as lookup tables.
2009-07-22 12:42:09 +01:00
Zack Rusin
1c04731b87 gallium: fix the front face semantics
mesa allocates both frontface and pointcoord registers within the fog
coordinate register, by using swizzling. to make it cleaner and easier
for drivers we want each of them in its own register. so when doing
compilation from the mesa IR to tgsi allocate new registers for both
and add new semantics to the respective declarations.
2009-07-01 10:45:55 -04:00
Michal Krol
fb88908f5c tgsi: Consider INDEX, NEGATE, MULTIPLYMATRIX opcodes for removal. 2009-03-10 10:27:24 +01:00
Michal Krol
bf3930453c gallium: Rename Size member of TGSI token to NrTokens.
Driver writers often got confused and assumed Size to be
the number of immediate values in Immediate declaration.
2009-02-10 15:12:34 +01:00
Brian Paul
868c607c17 tgsi: doxygen comments 2008-11-24 13:11:05 -07:00
Brian Paul
434e255eae tgsi: add tgsi_declaration fields for centroid sampling, invariant optimization 2008-11-24 13:11:05 -07:00
José Fonseca
984a7c4e9c gallium: Fix doxygen comments. 2008-09-19 10:40:42 +09:00
Michal Krol
146a0fba00 gallium: Add note about vs_2_0 EXPP mapping. 2008-08-19 15:32:09 +02:00
Michal Krol
235981d871 gallium: Remove TGSI_CC_UN. 2008-08-18 17:49:01 +02:00
Michal Krol
9804ab9acc gallium: Make a note that OPCODE_KIL is a conditional kill.
Map OPCODE_TEXKILL to OPCODE_KIL.
2008-08-13 09:15:27 +02:00
Michal Krol
f5c51ebd2a tgsi: Parse destination operand modulate modifier. 2008-07-13 15:23:14 +02:00
Michal Krol
3d5dcc2203 tgsi: Parse texture instructions correctly. 2008-07-13 13:17:41 +02:00
Michal Krol
bd3b47590e tgsi: Remove depricated ATTRIB interpolate mode. 2008-07-13 13:17:30 +02:00
Michal Krol
837d49a84e gallium: The SWZ opcode no longer aliases MOV.
Also, when the extended swizzle token is used, the simple swizzle
and negate are set to X,Y,Z,W and FALSE, respectively.
2008-06-02 11:34:56 +02:00
Michal Krol
4e33edfd06 gallium: Refactor TGSI decalaration tokens.
* Incorporate declaration_interpolation into declaration itself.
* Remove declaration_mask -- always use declaration_range.
2008-05-31 18:56:20 +02:00
Michal Krol
bcb454e7a6 tgsi: Drop pre-ps_2_0 opcodes. 2008-03-13 18:12:36 +01:00
Michal Krol
78ddfbd130 tgsi: Remove OPCODE_TEXCOORD, OPCODE_TEXCRD aliases. 2008-03-13 13:00:44 +01:00
Michal Krol
ba75e82b6e tgsi: Remove ExtDivide field from existence. Implement OPCODE_TXP. 2008-03-12 16:41:25 +01:00
Michal Krol
70ae7f09c7 tgsi: Introduce OPCODE_TXP. Depricate ExdDivide field. 2008-03-12 14:55:18 +01:00
Michal Krol
130b315454 tgsi: Map OPCODE_TEXKILL to OPCODE_KILP. 2008-03-11 23:22:34 +01:00
Zack Rusin
e884c7ed9a start implementing start of bultins 2008-03-01 15:28:00 -05:00
José Fonseca
94c73d1bb9 gallium: Remove // comments. 2008-02-27 16:23:50 +09:00
Brian
35ca45daba gallium: added TGSI_FILE_COUNT 2008-02-23 16:15:54 -07:00
Keith Whitwell
4339744c16 [PATCH] gallium: include p_compiler.h for boolean defn 2008-02-21 19:17:27 +00:00
José Fonseca
b642730be9 Code reorganization: move files into their places.
This is in a separate commit to ensure renames are properly preserved.
2008-02-15 17:45:40 +09:00