From fbf0b9ecda03fbdbd4ebabfd18da09a789686249 Mon Sep 17 00:00:00 2001 From: Jason Sams Date: Thu, 13 Aug 2009 12:59:04 -0700 Subject: Implement named slots and convert script.addType to script.setType to remove ordering restrictions. --- libs/rs/rsScript.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'libs/rs/rsScript.cpp') diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index 6ce9f61f1c24..75c994b24fd0 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -76,6 +76,25 @@ void rsi_ScriptSetClearStencil(Context * rsc, RsScript vs, uint32_t v) s->mEnviroment.mClearStencil = v; } +void rsi_ScriptSetType(Context * rsc, RsType vt, uint32_t slot, const char *name) +{ + ScriptCState *ss = &rsc->mScriptC; + const Type *t = static_cast(vt); + ss->mConstantBufferTypes[slot].set(t); + if (name) { + ss->mSlotNames[slot].setTo(name); + } else { + ss->mSlotNames[slot].setTo(""); + } +} + +void rsi_ScriptSetRoot(Context * rsc, bool isRoot) +{ + ScriptCState *ss = &rsc->mScriptC; + ss->mEnviroment.mIsRoot = isRoot; +} + + } } -- cgit v1.2.3-59-g8ed1b