[Mesa-dev] [PATCH v2 02/25] tgsi: add Stream{X, Y, Z, W} fields to tgsi_declaration_semantic

Nicolai Hähnle nhaehnle at gmail.com
Wed Dec 7 09:54:52 UTC 2016


On 07.12.2016 02:07, Marek Olšák wrote:
> On Tue, Dec 6, 2016 at 11:48 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
>> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>>
>> This is for geometry shader outputs. Without it, drivers have no way of
>> knowing which stream each output is intended for, and have to
>> conservatively write all outputs to all streams.
>>
>> Separate stream numbers for each component are required due to output
>> packing.
>> ---
>>  src/compiler/glsl/ir_print_visitor.cpp     |  4 +--
>>  src/gallium/auxiliary/tgsi/tgsi_build.c    | 18 +++++++++--
>>  src/gallium/auxiliary/tgsi/tgsi_dump.c     | 13 ++++++++
>>  src/gallium/auxiliary/tgsi/tgsi_text.c     | 48 ++++++++++++++++++++++++++++++
>>  src/gallium/include/pipe/p_shader_tokens.h |  5 +++-
>>  5 files changed, 83 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/compiler/glsl/ir_print_visitor.cpp b/src/compiler/glsl/ir_print_visitor.cpp
>> index 2b77c14..d401426 100644
>> --- a/src/compiler/glsl/ir_print_visitor.cpp
>> +++ b/src/compiler/glsl/ir_print_visitor.cpp
>> @@ -173,26 +173,26 @@ void ir_print_visitor::visit(ir_variable *ir)
>>     if (ir->data.location != -1)
>>        snprintf(loc, sizeof(loc), "location=%i ", ir->data.location);
>>
>>     char component[32] = {0};
>>     if (ir->data.explicit_component)
>>        snprintf(component, sizeof(component), "component=%i ", ir->data.location_frac);
>>
>>     char stream[32] = {0};
>>     if (ir->data.stream & (1u << 31)) {
>>        if (ir->data.stream & ~(1u << 31)) {
>> -         snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u)",
>> +         snprintf(stream, sizeof(stream), "stream(%u,%u,%u,%u) ",
>>                    ir->data.stream & 3, (ir->data.stream >> 2) & 3,
>>                    (ir->data.stream >> 4) & 3, (ir->data.stream >> 6) & 3);
>>        }
>>     } else if (ir->data.stream) {
>> -      snprintf(stream, sizeof(stream), "stream%u", ir->data.stream);
>> +      snprintf(stream, sizeof(stream), "stream%u ", ir->data.stream);
>>     }
>>
>>     const char *const cent = (ir->data.centroid) ? "centroid " : "";
>>     const char *const samp = (ir->data.sample) ? "sample " : "";
>>     const char *const patc = (ir->data.patch) ? "patch " : "";
>>     const char *const inv = (ir->data.invariant) ? "invariant " : "";
>>     const char *const prec = (ir->data.precise) ? "precise " : "";
>>     const char *const mode[] = { "", "uniform ", "shader_storage ",
>>                                  "shader_shared ", "shader_in ", "shader_out ",
>>                                  "in ", "out ", "inout ",
>
> Unrelated GLSL changes.

Right, this should have been in patch #1 but I messed up the rebasing 
somehow. I'll fix it.

>
> Marek
>


More information about the mesa-dev mailing list