mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
GL: Add some paranoid checks. Remove a useless option.
This commit is contained in:
parent
7f595623b1
commit
06d57b1656
4 changed files with 25 additions and 5 deletions
|
@ -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) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -136,6 +136,7 @@ enum class Primitive {
|
|||
TRIANGLE_STRIP_ADJ,
|
||||
|
||||
UNDEFINED,
|
||||
PRIMITIVE_TYPE_COUNT,
|
||||
};
|
||||
|
||||
enum VertexShaderPreset : int {
|
||||
|
|
|
@ -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<GLRShader *> 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<GLRProgram::Semantic> semantics;
|
||||
// Bind all the common vertex data points. Mismatching ones will be ignored.
|
||||
semantics.push_back({ SEM_POSITION, "Position" });
|
||||
|
|
Loading…
Add table
Reference in a new issue