ac: make use of ac_build_expand_to_vec4() in visit_image_store()
And make ac_build_expand() a static function. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -548,10 +548,11 @@ ac_build_gather_values(struct ac_llvm_context *ctx,
|
|||||||
/* Expand a scalar or vector to <dst_channels x type> by filling the remaining
|
/* 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.
|
* channels with undef. Extract at most src_channels components from the input.
|
||||||
*/
|
*/
|
||||||
LLVMValueRef ac_build_expand(struct ac_llvm_context *ctx,
|
static LLVMValueRef
|
||||||
LLVMValueRef value,
|
ac_build_expand(struct ac_llvm_context *ctx,
|
||||||
unsigned src_channels,
|
LLVMValueRef value,
|
||||||
unsigned dst_channels)
|
unsigned src_channels,
|
||||||
|
unsigned dst_channels)
|
||||||
{
|
{
|
||||||
LLVMTypeRef elemtype;
|
LLVMTypeRef elemtype;
|
||||||
LLVMValueRef chan[dst_channels];
|
LLVMValueRef chan[dst_channels];
|
||||||
|
@@ -171,9 +171,6 @@ LLVMValueRef
|
|||||||
ac_build_gather_values(struct ac_llvm_context *ctx,
|
ac_build_gather_values(struct ac_llvm_context *ctx,
|
||||||
LLVMValueRef *values,
|
LLVMValueRef *values,
|
||||||
unsigned value_count);
|
unsigned value_count);
|
||||||
LLVMValueRef ac_build_expand(struct ac_llvm_context *ctx,
|
|
||||||
LLVMValueRef value,
|
|
||||||
unsigned src_channels, unsigned dst_channels);
|
|
||||||
LLVMValueRef ac_build_expand_to_vec4(struct ac_llvm_context *ctx,
|
LLVMValueRef ac_build_expand_to_vec4(struct ac_llvm_context *ctx,
|
||||||
LLVMValueRef value,
|
LLVMValueRef value,
|
||||||
unsigned num_channels);
|
unsigned num_channels);
|
||||||
|
@@ -2508,7 +2508,7 @@ static void visit_image_store(struct ac_nir_context *ctx,
|
|||||||
unsigned src_channels = ac_get_llvm_num_components(src);
|
unsigned src_channels = ac_get_llvm_num_components(src);
|
||||||
|
|
||||||
if (src_channels == 3)
|
if (src_channels == 3)
|
||||||
src = ac_build_expand(&ctx->ac, src, 3, 4);
|
src = ac_build_expand_to_vec4(&ctx->ac, src, 3);
|
||||||
|
|
||||||
params[0] = src; /* data */
|
params[0] = src; /* data */
|
||||||
params[1] = rsrc;
|
params[1] = rsrc;
|
||||||
|
Reference in New Issue
Block a user