[Mesa-dev] [PATCH 1/3] ac: Introduce ac_build_expand()
Bas Nieuwenhuizen
bas at basnieuwenhuizen.nl
Fri Oct 19 22:08:18 UTC 2018
On Fri, Oct 19, 2018 at 11:09 PM Marek Olšák <maraeo at gmail.com> wrote:
>
> On Thu, Oct 18, 2018 at 10:13 AM Connor Abbott <cwabbott0 at gmail.com> wrote:
>>
>> And implement ac_bulid_expand_to_vec4() on top of it.
>>
>> Fixes: 7e7ee82698247d8f93fe37775b99f4838b0247dd ("ac: add support for 16bit buffer loads")
>> ---
>> src/amd/common/ac_llvm_build.c | 40 ++++++++++++++++++++++------------
>> src/amd/common/ac_llvm_build.h | 3 +++
>> 2 files changed, 29 insertions(+), 14 deletions(-)
>>
>> diff --git a/src/amd/common/ac_llvm_build.c b/src/amd/common/ac_llvm_build.c
>> index 2d78ca1b52a..c54a50dcd86 100644
>> --- a/src/amd/common/ac_llvm_build.c
>> +++ b/src/amd/common/ac_llvm_build.c
>> @@ -523,39 +523,51 @@ ac_build_gather_values(struct ac_llvm_context *ctx,
>> return ac_build_gather_values_extended(ctx, values, value_count, 1, false, false);
>> }
>>
>> -/* Expand a scalar or vector to <4 x type> by filling the remaining channels
>> - * with undef. Extract at most num_channels components from the input.
>> +/* Expand a scalar or vector to <dst_channels x type> by filling the remaining
>> + * channels with undef. Extract at most src_channels components from the input.
>> */
>> -LLVMValueRef ac_build_expand_to_vec4(struct ac_llvm_context *ctx,
>> - LLVMValueRef value,
>> - unsigned num_channels)
>> +LLVMValueRef ac_build_expand(struct ac_llvm_context *ctx,
>> + LLVMValueRef value,
>> + unsigned src_channels,
>> + unsigned dst_channels)
>> {
>> LLVMTypeRef elemtype;
>> - LLVMValueRef chan[4];
>> + LLVMValueRef chan[dst_channels];
>
>
> That doesn't look like a valid syntax. dst_channel is not a compile-time constant. What was wrong with 4?
Isn't that just c99 variable length arrays?
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
for the series.
>
> Other than that, this patch is:
>
> Reviewed-by: Marek Olšák <marek.olsak at amd.com>
>
> Marek
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list