mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 13:20:14 +01:00
gallivm: add support for R8G8_R8B8 and G8R8_B8R8 formats
Just to keep lp_test_format happy. Signed-off-by: Christian König <deathsimple@vodafone.de>
This commit is contained in:
parent
4f41f8edb3
commit
461c34c0cb
1 changed files with 42 additions and 0 deletions
|
|
@ -398,6 +398,42 @@ grgb_to_rgba_aos(struct gallivm_state *gallivm,
|
|||
return rgba;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert from <n x i32> packed GR_BR to <4n x i8> RGBA AoS
|
||||
*/
|
||||
static LLVMValueRef
|
||||
grbr_to_rgba_aos(struct gallivm_state *gallivm,
|
||||
unsigned n,
|
||||
LLVMValueRef packed,
|
||||
LLVMValueRef i)
|
||||
{
|
||||
LLVMValueRef r, g, b;
|
||||
LLVMValueRef rgba;
|
||||
|
||||
uyvy_to_yuv_soa(gallivm, n, packed, i, &r, &g, &b);
|
||||
rgba = rgb_to_rgba_aos(gallivm, n, r, g, b);
|
||||
|
||||
return rgba;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert from <n x i32> packed RG_RB to <4n x i8> RGBA AoS
|
||||
*/
|
||||
static LLVMValueRef
|
||||
rgrb_to_rgba_aos(struct gallivm_state *gallivm,
|
||||
unsigned n,
|
||||
LLVMValueRef packed,
|
||||
LLVMValueRef i)
|
||||
{
|
||||
LLVMValueRef r, g, b;
|
||||
LLVMValueRef rgba;
|
||||
|
||||
yuyv_to_yuv_soa(gallivm, n, packed, i, &r, &g, &b);
|
||||
rgba = rgb_to_rgba_aos(gallivm, n, r, g, b);
|
||||
|
||||
return rgba;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param n is the number of pixels processed
|
||||
|
|
@ -439,6 +475,12 @@ lp_build_fetch_subsampled_rgba_aos(struct gallivm_state *gallivm,
|
|||
case PIPE_FORMAT_G8R8_G8B8_UNORM:
|
||||
rgba = grgb_to_rgba_aos(gallivm, n, packed, i);
|
||||
break;
|
||||
case PIPE_FORMAT_G8R8_B8R8_UNORM:
|
||||
rgba = grbr_to_rgba_aos(gallivm, n, packed, i);
|
||||
break;
|
||||
case PIPE_FORMAT_R8G8_R8B8_UNORM:
|
||||
rgba = rgrb_to_rgba_aos(gallivm, n, packed, i);
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
rgba = LLVMGetUndef(LLVMVectorType(LLVMInt8TypeInContext(gallivm->context), 4*n));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue