summaryrefslogtreecommitdiffstats
path: root/rsComponent.cpp
diff options
context:
space:
mode:
authorJason Sams <rjsams@android.com>2009-12-15 12:58:36 -0800
committerJason Sams <rjsams@android.com>2009-12-15 12:58:36 -0800
commit4815c0d121310cfcd6a8aba4eab77a9910af53ac (patch)
tree6e6154879389c6b5bd745f3c0922d83ed232de8f /rsComponent.cpp
parentcf4c7c9b2f513be77a5b9853319ca82ac2b128ed (diff)
downloadandroid_frameworks_rs-4815c0d121310cfcd6a8aba4eab77a9910af53ac.tar.gz
android_frameworks_rs-4815c0d121310cfcd6a8aba4eab77a9910af53ac.tar.bz2
android_frameworks_rs-4815c0d121310cfcd6a8aba4eab77a9910af53ac.zip
Continue development of es2.0 user shader support for renderscript. This change cleans up ProgramVertex creation and adds support for passing input, output, and constant type info.
Diffstat (limited to 'rsComponent.cpp')
-rw-r--r--rsComponent.cpp110
1 files changed, 0 insertions, 110 deletions
diff --git a/rsComponent.cpp b/rsComponent.cpp
deleted file mode 100644
index de074c8c..00000000
--- a/rsComponent.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * 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.
- */
-
-#include "rsComponent.h"
-#include <GLES/gl.h>
-
-using namespace android;
-using namespace android::renderscript;
-
-
-Component::Component(Context *rsc) : ObjectBase(rsc)
-{
- mAllocFile = __FILE__;
- mAllocLine = __LINE__;
- mType = FLOAT;
- mKind = USER;
- mIsNormalized = false;
- mBits = 0;
-}
-
-Component::Component(Context *rsc,
- DataKind dk, DataType dt,
- bool isNormalized, uint32_t bits, const char * name) : ObjectBase(rsc)
-{
- mAllocFile = __FILE__;
- mAllocLine = __LINE__;
- mType = dt;
- mKind = dk;
- mIsNormalized = isNormalized;
- mBits = bits;
- if (name) {
- mName = name;
- }
-}
-
-const char * Component::getCType() const
-{
- switch(mType) {
- case FLOAT:
- return "float";
- case SIGNED:
- case UNSIGNED:
- switch(mBits) {
- case 32:
- return "int";
- case 16:
- return "short";
- case 8:
- return "char";
- }
- break;
- }
- return NULL;
-}
-
-Component::~Component()
-{
-}
-
-uint32_t Component::getGLType() const
-{
- switch(mType) {
- case RS_TYPE_FLOAT:
- rsAssert(mBits == 32);
- return GL_FLOAT;
- case RS_TYPE_SIGNED:
- switch(mBits) {
- case 32:
- return 0;//GL_INT;
- case 16:
- return GL_SHORT;
- case 8:
- return GL_BYTE;
- }
- break;
- case RS_TYPE_UNSIGNED:
- switch(mBits) {
- case 32:
- return 0;//GL_UNSIGNED_INT;
- case 16:
- return GL_UNSIGNED_SHORT;
- case 8:
- return GL_UNSIGNED_BYTE;
- }
- break;
- }
- //rsAssert(!"Bad type");
- //LOGE("mType %i, mKind %i, mBits %i, mIsNormalized %i", mType, mKind, mBits, mIsNormalized);
- return 0;
-}
-
-void Component::dumpLOGV(const char *prefix) const
-{
- ObjectBase::dumpLOGV(prefix);
- LOGV("%s component: %i %i %i %i", prefix, mType, mKind, mIsNormalized, mBits);
-}
-