mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-24 00:20:01 +00:00
45 lines
834 B
Plaintext
45 lines
834 B
Plaintext
#version 310 es
|
|
|
|
void main()
|
|
{
|
|
int signed_value = 0;
|
|
uint unsigned_value = 0u;
|
|
|
|
ivec3 signed_values = ivec3(0);
|
|
uvec3 unsigned_values = uvec3(0u);
|
|
|
|
{
|
|
int s = bitfieldExtract(signed_value, 5, 20);
|
|
uint u = bitfieldExtract(unsigned_value, 6, 21);
|
|
|
|
s = bitfieldInsert(s, 40, 5, 4);
|
|
u = bitfieldInsert(u, 60u, 5, 4);
|
|
|
|
u = bitfieldReverse(u);
|
|
s = bitfieldReverse(s);
|
|
|
|
int v0 = bitCount(u);
|
|
int v1 = bitCount(s);
|
|
|
|
int v2 = findMSB(u);
|
|
int v3 = findLSB(s);
|
|
}
|
|
|
|
{
|
|
ivec3 s = bitfieldExtract(signed_values, 5, 20);
|
|
uvec3 u = bitfieldExtract(unsigned_values, 6, 21);
|
|
|
|
s = bitfieldInsert(s, ivec3(40), 5, 4);
|
|
u = bitfieldInsert(u, uvec3(60u), 5, 4);
|
|
|
|
u = bitfieldReverse(u);
|
|
s = bitfieldReverse(s);
|
|
|
|
ivec3 v0 = bitCount(u);
|
|
ivec3 v1 = bitCount(s);
|
|
|
|
ivec3 v2 = findMSB(u);
|
|
ivec3 v3 = findLSB(s);
|
|
}
|
|
}
|