[Mesa-dev] TGSI and Tessellation Control Shader outputs

Roland Scheidegger sroland at vmware.com
Tue Sep 16 10:24:57 PDT 2014


Am 16.09.2014 18:29, schrieb Marek Olšák:
> On Tue, Sep 16, 2014 at 5:42 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
>> OK, so just to summarize:
>>
>> The approach suggested by Roland is to have the outputs be
>> one-dimensional and only representing the current invocation's
>> per-vertex outputs. Each invocation would also get access to other
>> invocations' per-vertex outputs via a 2d input array.
>>
>> So a shader might look something like
>>
>> TESSC
>> DECL IN[][0], POSITION (input patch's per-vertex position)
>> DECL IN[][1], GENERIC (input patch's per-vertex generic attribute)
>> DECL IN[][2], TCS_POSITION (output patch's per-vertex position)
>> DECL IN[][3], TCS_OUTPUT (output patch's per-vertex generic attribute)
>> DECL OUT[0], POSITION
>> DECL OUT[1], GENERIC
>> DECL OUT[2], PATCH
>>
>> And then anything written to OUT[0] would be aliased via IN[][2].
>> Roland, does that sound right? This seems kinda nasty that there are
>> going to be 2 types of position/pointsize/clipdistance inputs -- do
>> you have a better suggestion for handling that?
> 
> The output-as-input arrays can be declared as system values (SV), then
> you don't need to duplicate semantic names.
> 
> Marek
> 

system values in d3d10 parlance are something which are either consumed
or generated by the system (not some other shader stage), which isn't
the case here.
Though, I'm not sure what the problem is with having the same semantic
name - we always had position semantic for both inputs and outputs, and
while it was true that both had the same dimensionality they certainly
weren't referring to the same data. So now it's just yet another input,
this time being 2d, which also has the same semantic name. Something
similar is true for generic inputs as well - in geometry shaders these
were already 2d whereas in other shaders they were 1d. Semantic names
don't have much meaning for the most part.
That said, I agree with Marek - as long as it looks reasonable probably
any representation is ok.

Roland



More information about the mesa-dev mailing list