mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:51:20 +02:00
Fix frame player
This commit is contained in:
parent
02a95b599d
commit
bfda7d73c1
13 changed files with 159 additions and 107 deletions
|
@ -1,7 +1,7 @@
|
||||||
set(TARGET_NAME questFramePlayer)
|
set(TARGET_NAME questFramePlayer)
|
||||||
setup_hifi_library(AndroidExtras)
|
setup_hifi_library(AndroidExtras)
|
||||||
link_hifi_libraries(shared ktx shaders gpu gl oculusMobile ${PLATFORM_GL_BACKEND})
|
link_hifi_libraries(shared ktx shaders gpu gl oculusMobile ${PLATFORM_GL_BACKEND})
|
||||||
target_include_directories(${TARGET_NAME} PRIVATE ${HIFI_ANDROID_PRECOMPILED}/ovr/VrApi/Include)
|
|
||||||
target_link_libraries(${TARGET_NAME} android log m)
|
target_link_libraries(${TARGET_NAME} android log m)
|
||||||
target_opengl()
|
target_opengl()
|
||||||
target_oculus_mobile()
|
target_oculus_mobile()
|
||||||
|
|
|
@ -19,24 +19,6 @@
|
||||||
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
android:name="org.qtproject.qt5.android.bindings.QtApplication"
|
||||||
tools:ignore="GoogleAppIndexingWarning,MissingApplicationIcon">
|
tools:ignore="GoogleAppIndexingWarning,MissingApplicationIcon">
|
||||||
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
<meta-data android:name="com.samsung.android.vr.application.mode" android:value="vr_only"/>
|
||||||
<activity
|
|
||||||
android:name=".QuestQtActivity"
|
|
||||||
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
|
||||||
android:launchMode="singleTask"
|
|
||||||
android:label="@string/app_name"
|
|
||||||
android:screenOrientation="landscape"
|
|
||||||
android:excludeFromRecents="false"
|
|
||||||
android:alwaysRetainTaskState="true"
|
|
||||||
android:configChanges="screenSize|screenLayout|orientation|keyboardHidden|keyboard|navigation|uiMode"
|
|
||||||
>
|
|
||||||
<!-- JNI nonsense -->
|
|
||||||
<meta-data android:name="android.app.lib_name" android:value="questFramePlayer"/>
|
|
||||||
<!-- Qt nonsense -->
|
|
||||||
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
|
||||||
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
|
||||||
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
|
||||||
<meta-data android:name="android.app.load_local_libs" android:value="plugins/platforms/android/libqtforandroid.so:plugins/bearer/libqandroidbearer.so:lib/libQt5QuickParticles.so"/>
|
|
||||||
</activity>
|
|
||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
|
||||||
|
@ -50,6 +32,13 @@
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
|
<!-- JNI nonsense -->
|
||||||
|
<meta-data android:name="android.app.lib_name" android:value="questFramePlayer"/>
|
||||||
|
<!-- Qt nonsense -->
|
||||||
|
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
|
||||||
|
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
|
||||||
|
<meta-data android:name="android.app.load_local_libs" android:value="plugins/platforms/android/libqtforandroid.so:plugins/bearer/libqandroidbearer.so:lib/libQt5QuickParticles.so"/>
|
||||||
</activity>
|
</activity>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
33
android/apps/questFramePlayer/src/main/cpp/AndroidHelper.cpp
Normal file
33
android/apps/questFramePlayer/src/main/cpp/AndroidHelper.cpp
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
//
|
||||||
|
// AndroidHelper.cpp
|
||||||
|
// interface/src
|
||||||
|
//
|
||||||
|
// Created by Gabriel Calero & Cristian Duarte on 3/30/18.
|
||||||
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
#include "AndroidHelper.h"
|
||||||
|
|
||||||
|
#include <QtCore/QDebug>
|
||||||
|
#include <QtGui/QGuiApplication>
|
||||||
|
|
||||||
|
AndroidHelper::AndroidHelper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
AndroidHelper::~AndroidHelper() {
|
||||||
|
}
|
||||||
|
|
||||||
|
void AndroidHelper::notifyLoadComplete() {
|
||||||
|
emit qtAppLoadComplete();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AndroidHelper::notifyEnterForeground() {
|
||||||
|
emit enterForeground();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AndroidHelper::notifyEnterBackground() {
|
||||||
|
emit enterBackground();
|
||||||
|
}
|
||||||
|
|
46
android/apps/questFramePlayer/src/main/cpp/AndroidHelper.h
Normal file
46
android/apps/questFramePlayer/src/main/cpp/AndroidHelper.h
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
//
|
||||||
|
// AndroidHelper.h
|
||||||
|
// interface/src
|
||||||
|
//
|
||||||
|
// Created by Gabriel Calero & Cristian Duarte on 3/30/18.
|
||||||
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef hifi_Android_Helper_h
|
||||||
|
#define hifi_Android_Helper_h
|
||||||
|
|
||||||
|
#include <QtCore/QObject>
|
||||||
|
#include <QtCore/QMap>
|
||||||
|
#include <QtCore/QUrl>
|
||||||
|
#include <QtCore/QEventLoop>
|
||||||
|
|
||||||
|
class AndroidHelper : public QObject {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
AndroidHelper(AndroidHelper const&) = delete;
|
||||||
|
void operator=(AndroidHelper const&) = delete;
|
||||||
|
|
||||||
|
static AndroidHelper& instance() {
|
||||||
|
static AndroidHelper instance;
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void notifyLoadComplete();
|
||||||
|
void notifyEnterForeground();
|
||||||
|
void notifyEnterBackground();
|
||||||
|
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void qtAppLoadComplete();
|
||||||
|
void enterForeground();
|
||||||
|
void enterBackground();
|
||||||
|
|
||||||
|
private:
|
||||||
|
AndroidHelper();
|
||||||
|
~AndroidHelper();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -16,6 +16,7 @@
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
#include <QtGui/QWindow>
|
#include <QtGui/QWindow>
|
||||||
#include <QtGui/QImageReader>
|
#include <QtGui/QImageReader>
|
||||||
|
#include <QtAndroidExtras/QAndroidJniObject>
|
||||||
|
|
||||||
#include <gl/QOpenGLContextWrapper.h>
|
#include <gl/QOpenGLContextWrapper.h>
|
||||||
#include <gpu/FrameIO.h>
|
#include <gpu/FrameIO.h>
|
||||||
|
@ -29,9 +30,9 @@
|
||||||
#include <VrApi.h>
|
#include <VrApi.h>
|
||||||
#include <VrApi_Input.h>
|
#include <VrApi_Input.h>
|
||||||
|
|
||||||
static JNIEnv* _env { nullptr };
|
#include "AndroidHelper.h"
|
||||||
static JavaVM* _vm { nullptr };
|
|
||||||
static jobject _activity { nullptr };
|
//static jobject _activity { nullptr };
|
||||||
|
|
||||||
struct HandController{
|
struct HandController{
|
||||||
ovrInputTrackedRemoteCapabilities caps {};
|
ovrInputTrackedRemoteCapabilities caps {};
|
||||||
|
@ -48,21 +49,43 @@ struct HandController{
|
||||||
};
|
};
|
||||||
|
|
||||||
std::vector<HandController> devices;
|
std::vector<HandController> devices;
|
||||||
|
QAndroidJniObject __interfaceActivity;
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *, void *) {
|
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void *) {
|
||||||
__android_log_write(ANDROID_LOG_WARN, "QQQ", __FUNCTION__);
|
__android_log_write(ANDROID_LOG_WARN, "QQQ", __FUNCTION__);
|
||||||
return JNI_VERSION_1_6;
|
return JNI_VERSION_1_6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnCreate(JNIEnv *env, jobject obj) {
|
||||||
|
__android_log_print(ANDROID_LOG_INFO, "QQQ", __FUNCTION__);
|
||||||
|
__interfaceActivity = QAndroidJniObject(obj);
|
||||||
|
QObject::connect(&AndroidHelper::instance(), &AndroidHelper::qtAppLoadComplete, []() {
|
||||||
|
__interfaceActivity.callMethod<void>("onAppLoadedComplete", "()V");
|
||||||
|
QObject::disconnect(&AndroidHelper::instance(), &AndroidHelper::qtAppLoadComplete, nullptr, nullptr);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL Java_io_highfidelity_frameplayer_QuestQtActivity_nativeOnCreate(JNIEnv* env, jobject obj) {
|
JNIEXPORT void
|
||||||
env->GetJavaVM(&_vm);
|
Java_io_highfidelity_oculus_OculusMobileActivity_questOnAppAfterLoad(JNIEnv *env, jobject obj) {
|
||||||
_activity = env->NewGlobalRef(obj);
|
AndroidHelper::instance().moveToThread(qApp->thread());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnPause(JNIEnv *env, jobject obj) {
|
||||||
|
AndroidHelper::instance().notifyEnterBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
JNIEXPORT void JNICALL
|
||||||
|
Java_io_highfidelity_oculus_OculusMobileActivity_questNativeOnResume(JNIEnv *env, jobject obj) {
|
||||||
|
AndroidHelper::instance().notifyEnterForeground();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static const char* FRAME_FILE = "assets:/frames/20190121_1220.json";
|
static const char* FRAME_FILE = "assets:/frames/20190121_1220.json";
|
||||||
|
|
||||||
static void textureLoader(const std::string& filename, const gpu::TexturePointer& texture, uint16_t layer) {
|
static void textureLoader(const std::string& filename, const gpu::TexturePointer& texture, uint16_t layer) {
|
||||||
|
@ -96,14 +119,7 @@ void RenderThread::setup() {
|
||||||
// Wait until the context has been moved to this thread
|
// Wait until the context has been moved to this thread
|
||||||
{ std::unique_lock<std::mutex> lock(_frameLock); }
|
{ std::unique_lock<std::mutex> lock(_frameLock); }
|
||||||
|
|
||||||
|
|
||||||
ovr::VrHandler::initVr();
|
ovr::VrHandler::initVr();
|
||||||
__android_log_write(ANDROID_LOG_WARN, "QQQ", "Launching oculus activity");
|
|
||||||
_vm->AttachCurrentThread(&_env, nullptr);
|
|
||||||
jclass cls = _env->GetObjectClass(_activity);
|
|
||||||
jmethodID mid = _env->GetMethodID(cls, "launchOculusActivity", "()V");
|
|
||||||
_env->CallVoidMethod(_activity, mid);
|
|
||||||
__android_log_write(ANDROID_LOG_WARN, "QQQ", "Launching oculus activity done");
|
|
||||||
ovr::VrHandler::setHandler(this);
|
ovr::VrHandler::setHandler(this);
|
||||||
|
|
||||||
makeCurrent();
|
makeCurrent();
|
||||||
|
|
|
@ -11,30 +11,33 @@
|
||||||
#include <QtGui/QGuiApplication>
|
#include <QtGui/QGuiApplication>
|
||||||
#include <QtCore/QTimer>
|
#include <QtCore/QTimer>
|
||||||
#include <QtCore/QFileInfo>
|
#include <QtCore/QFileInfo>
|
||||||
|
#include <QtAndroidExtras/QAndroidJniObject>
|
||||||
|
|
||||||
#include <Trace.h>
|
#include <Trace.h>
|
||||||
|
|
||||||
#include "PlayerWindow.h"
|
#include "PlayerWindow.h"
|
||||||
|
#include "AndroidHelper.h"
|
||||||
|
|
||||||
|
|
||||||
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) {
|
||||||
if (!message.isEmpty()) {
|
if (!message.isEmpty()) {
|
||||||
const char * local=message.toStdString().c_str();
|
const char* local = message.toStdString().c_str();
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case QtDebugMsg:
|
case QtDebugMsg:
|
||||||
__android_log_write(ANDROID_LOG_DEBUG,"Interface",local);
|
__android_log_write(ANDROID_LOG_DEBUG, "Interface", local);
|
||||||
break;
|
break;
|
||||||
case QtInfoMsg:
|
case QtInfoMsg:
|
||||||
__android_log_write(ANDROID_LOG_INFO,"Interface",local);
|
__android_log_write(ANDROID_LOG_INFO, "Interface", local);
|
||||||
break;
|
break;
|
||||||
case QtWarningMsg:
|
case QtWarningMsg:
|
||||||
__android_log_write(ANDROID_LOG_WARN,"Interface",local);
|
__android_log_write(ANDROID_LOG_WARN, "Interface", local);
|
||||||
break;
|
break;
|
||||||
case QtCriticalMsg:
|
case QtCriticalMsg:
|
||||||
__android_log_write(ANDROID_LOG_ERROR,"Interface",local);
|
__android_log_write(ANDROID_LOG_ERROR, "Interface", local);
|
||||||
break;
|
break;
|
||||||
case QtFatalMsg:
|
case QtFatalMsg:
|
||||||
default:
|
default:
|
||||||
__android_log_write(ANDROID_LOG_FATAL,"Interface",local);
|
__android_log_write(ANDROID_LOG_FATAL, "Interface", local);
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,11 +49,13 @@ int main(int argc, char** argv) {
|
||||||
auto oldMessageHandler = qInstallMessageHandler(messageHandler);
|
auto oldMessageHandler = qInstallMessageHandler(messageHandler);
|
||||||
DependencyManager::set<tracing::Tracer>();
|
DependencyManager::set<tracing::Tracer>();
|
||||||
PlayerWindow window;
|
PlayerWindow window;
|
||||||
__android_log_write(ANDROID_LOG_FATAL,"QQQ","Exec");
|
QTimer::singleShot(10, []{
|
||||||
|
__android_log_write(ANDROID_LOG_WARN, "QQQ", "notifyLoadComplete");
|
||||||
|
AndroidHelper::instance().notifyLoadComplete();
|
||||||
|
});
|
||||||
|
__android_log_write(ANDROID_LOG_WARN, "QQQ", "Exec");
|
||||||
app.exec();
|
app.exec();
|
||||||
__android_log_write(ANDROID_LOG_FATAL,"QQQ","Exec done");
|
__android_log_write(ANDROID_LOG_WARN, "QQQ", "Exec done");
|
||||||
qInstallMessageHandler(oldMessageHandler);
|
qInstallMessageHandler(oldMessageHandler);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,52 +0,0 @@
|
||||||
//
|
|
||||||
// Created by Bradley Austin Davis on 2018/11/20
|
|
||||||
// Copyright 2013-2018 High Fidelity, Inc.
|
|
||||||
//
|
|
||||||
// Distributed under the Apache License, Version 2.0.
|
|
||||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
|
||||||
//
|
|
||||||
package io.highfidelity.frameplayer;
|
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import org.qtproject.qt5.android.bindings.QtActivity;
|
|
||||||
|
|
||||||
import io.highfidelity.oculus.OculusMobileActivity;
|
|
||||||
|
|
||||||
|
|
||||||
public class QuestQtActivity extends QtActivity {
|
|
||||||
private native void nativeOnCreate();
|
|
||||||
private boolean launchedQuestMode = false;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
|
||||||
Log.w("QQQ_Qt", "QuestQtActivity::onCreate");
|
|
||||||
super.onCreate(savedInstanceState);
|
|
||||||
nativeOnCreate();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDestroy() {
|
|
||||||
Log.w("QQQ_Qt", "QuestQtActivity::onDestroy");
|
|
||||||
super.onDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void launchOculusActivity() {
|
|
||||||
Log.w("QQQ_Qt", "QuestQtActivity::launchOculusActivity");
|
|
||||||
runOnUiThread(()->{
|
|
||||||
launchedQuestMode = true;
|
|
||||||
moveTaskToBack(true);
|
|
||||||
startActivity(new Intent(this, QuestRenderActivity.class));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onResume() {
|
|
||||||
super.onResume();
|
|
||||||
if (launchedQuestMode) {
|
|
||||||
moveTaskToBack(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,14 +1,6 @@
|
||||||
package io.highfidelity.frameplayer;
|
package io.highfidelity.frameplayer;
|
||||||
|
|
||||||
import android.content.Intent;
|
|
||||||
import android.os.Bundle;
|
|
||||||
|
|
||||||
import io.highfidelity.oculus.OculusMobileActivity;
|
import io.highfidelity.oculus.OculusMobileActivity;
|
||||||
|
|
||||||
public class QuestRenderActivity extends OculusMobileActivity {
|
public class QuestRenderActivity extends OculusMobileActivity {
|
||||||
@Override
|
|
||||||
public void onCreate(Bundle savedState) {
|
|
||||||
super.onCreate(savedState);
|
|
||||||
startActivity(new Intent(this, QuestQtActivity.class));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</activity>
|
</activity>
|
||||||
<activity
|
<activity
|
||||||
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
|
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|locale|fontScale|keyboard|keyboardHidden|navigation"
|
||||||
android:name="io.highfidelity.oculus.OculusMobileActivity"
|
android:name=".InterfaceActivity"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask">
|
||||||
<meta-data android:name="android.app.lib_name" android:value="questInterface"/>
|
<meta-data android:name="android.app.lib_name" android:value="questInterface"/>
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
package io.highfidelity.questInterface;
|
||||||
|
|
||||||
|
import io.highfidelity.oculus.OculusMobileActivity;
|
||||||
|
|
||||||
|
public class InterfaceActivity extends OculusMobileActivity {
|
||||||
|
@Override
|
||||||
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
|
HifiUtils.upackAssets(getAssets(), getCacheDir().getAbsolutePath());
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
}
|
||||||
|
}
|
|
@ -17,5 +17,5 @@ android {
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile project(path: ':qt')
|
implementation project(path: ':qt')
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,6 @@ public class OculusMobileActivity extends QtActivity implements SurfaceHolder.Ca
|
||||||
|
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
HifiUtils.upackAssets(getAssets(), getCacheDir().getAbsolutePath());
|
|
||||||
|
|
||||||
Log.w(TAG, "QQQ onCreate");
|
Log.w(TAG, "QQQ onCreate");
|
||||||
// Create a native surface for VR rendering (Qt GL surfaces are not suitable
|
// Create a native surface for VR rendering (Qt GL surfaces are not suitable
|
||||||
|
|
|
@ -388,10 +388,23 @@ ShaderPointer Deserializer::readShader(const json& node) {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static std::map<std::string, uint32_t> shadersIdsByName;
|
||||||
|
if (shadersIdsByName.empty()) {
|
||||||
|
for (const auto id : shader::allShaders()) {
|
||||||
|
const auto& shaderSource = shader::Source::get(id);
|
||||||
|
shadersIdsByName[shaderSource.name] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME support procedural shaders
|
// FIXME support procedural shaders
|
||||||
Shader::Type type = node[keys::type];
|
Shader::Type type = node[keys::type];
|
||||||
std::string name = node[keys::name];
|
std::string name = node[keys::name];
|
||||||
uint32_t id = node[keys::id];
|
// Using the serialized ID is bad, because it's generated at
|
||||||
|
// cmake time, and can change across platforms or when
|
||||||
|
// shaders are added or removed
|
||||||
|
// uint32_t id = node[keys::id];
|
||||||
|
|
||||||
|
uint32_t id = shadersIdsByName[name];
|
||||||
ShaderPointer result;
|
ShaderPointer result;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
//case Shader::Type::GEOMETRY:
|
//case Shader::Type::GEOMETRY:
|
||||||
|
|
Loading…
Reference in a new issue