diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index bb59188e86..dd3eb2794e 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -255,8 +255,6 @@ std::string NativeQueryConfig(std::string query) { int max_res = std::max(System_GetPropertyInt(SYSPROP_DISPLAY_XRES), System_GetPropertyInt(SYSPROP_DISPLAY_YRES)) / 480 + 1; snprintf(temp, sizeof(temp), "%d", std::min(scale, max_res)); return std::string(temp); - } else if (query == "force44khz") { - return std::string("0"); } else if (query == "androidJavaGL") { // If we're using Vulkan, we say no... need C++ to use Vulkan. if (GetGPUBackend() == GPUBackend::VULKAN) { diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index 086371085d..1fafbf5de4 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -605,7 +605,7 @@ retry: extern "C" void Java_org_ppsspp_ppsspp_NativeApp_audioInit(JNIEnv *, jclass) { sampleRate = optimalSampleRate; - if (NativeQueryConfig("force44khz") != "0" || optimalSampleRate == 0) { + if (optimalSampleRate == 0) { sampleRate = 44100; } if (optimalFramesPerBuffer > 0) { diff --git a/ext/native/thin3d/thin3d.h b/ext/native/thin3d/thin3d.h index f78dbf8f87..862a6d2998 100644 --- a/ext/native/thin3d/thin3d.h +++ b/ext/native/thin3d/thin3d.h @@ -136,6 +136,7 @@ enum class Primitive { TRIANGLE_STRIP_ADJ, UNDEFINED, + PRIMITIVE_TYPE_COUNT, }; enum VertexShaderPreset : int { diff --git a/ext/native/thin3d/thin3d_gl.cpp b/ext/native/thin3d/thin3d_gl.cpp index 47d54cd354..fda3a40f38 100644 --- a/ext/native/thin3d/thin3d_gl.cpp +++ b/ext/native/thin3d/thin3d_gl.cpp @@ -963,6 +963,15 @@ Pipeline *OpenGLContext::CreateGraphicsPipeline(const PipelineDesc &desc) { ELOG("Pipeline requires at least one shader"); return nullptr; } + if ((int)desc.prim >= (int)Primitive::PRIMITIVE_TYPE_COUNT) { + ELOG("Invalid primitive type"); + return nullptr; + } + if (!desc.depthStencil || !desc.blend || !desc.raster || !desc.inputLayout) { + ELOG("Incomplete prim desciption"); + return nullptr; + } + OpenGLPipeline *pipeline = new OpenGLPipeline(&renderManager_); for (auto iter : desc.shaders) { if (iter) { @@ -1046,9 +1055,21 @@ ShaderModule *OpenGLContext::CreateShaderModule(ShaderStage stage, ShaderLanguag bool OpenGLPipeline::LinkShaders() { std::vector linkShaders; - for (auto iter : shaders) { - linkShaders.push_back(iter->GetShader()); + for (auto shaderModule : shaders) { + if (shaderModule) { + GLRShader *shader = shaderModule->GetShader(); + if (shader) { + linkShaders.push_back(shader); + } else { + ELOG("LinkShaders: Bad shader module"); + return false; + } + } else { + ELOG("LinkShaders: Bad shader in module"); + return false; + } } + std::vector semantics; // Bind all the common vertex data points. Mismatching ones will be ignored. semantics.push_back({ SEM_POSITION, "Position" });