Checkin new types for RS.

Change-Id: I3d7a1a91c45cc1c97c60f3615f32e54e98e12f91
This commit is contained in:
Jason Sams
2010-03-26 15:33:42 -07:00
parent c1d726c2d6
commit a70f416c9c
23 changed files with 945 additions and 217 deletions

View File

@@ -76,10 +76,30 @@ public class Allocation extends BaseObj {
subData1D(0, mType.getElementCount(), d);
}
public void subData(int off, FieldPacker fp) {
int eSize = mType.mElement.getSizeBytes();
final byte[] data = fp.getData();
int count = data.length / eSize;
if ((eSize * count) != data.length) {
throw new IllegalArgumentException("Field packer length " + data.length +
" not divisible by element size " + eSize + ".");
}
data1DChecks(off, count, data.length, data.length);
mRS.nAllocationSubData1D(mID, off, count, data, data.length);
}
private void data1DChecks(int off, int count, int len, int dataSize) {
mRS.validate();
if((off < 0) || (count < 1) || ((off + count) > mType.getElementCount())) {
throw new IllegalArgumentException("Offset or Count out of bounds.");
if(off < 0) {
throw new IllegalArgumentException("Offset must be >= 0.");
}
if(count < 1) {
throw new IllegalArgumentException("Count must be >= 1.");
}
if((off + count) > mType.getElementCount()) {
throw new IllegalArgumentException("Overflow, Available count " + mType.getElementCount() +
", got " + count + " at offset " + off + ".");
}
if((len) < dataSize) {
throw new IllegalArgumentException("Array too small for allocation type.");

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Byte2 {
public Byte2() {
}
public byte x;
public byte y;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Byte3 {
public Byte3() {
}
public byte x;
public byte y;
public byte z;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Byte4 {
public Byte4() {
}
public byte x;
public byte y;
public byte z;
public byte w;
}

View File

@@ -126,6 +126,77 @@ public class Element extends BaseObj {
return rs.mElement_USER_F32;
}
public static Element USER_ELEMENT(RenderScript rs) {
if(rs.mElement_USER_ELEMENT == null) {
rs.mElement_USER_ELEMENT = createUser(rs, DataType.RS_ELEMENT);
}
return rs.mElement_USER_ELEMENT;
}
public static Element USER_TYPE(RenderScript rs) {
if(rs.mElement_USER_TYPE == null) {
rs.mElement_USER_TYPE = createUser(rs, DataType.RS_TYPE);
}
return rs.mElement_USER_TYPE;
}
public static Element USER_ALLOCATION(RenderScript rs) {
if(rs.mElement_USER_ALLOCATION == null) {
rs.mElement_USER_ALLOCATION = createUser(rs, DataType.RS_ALLOCATION);
}
return rs.mElement_USER_ALLOCATION;
}
public static Element USER_SAMPLER(RenderScript rs) {
if(rs.mElement_USER_SAMPLER == null) {
rs.mElement_USER_SAMPLER = createUser(rs, DataType.RS_SAMPLER);
}
return rs.mElement_USER_SAMPLER;
}
public static Element USER_SCRIPT(RenderScript rs) {
if(rs.mElement_USER_SCRIPT == null) {
rs.mElement_USER_SCRIPT = createUser(rs, DataType.RS_SCRIPT);
}
return rs.mElement_USER_SCRIPT;
}
public static Element USER_MESH(RenderScript rs) {
if(rs.mElement_USER_MESH == null) {
rs.mElement_USER_MESH = createUser(rs, DataType.RS_MESH);
}
return rs.mElement_USER_MESH;
}
public static Element USER_PROGRAM_FRAGMENT(RenderScript rs) {
if(rs.mElement_USER_PROGRAM_FRAGMENT == null) {
rs.mElement_USER_PROGRAM_FRAGMENT = createUser(rs, DataType.RS_PROGRAM_FRAGMENT);
}
return rs.mElement_USER_PROGRAM_FRAGMENT;
}
public static Element USER_PROGRAM_VERTEX(RenderScript rs) {
if(rs.mElement_USER_PROGRAM_VERTEX == null) {
rs.mElement_USER_PROGRAM_VERTEX = createUser(rs, DataType.RS_PROGRAM_VERTEX);
}
return rs.mElement_USER_PROGRAM_VERTEX;
}
public static Element USER_PROGRAM_RASTER(RenderScript rs) {
if(rs.mElement_USER_PROGRAM_RASTER == null) {
rs.mElement_USER_PROGRAM_RASTER = createUser(rs, DataType.RS_PROGRAM_RASTER);
}
return rs.mElement_USER_PROGRAM_RASTER;
}
public static Element USER_PROGRAM_STORE(RenderScript rs) {
if(rs.mElement_USER_PROGRAM_STORE == null) {
rs.mElement_USER_PROGRAM_STORE = createUser(rs, DataType.RS_PROGRAM_STORE);
}
return rs.mElement_USER_PROGRAM_STORE;
}
public static Element A_8(RenderScript rs) {
if(rs.mElement_A_8 == null) {
rs.mElement_A_8 = createPixel(rs, DataType.UNSIGNED_8, DataKind.PIXEL_A);

View File

@@ -33,21 +33,24 @@ public class FieldPacker {
}
}
void reset() {
public void reset() {
mPos = 0;
}
public void reset(int i) {
mPos = i;
}
void addI8(byte v) {
public void addI8(byte v) {
mData[mPos++] = v;
}
void addI16(short v) {
public void addI16(short v) {
align(2);
mData[mPos++] = (byte)(v & 0xff);
mData[mPos++] = (byte)(v >> 8);
}
void addI32(int v) {
public void addI32(int v) {
align(4);
mData[mPos++] = (byte)(v & 0xff);
mData[mPos++] = (byte)((v >> 8) & 0xff);
@@ -55,7 +58,7 @@ public class FieldPacker {
mData[mPos++] = (byte)((v >> 24) & 0xff);
}
void addI64(long v) {
public void addI64(long v) {
align(8);
mData[mPos++] = (byte)(v & 0xff);
mData[mPos++] = (byte)((v >> 8) & 0xff);
@@ -67,14 +70,14 @@ public class FieldPacker {
mData[mPos++] = (byte)((v >> 56) & 0xff);
}
void addU8(short v) {
public void addU8(short v) {
if ((v < 0) || (v > 0xff)) {
throw new IllegalArgumentException("Saving value out of range for type");
}
mData[mPos++] = (byte)v;
}
void addU16(int v) {
public void addU16(int v) {
if ((v < 0) || (v > 0xffff)) {
throw new IllegalArgumentException("Saving value out of range for type");
}
@@ -83,7 +86,7 @@ public class FieldPacker {
mData[mPos++] = (byte)(v >> 8);
}
void addU32(long v) {
public void addU32(long v) {
if ((v < 0) || (v > 0xffffffff)) {
throw new IllegalArgumentException("Saving value out of range for type");
}
@@ -94,7 +97,7 @@ public class FieldPacker {
mData[mPos++] = (byte)((v >> 24) & 0xff);
}
void addU64(long v) {
public void addU64(long v) {
if (v < 0) {
throw new IllegalArgumentException("Saving value out of range for type");
}
@@ -109,15 +112,135 @@ public class FieldPacker {
mData[mPos++] = (byte)((v >> 56) & 0xff);
}
void addF32(float v) {
public void addF32(float v) {
addI32(Float.floatToRawIntBits(v));
}
void addF64(float v) {
public void addF64(float v) {
addI64(Double.doubleToRawLongBits(v));
}
final byte[] getData() {
public void addObj(BaseObj obj) {
if (obj != null) {
addI32(obj.getID());
} else {
addI32(0);
}
}
public void addF32(Float2 v) {
addF32(v.x);
addF32(v.y);
}
public void addF32(Float3 v) {
addF32(v.x);
addF32(v.y);
addF32(v.z);
}
public void addF32(Float4 v) {
addF32(v.x);
addF32(v.y);
addF32(v.z);
addF32(v.w);
}
public void addI8(Byte2 v) {
addI8(v.x);
addI8(v.y);
}
public void addI8(Byte3 v) {
addI8(v.x);
addI8(v.y);
addI8(v.z);
}
public void addI8(Byte4 v) {
addI8(v.x);
addI8(v.y);
addI8(v.z);
addI8(v.w);
}
public void addU8(Short2 v) {
addU8(v.x);
addU8(v.y);
}
public void addU8(Short3 v) {
addU8(v.x);
addU8(v.y);
addU8(v.z);
}
public void addU8(Short4 v) {
addU8(v.x);
addU8(v.y);
addU8(v.z);
addU8(v.w);
}
public void addI16(Short2 v) {
addI16(v.x);
addI16(v.y);
}
public void addI16(Short3 v) {
addI16(v.x);
addI16(v.y);
addI16(v.z);
}
public void addI16(Short4 v) {
addI16(v.x);
addI16(v.y);
addI16(v.z);
addI16(v.w);
}
public void addU16(Int2 v) {
addU16(v.x);
addU16(v.y);
}
public void addU16(Int3 v) {
addU16(v.x);
addU16(v.y);
addU16(v.z);
}
public void addU16(Int4 v) {
addU16(v.x);
addU16(v.y);
addU16(v.z);
addU16(v.w);
}
public void addI32(Int2 v) {
addI32(v.x);
addI32(v.y);
}
public void addI32(Int3 v) {
addI32(v.x);
addI32(v.y);
addI32(v.z);
}
public void addI32(Int4 v) {
addI32(v.x);
addI32(v.y);
addI32(v.z);
addI32(v.w);
}
public void addU32(Int2 v) {
addU32(v.x);
addU32(v.y);
}
public void addU32(Int3 v) {
addU32(v.x);
addU32(v.y);
addU32(v.z);
}
public void addU32(Int4 v) {
addU32(v.x);
addU32(v.y);
addU32(v.z);
addU32(v.w);
}
public final byte[] getData() {
return mData;
}

View File

@@ -24,8 +24,8 @@ import android.util.Log;
* @hide
*
**/
public class Vector2f {
public Vector2f() {
public class Float2 {
public Float2() {
}
public float x;

View File

@@ -24,8 +24,8 @@ import android.util.Log;
* @hide
*
**/
public class Vector3f {
public Vector3f() {
public class Float3 {
public Float3() {
}
public float x;

View File

@@ -24,8 +24,8 @@ import android.util.Log;
* @hide
*
**/
public class Vector4f {
public Vector4f() {
public class Float4 {
public Float4() {
}
public float x;

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Int2 {
public Int2() {
}
public int x;
public int y;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Int3 {
public Int3() {
}
public int x;
public int y;
public int z;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Int4 {
public Int4() {
}
public int x;
public int y;
public int z;
public int w;
}

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Long2 {
public Long2() {
}
public long x;
public long y;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Long3 {
public Long3() {
}
public long x;
public long y;
public long z;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Long4 {
public Long4() {
}
public long x;
public long y;
public long z;
public long w;
}

View File

@@ -203,6 +203,17 @@ public class RenderScript {
Element mElement_USER_I32;
Element mElement_USER_F32;
Element mElement_USER_ELEMENT;
Element mElement_USER_TYPE;
Element mElement_USER_ALLOCATION;
Element mElement_USER_SAMPLER;
Element mElement_USER_SCRIPT;
Element mElement_USER_MESH;
Element mElement_USER_PROGRAM_FRAGMENT;
Element mElement_USER_PROGRAM_VERTEX;
Element mElement_USER_PROGRAM_RASTER;
Element mElement_USER_PROGRAM_STORE;
Element mElement_A_8;
Element mElement_RGB_565;
Element mElement_RGB_888;

View File

@@ -0,0 +1,37 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Short2 {
public Short2() {
}
public short x;
public short y;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Short3 {
public Short3() {
}
public short x;
public short y;
public short z;
}

View File

@@ -0,0 +1,38 @@
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.renderscript;
import java.lang.Math;
import android.util.Log;
/**
* @hide
*
**/
public class Short4 {
public Short4() {
}
public short x;
public short y;
public short z;
public short w;
}

View File

@@ -0,0 +1,26 @@
extern float3 __attribute__((overloadable)) cross(float3, float3);
extern float4 __attribute__((overloadable)) cross(float4, float4);
//extern float __attribute__((overloadable)) dot(float, float);
extern float __attribute__((overloadable)) dot(float2, float2);
extern float __attribute__((overloadable)) dot(float3, float3);
extern float __attribute__((overloadable)) dot(float4, float4);
//extern float __attribute__((overloadable)) distance(float, float);
extern float __attribute__((overloadable)) distance(float2, float2);
extern float __attribute__((overloadable)) distance(float3, float3);
extern float __attribute__((overloadable)) distance(float4, float4);
//extern float __attribute__((overloadable)) length(float);
extern float __attribute__((overloadable)) length(float2);
extern float __attribute__((overloadable)) length(float3);
extern float __attribute__((overloadable)) length(float4);
extern float2 __attribute__((overloadable)) normalize(float2);
extern float3 __attribute__((overloadable)) normalize(float3);
extern float4 __attribute__((overloadable)) normalize(float4);

View File

@@ -1,5 +1,7 @@
extern float rand(float max);
extern float2 vec2Rand(float len);
extern float3 float3Norm(float3);

View File

@@ -1,264 +1,262 @@
// Float ops
extern float __attribute__((overloadable)) abs(float);
extern float2 __attribute__((overloadable)) abs(float2);
extern float3 __attribute__((overloadable)) abs(float3);
extern float4 __attribute__((overloadable)) abs(float4);
extern float8 __attribute__((overloadable)) abs(float8);
extern float16 __attribute__((overloadable)) abs(float16);
//extern float2 __attribute__((overloadable)) abs(float2);
//extern float3 __attribute__((overloadable)) abs(float3);
//extern float4 __attribute__((overloadable)) abs(float4);
//extern float8 __attribute__((overloadable)) abs(float8);
//extern float16 __attribute__((overloadable)) abs(float16);
extern float __attribute__((overloadable)) acos(float);
extern float2 __attribute__((overloadable)) acos(float2);
extern float3 __attribute__((overloadable)) acos(float3);
extern float4 __attribute__((overloadable)) acos(float4);
extern float8 __attribute__((overloadable)) acos(float8);
extern float16 __attribute__((overloadable)) acos(float16);
//extern float2 __attribute__((overloadable)) acos(float2);
//extern float3 __attribute__((overloadable)) acos(float3);
//extern float4 __attribute__((overloadable)) acos(float4);
//extern float8 __attribute__((overloadable)) acos(float8);
//extern float16 __attribute__((overloadable)) acos(float16);
extern float __attribute__((overloadable)) asin(float);
extern float2 __attribute__((overloadable)) asin(float2);
extern float3 __attribute__((overloadable)) asin(float3);
extern float4 __attribute__((overloadable)) asin(float4);
extern float8 __attribute__((overloadable)) asin(float8);
extern float16 __attribute__((overloadable)) asin(float16);
//extern float2 __attribute__((overloadable)) asin(float2);
//extern float3 __attribute__((overloadable)) asin(float3);
//extern float4 __attribute__((overloadable)) asin(float4);
//extern float8 __attribute__((overloadable)) asin(float8);
//extern float16 __attribute__((overloadable)) asin(float16);
extern float __attribute__((overloadable)) atan(float);
extern float2 __attribute__((overloadable)) atan(float2);
extern float3 __attribute__((overloadable)) atan(float3);
extern float4 __attribute__((overloadable)) atan(float4);
extern float8 __attribute__((overloadable)) atan(float8);
extern float16 __attribute__((overloadable)) atan(float16);
//extern float2 __attribute__((overloadable)) atan(float2);
//extern float3 __attribute__((overloadable)) atan(float3);
//extern float4 __attribute__((overloadable)) atan(float4);
//extern float8 __attribute__((overloadable)) atan(float8);
//extern float16 __attribute__((overloadable)) atan(float16);
extern float __attribute__((overloadable)) atan2(float, float);
extern float2 __attribute__((overloadable)) atan2(float2, float2);
extern float3 __attribute__((overloadable)) atan2(float3, float3);
extern float4 __attribute__((overloadable)) atan2(float4, float4);
extern float8 __attribute__((overloadable)) atan2(float8, float8);
extern float16 __attribute__((overloadable)) atan2(float16, float16);
//extern float2 __attribute__((overloadable)) atan2(float2, float2);
//extern float3 __attribute__((overloadable)) atan2(float3, float3);
//extern float4 __attribute__((overloadable)) atan2(float4, float4);
//extern float8 __attribute__((overloadable)) atan2(float8, float8);
//extern float16 __attribute__((overloadable)) atan2(float16, float16);
extern float __attribute__((overloadable)) ceil(float);
extern float2 __attribute__((overloadable)) ceil(float2);
extern float3 __attribute__((overloadable)) ceil(float3);
extern float4 __attribute__((overloadable)) ceil(float4);
extern float8 __attribute__((overloadable)) ceil(float8);
extern float16 __attribute__((overloadable)) ceil(float16);
//extern float2 __attribute__((overloadable)) ceil(float2);
//extern float3 __attribute__((overloadable)) ceil(float3);
//extern float4 __attribute__((overloadable)) ceil(float4);
//extern float8 __attribute__((overloadable)) ceil(float8);
//extern float16 __attribute__((overloadable)) ceil(float16);
extern float __attribute__((overloadable)) clamp(float, float, float);
extern float2 __attribute__((overloadable)) clamp(float2, float2, float2);
extern float3 __attribute__((overloadable)) clamp(float3, float3, float3);
extern float4 __attribute__((overloadable)) clamp(float4, float4, float4);
extern float8 __attribute__((overloadable)) clamp(float8, float8, float8);
extern float16 __attribute__((overloadable)) clamp(float16, float16, float16);
extern float __attribute__((overloadable)) clamp(float, float, float);
extern float2 __attribute__((overloadable)) clamp(float2, float, float);
extern float3 __attribute__((overloadable)) clamp(float3, float, float);
extern float4 __attribute__((overloadable)) clamp(float4, float, float);
extern float8 __attribute__((overloadable)) clamp(float8, float, float);
extern float16 __attribute__((overloadable)) clamp(float16, float, float);
//extern float2 __attribute__((overloadable)) clamp(float2, float2, float2);
//extern float3 __attribute__((overloadable)) clamp(float3, float3, float3);
//extern float4 __attribute__((overloadable)) clamp(float4, float4, float4);
//extern float8 __attribute__((overloadable)) clamp(float8, float8, float8);
//extern float16 __attribute__((overloadable)) clamp(float16, float16, float16);
//extern float2 __attribute__((overloadable)) clamp(float2, float, float);
//extern float3 __attribute__((overloadable)) clamp(float3, float, float);
//extern float4 __attribute__((overloadable)) clamp(float4, float, float);
//extern float8 __attribute__((overloadable)) clamp(float8, float, float);
//extern float16 __attribute__((overloadable)) clamp(float16, float, float);
extern float __attribute__((overloadable)) copysign(float, float);
extern float2 __attribute__((overloadable)) copysign(float2, float2);
extern float3 __attribute__((overloadable)) copysign(float3, float3);
extern float4 __attribute__((overloadable)) copysign(float4, float4);
extern float8 __attribute__((overloadable)) copysign(float8, float8);
extern float16 __attribute__((overloadable)) copysign(float16, float16);
//extern float2 __attribute__((overloadable)) copysign(float2, float2);
//extern float3 __attribute__((overloadable)) copysign(float3, float3);
//extern float4 __attribute__((overloadable)) copysign(float4, float4);
//extern float8 __attribute__((overloadable)) copysign(float8, float8);
//extern float16 __attribute__((overloadable)) copysign(float16, float16);
extern float __attribute__((overloadable)) cos(float);
extern float2 __attribute__((overloadable)) cos(float2);
extern float3 __attribute__((overloadable)) cos(float3);
extern float4 __attribute__((overloadable)) cos(float4);
extern float8 __attribute__((overloadable)) cos(float8);
extern float16 __attribute__((overloadable)) cos(float16);
//extern float2 __attribute__((overloadable)) cos(float2);
//extern float3 __attribute__((overloadable)) cos(float3);
//extern float4 __attribute__((overloadable)) cos(float4);
//extern float8 __attribute__((overloadable)) cos(float8);
//extern float16 __attribute__((overloadable)) cos(float16);
extern float __attribute__((overloadable)) degrees(float);
extern float2 __attribute__((overloadable)) degrees(float2);
extern float3 __attribute__((overloadable)) degrees(float3);
extern float4 __attribute__((overloadable)) degrees(float4);
extern float8 __attribute__((overloadable)) degrees(float8);
extern float16 __attribute__((overloadable)) degrees(float16);
//extern float2 __attribute__((overloadable)) degrees(float2);
//extern float3 __attribute__((overloadable)) degrees(float3);
//extern float4 __attribute__((overloadable)) degrees(float4);
//extern float8 __attribute__((overloadable)) degrees(float8);
//extern float16 __attribute__((overloadable)) degrees(float16);
extern float __attribute__((overloadable)) exp(float);
extern float2 __attribute__((overloadable)) exp(float2);
extern float3 __attribute__((overloadable)) exp(float3);
extern float4 __attribute__((overloadable)) exp(float4);
extern float8 __attribute__((overloadable)) exp(float8);
extern float16 __attribute__((overloadable)) exp(float16);
//extern float2 __attribute__((overloadable)) exp(float2);
//extern float3 __attribute__((overloadable)) exp(float3);
//extern float4 __attribute__((overloadable)) exp(float4);
//extern float8 __attribute__((overloadable)) exp(float8);
//extern float16 __attribute__((overloadable)) exp(float16);
extern float __attribute__((overloadable)) exp2(float);
extern float2 __attribute__((overloadable)) exp2(float2);
extern float3 __attribute__((overloadable)) exp2(float3);
extern float4 __attribute__((overloadable)) exp2(float4);
extern float8 __attribute__((overloadable)) exp2(float8);
extern float16 __attribute__((overloadable)) exp2(float16);
//extern float2 __attribute__((overloadable)) exp2(float2);
//extern float3 __attribute__((overloadable)) exp2(float3);
//extern float4 __attribute__((overloadable)) exp2(float4);
//extern float8 __attribute__((overloadable)) exp2(float8);
//extern float16 __attribute__((overloadable)) exp2(float16);
extern float __attribute__((overloadable)) exp10(float);
extern float2 __attribute__((overloadable)) exp10(float2);
extern float3 __attribute__((overloadable)) exp10(float3);
extern float4 __attribute__((overloadable)) exp10(float4);
extern float8 __attribute__((overloadable)) exp10(float8);
extern float16 __attribute__((overloadable)) exp10(float16);
//extern float2 __attribute__((overloadable)) exp10(float2);
//extern float3 __attribute__((overloadable)) exp10(float3);
//extern float4 __attribute__((overloadable)) exp10(float4);
//extern float8 __attribute__((overloadable)) exp10(float8);
//extern float16 __attribute__((overloadable)) exp10(float16);
extern float __attribute__((overloadable)) fabs(float);
extern float2 __attribute__((overloadable)) fabs(float2);
extern float3 __attribute__((overloadable)) fabs(float3);
extern float4 __attribute__((overloadable)) fabs(float4);
extern float8 __attribute__((overloadable)) fabs(float8);
extern float16 __attribute__((overloadable)) fabs(float16);
//extern float2 __attribute__((overloadable)) fabs(float2);
//extern float3 __attribute__((overloadable)) fabs(float3);
//extern float4 __attribute__((overloadable)) fabs(float4);
//extern float8 __attribute__((overloadable)) fabs(float8);
//extern float16 __attribute__((overloadable)) fabs(float16);
extern float __attribute__((overloadable)) floor(float);
extern float2 __attribute__((overloadable)) floor(float2);
extern float3 __attribute__((overloadable)) floor(float3);
extern float4 __attribute__((overloadable)) floor(float4);
extern float8 __attribute__((overloadable)) floor(float8);
extern float16 __attribute__((overloadable)) floor(float16);
//extern float2 __attribute__((overloadable)) floor(float2);
//extern float3 __attribute__((overloadable)) floor(float3);
//extern float4 __attribute__((overloadable)) floor(float4);
//extern float8 __attribute__((overloadable)) floor(float8);
//extern float16 __attribute__((overloadable)) floor(float16);
extern float __attribute__((overloadable)) fmax(float, float);
extern float2 __attribute__((overloadable)) fmax(float2, float2);
extern float3 __attribute__((overloadable)) fmax(float3, float3);
extern float4 __attribute__((overloadable)) fmax(float4, float4);
extern float8 __attribute__((overloadable)) fmax(float8, float8);
extern float16 __attribute__((overloadable)) fmax(float16, float16);
extern float2 __attribute__((overloadable)) fmax(float2, float);
extern float3 __attribute__((overloadable)) fmax(float3, float);
extern float4 __attribute__((overloadable)) fmax(float4, float);
extern float8 __attribute__((overloadable)) fmax(float8, float);
extern float16 __attribute__((overloadable)) fmax(float16, float);
//extern float2 __attribute__((overloadable)) fmax(float2, float2);
//extern float3 __attribute__((overloadable)) fmax(float3, float3);
//extern float4 __attribute__((overloadable)) fmax(float4, float4);
//extern float8 __attribute__((overloadable)) fmax(float8, float8);
//extern float16 __attribute__((overloadable)) fmax(float16, float16);
//extern float2 __attribute__((overloadable)) fmax(float2, float);
//extern float3 __attribute__((overloadable)) fmax(float3, float);
//extern float4 __attribute__((overloadable)) fmax(float4, float);
//extern float8 __attribute__((overloadable)) fmax(float8, float);
//extern float16 __attribute__((overloadable)) fmax(float16, float);
extern float __attribute__((overloadable)) fmin(float, float);
extern float2 __attribute__((overloadable)) fmin(float2, float2);
extern float3 __attribute__((overloadable)) fmin(float3, float3);
extern float4 __attribute__((overloadable)) fmin(float4, float4);
extern float8 __attribute__((overloadable)) fmin(float8, float8);
extern float16 __attribute__((overloadable)) fmin(float16, float16);
extern float2 __attribute__((overloadable)) fmin(float2, float);
extern float3 __attribute__((overloadable)) fmin(float3, float);
extern float4 __attribute__((overloadable)) fmin(float4, float);
extern float8 __attribute__((overloadable)) fmin(float8, float);
extern float16 __attribute__((overloadable)) fmin(float16, float);
//extern float2 __attribute__((overloadable)) fmin(float2, float2);
//extern float3 __attribute__((overloadable)) fmin(float3, float3);
//extern float4 __attribute__((overloadable)) fmin(float4, float4);
//extern float8 __attribute__((overloadable)) fmin(float8, float8);
//extern float16 __attribute__((overloadable)) fmin(float16, float16);
//extern float2 __attribute__((overloadable)) fmin(float2, float);
//extern float3 __attribute__((overloadable)) fmin(float3, float);
//extern float4 __attribute__((overloadable)) fmin(float4, float);
//extern float8 __attribute__((overloadable)) fmin(float8, float);
//extern float16 __attribute__((overloadable)) fmin(float16, float);
extern float __attribute__((overloadable)) fmod(float, float);
extern float2 __attribute__((overloadable)) fmod(float2, float2);
extern float3 __attribute__((overloadable)) fmod(float3, float3);
extern float4 __attribute__((overloadable)) fmod(float4, float4);
extern float8 __attribute__((overloadable)) fmod(float8, float8);
extern float16 __attribute__((overloadable)) fmod(float16, float16);
//extern float2 __attribute__((overloadable)) fmod(float2, float2);
//extern float3 __attribute__((overloadable)) fmod(float3, float3);
//extern float4 __attribute__((overloadable)) fmod(float4, float4);
//extern float8 __attribute__((overloadable)) fmod(float8, float8);
//extern float16 __attribute__((overloadable)) fmod(float16, float16);
extern float __attribute__((overloadable)) log(float);
extern float2 __attribute__((overloadable)) log(float2);
extern float3 __attribute__((overloadable)) log(float3);
extern float4 __attribute__((overloadable)) log(float4);
extern float8 __attribute__((overloadable)) log(float8);
extern float16 __attribute__((overloadable)) log(float16);
//extern float2 __attribute__((overloadable)) log(float2);
//extern float3 __attribute__((overloadable)) log(float3);
//extern float4 __attribute__((overloadable)) log(float4);
//extern float8 __attribute__((overloadable)) log(float8);
//extern float16 __attribute__((overloadable)) log(float16);
extern float __attribute__((overloadable)) log2(float);
extern float2 __attribute__((overloadable)) log2(float2);
extern float3 __attribute__((overloadable)) log2(float3);
extern float4 __attribute__((overloadable)) log2(float4);
extern float8 __attribute__((overloadable)) log2(float8);
extern float16 __attribute__((overloadable)) log2(float16);
//extern float2 __attribute__((overloadable)) log2(float2);
//extern float3 __attribute__((overloadable)) log2(float3);
//extern float4 __attribute__((overloadable)) log2(float4);
//extern float8 __attribute__((overloadable)) log2(float8);
//extern float16 __attribute__((overloadable)) log2(float16);
extern float __attribute__((overloadable)) log10(float);
extern float2 __attribute__((overloadable)) log10(float2);
extern float3 __attribute__((overloadable)) log10(float3);
extern float4 __attribute__((overloadable)) log10(float4);
extern float8 __attribute__((overloadable)) log10(float8);
extern float16 __attribute__((overloadable)) log10(float16);
//extern float2 __attribute__((overloadable)) log10(float2);
//extern float3 __attribute__((overloadable)) log10(float3);
//extern float4 __attribute__((overloadable)) log10(float4);
//extern float8 __attribute__((overloadable)) log10(float8);
//extern float16 __attribute__((overloadable)) log10(float16);
extern float __attribute__((overloadable)) max(float, float);
extern float2 __attribute__((overloadable)) max(float2, float2);
extern float3 __attribute__((overloadable)) max(float3, float3);
extern float4 __attribute__((overloadable)) max(float4, float4);
extern float8 __attribute__((overloadable)) max(float8, float8);
extern float16 __attribute__((overloadable)) max(float16, float16);
//extern float2 __attribute__((overloadable)) max(float2, float2);
//extern float3 __attribute__((overloadable)) max(float3, float3);
//extern float4 __attribute__((overloadable)) max(float4, float4);
//extern float8 __attribute__((overloadable)) max(float8, float8);
//extern float16 __attribute__((overloadable)) max(float16, float16);
extern float __attribute__((overloadable)) min(float, float);
extern float2 __attribute__((overloadable)) min(float2, float2);
extern float3 __attribute__((overloadable)) min(float3, float3);
extern float4 __attribute__((overloadable)) min(float4, float4);
extern float8 __attribute__((overloadable)) min(float8, float8);
extern float16 __attribute__((overloadable)) min(float16, float16);
//extern float2 __attribute__((overloadable)) min(float2, float2);
//extern float3 __attribute__((overloadable)) min(float3, float3);
//extern float4 __attribute__((overloadable)) min(float4, float4);
//extern float8 __attribute__((overloadable)) min(float8, float8);
//extern float16 __attribute__((overloadable)) min(float16, float16);
extern float __attribute__((overloadable)) mix(float, float, float);
extern float2 __attribute__((overloadable)) mix(float2, float2, float2);
extern float3 __attribute__((overloadable)) mix(float3, float3, float3);
extern float4 __attribute__((overloadable)) mix(float4, float4, float4);
extern float8 __attribute__((overloadable)) mix(float8, float8, float8);
extern float16 __attribute__((overloadable)) mix(float16, float16, float16);
extern float __attribute__((overloadable)) mix(float, float, float);
extern float2 __attribute__((overloadable)) mix(float2, float2, float);
extern float3 __attribute__((overloadable)) mix(float3, float3, float);
extern float4 __attribute__((overloadable)) mix(float4, float4, float);
extern float8 __attribute__((overloadable)) mix(float8, float8, float);
extern float16 __attribute__((overloadable)) mix(float16, float16, float);
//extern float2 __attribute__((overloadable)) mix(float2, float2, float2);
//extern float3 __attribute__((overloadable)) mix(float3, float3, float3);
//extern float4 __attribute__((overloadable)) mix(float4, float4, float4);
//extern float8 __attribute__((overloadable)) mix(float8, float8, float8);
//extern float16 __attribute__((overloadable)) mix(float16, float16, float16);
//extern float2 __attribute__((overloadable)) mix(float2, float2, float);
//extern float3 __attribute__((overloadable)) mix(float3, float3, float);
//extern float4 __attribute__((overloadable)) mix(float4, float4, float);
//extern float8 __attribute__((overloadable)) mix(float8, float8, float);
//extern float16 __attribute__((overloadable)) mix(float16, float16, float);
extern float __attribute__((overloadable)) pow(float, float);
extern float2 __attribute__((overloadable)) pow(float2, float2);
extern float3 __attribute__((overloadable)) pow(float3, float3);
extern float4 __attribute__((overloadable)) pow(float4, float4);
extern float8 __attribute__((overloadable)) pow(float8, float8);
extern float16 __attribute__((overloadable)) pow(float16, float16);
//extern float2 __attribute__((overloadable)) pow(float2, float2);
//extern float3 __attribute__((overloadable)) pow(float3, float3);
//extern float4 __attribute__((overloadable)) pow(float4, float4);
//extern float8 __attribute__((overloadable)) pow(float8, float8);
//extern float16 __attribute__((overloadable)) pow(float16, float16);
extern float __attribute__((overloadable)) radians(float);
extern float2 __attribute__((overloadable)) radians(float2);
extern float3 __attribute__((overloadable)) radians(float3);
extern float4 __attribute__((overloadable)) radians(float4);
extern float8 __attribute__((overloadable)) radians(float8);
extern float16 __attribute__((overloadable)) radians(float16);
//extern float2 __attribute__((overloadable)) radians(float2);
//extern float3 __attribute__((overloadable)) radians(float3);
//extern float4 __attribute__((overloadable)) radians(float4);
//extern float8 __attribute__((overloadable)) radians(float8);
//extern float16 __attribute__((overloadable)) radians(float16);
extern float __attribute__((overloadable)) rint(float);
extern float2 __attribute__((overloadable)) rint(float2);
extern float3 __attribute__((overloadable)) rint(float3);
extern float4 __attribute__((overloadable)) rint(float4);
extern float8 __attribute__((overloadable)) rint(float8);
extern float16 __attribute__((overloadable)) rint(float16);
//extern float2 __attribute__((overloadable)) rint(float2);
//extern float3 __attribute__((overloadable)) rint(float3);
//extern float4 __attribute__((overloadable)) rint(float4);
//extern float8 __attribute__((overloadable)) rint(float8);
//extern float16 __attribute__((overloadable)) rint(float16);
extern float __attribute__((overloadable)) round(float);
extern float2 __attribute__((overloadable)) round(float2);
extern float3 __attribute__((overloadable)) round(float3);
extern float4 __attribute__((overloadable)) round(float4);
extern float8 __attribute__((overloadable)) round(float8);
extern float16 __attribute__((overloadable)) round(float16);
//extern float2 __attribute__((overloadable)) round(float2);
//extern float3 __attribute__((overloadable)) round(float3);
//extern float4 __attribute__((overloadable)) round(float4);
//extern float8 __attribute__((overloadable)) round(float8);
//extern float16 __attribute__((overloadable)) round(float16);
extern float __attribute__((overloadable)) rsqrt(float);
extern float2 __attribute__((overloadable)) rsqrt(float2);
extern float3 __attribute__((overloadable)) rsqrt(float3);
extern float4 __attribute__((overloadable)) rsqrt(float4);
extern float8 __attribute__((overloadable)) rsqrt(float8);
extern float16 __attribute__((overloadable)) rsqrt(float16);
//extern float2 __attribute__((overloadable)) rsqrt(float2);
//extern float3 __attribute__((overloadable)) rsqrt(float3);
//extern float4 __attribute__((overloadable)) rsqrt(float4);
//extern float8 __attribute__((overloadable)) rsqrt(float8);
//extern float16 __attribute__((overloadable)) rsqrt(float16);
extern float __attribute__((overloadable)) sign(float);
extern float2 __attribute__((overloadable)) sign(float2);
extern float3 __attribute__((overloadable)) sign(float3);
extern float4 __attribute__((overloadable)) sign(float4);
extern float8 __attribute__((overloadable)) sign(float8);
extern float16 __attribute__((overloadable)) sign(float16);
//extern float2 __attribute__((overloadable)) sign(float2);
//extern float3 __attribute__((overloadable)) sign(float3);
//extern float4 __attribute__((overloadable)) sign(float4);
//extern float8 __attribute__((overloadable)) sign(float8);
//extern float16 __attribute__((overloadable)) sign(float16);
extern float __attribute__((overloadable)) sin(float);
extern float2 __attribute__((overloadable)) sin(float2);
extern float3 __attribute__((overloadable)) sin(float3);
extern float4 __attribute__((overloadable)) sin(float4);
extern float8 __attribute__((overloadable)) sin(float8);
extern float16 __attribute__((overloadable)) sin(float16);
//extern float2 __attribute__((overloadable)) sin(float2);
//extern float3 __attribute__((overloadable)) sin(float3);
//extern float4 __attribute__((overloadable)) sin(float4);
//extern float8 __attribute__((overloadable)) sin(float8);
//extern float16 __attribute__((overloadable)) sin(float16);
extern float __attribute__((overloadable)) sqrt(float);
extern float2 __attribute__((overloadable)) sqrt(float2);
extern float3 __attribute__((overloadable)) sqrt(float3);
extern float4 __attribute__((overloadable)) sqrt(float4);
extern float8 __attribute__((overloadable)) sqrt(float8);
extern float16 __attribute__((overloadable)) sqrt(float16);
//extern float2 __attribute__((overloadable)) sqrt(float2);
//extern float3 __attribute__((overloadable)) sqrt(float3);
//extern float4 __attribute__((overloadable)) sqrt(float4);
//extern float8 __attribute__((overloadable)) sqrt(float8);
//extern float16 __attribute__((overloadable)) sqrt(float16);
extern float __attribute__((overloadable)) tan(float);
extern float2 __attribute__((overloadable)) tan(float2);
extern float3 __attribute__((overloadable)) tan(float3);
extern float4 __attribute__((overloadable)) tan(float4);
extern float8 __attribute__((overloadable)) tan(float8);
extern float16 __attribute__((overloadable)) tan(float16);
//extern float2 __attribute__((overloadable)) tan(float2);
//extern float3 __attribute__((overloadable)) tan(float3);
//extern float4 __attribute__((overloadable)) tan(float4);
//extern float8 __attribute__((overloadable)) tan(float8);
//extern float16 __attribute__((overloadable)) tan(float16);
extern float __attribute__((overloadable)) trunc(float);
extern float2 __attribute__((overloadable)) trunc(float2);
extern float3 __attribute__((overloadable)) trunc(float3);
extern float4 __attribute__((overloadable)) trunc(float4);
extern float8 __attribute__((overloadable)) trunc(float8);
extern float16 __attribute__((overloadable)) trunc(float16);
//extern float2 __attribute__((overloadable)) trunc(float2);
//extern float3 __attribute__((overloadable)) trunc(float3);
//extern float4 __attribute__((overloadable)) trunc(float4);
//extern float8 __attribute__((overloadable)) trunc(float8);
//extern float16 __attribute__((overloadable)) trunc(float16);
@@ -268,11 +266,11 @@ extern float16 __attribute__((overloadable)) trunc(float16);
// Int ops
extern int __attribute__((overloadable)) abs(int);
extern int2 __attribute__((overloadable)) abs(int2);
extern int3 __attribute__((overloadable)) abs(int3);
extern int4 __attribute__((overloadable)) abs(int4);
extern int8 __attribute__((overloadable)) abs(int8);
extern int16 __attribute__((overloadable)) abs(int16);
//extern int2 __attribute__((overloadable)) abs(int2);
//extern int3 __attribute__((overloadable)) abs(int3);
//extern int4 __attribute__((overloadable)) abs(int4);
//extern int8 __attribute__((overloadable)) abs(int8);
//extern int16 __attribute__((overloadable)) abs(int16);

View File

@@ -68,4 +68,29 @@ typedef int int8 __attribute__((ext_vector_type(8)));
typedef int int16 __attribute__((ext_vector_type(16)));
// RS_KIND_POSITION
typedef float rs_position1;
typedef float2 rs_position2;
typedef float3 rs_position3;
typedef float4 rs_position4;
// RS_KIND_COLOR
typedef float3 rs_color3f;
typedef float4 rs_color4f;
typedef uchar4 rs_color4u;
// RS_KIND_NORMAL
typedef float3 rs_normal;
// RS_KIND_POINT_SIZE
typedef float rs_point_size;
// RS_KIND_TEXTURE
typedef float rs_texture_coord1;
typedef float2 rs_texture_coord2;
typedef float3 rs_texture_coord3;
typedef float4 rs_texture_coord4;
// RS_KIND_INDEX
typedef ushort rs_index;