Don't call functions in asserts, they get compiled out in release...

This commit is contained in:
Henrik Rydgård 2017-10-20 14:45:00 +02:00
parent 45743642a9
commit b9ba525de1
9 changed files with 23 additions and 12 deletions

View File

@ -324,7 +324,8 @@ void PPSSPP_UWPMain::LoadStorageFile(StorageFile ^file) {
UWPGraphicsContext::UWPGraphicsContext(std::shared_ptr<DX::DeviceResources> resources) {
draw_ = Draw::T3DCreateD3D11Context(
resources->GetD3DDevice(), resources->GetD3DDeviceContext(), resources->GetD3DDevice(), resources->GetD3DDeviceContext(), resources->GetDeviceFeatureLevel(), 0);
assert(draw_->CreatePresets());
bool success = draw_->CreatePresets();
assert(success);
}
void UWPGraphicsContext::Shutdown() {

View File

@ -140,7 +140,8 @@ bool D3D11Context::Init(HINSTANCE hInst, HWND wnd, std::string *error_message) {
#endif
draw_ = Draw::T3DCreateD3D11Context(device_, context_, device1_, context1_, featureLevel_, hWnd_);
assert(draw_->CreatePresets()); // If we can run D3D11, there's a compiler installed. I think.
bool success = draw_->CreatePresets(); // If we can run D3D11, there's a compiler installed. I think.
assert(success);
int width;
int height;

View File

@ -357,7 +357,8 @@ bool WindowsGLContext::Init(HINSTANCE hInst, HWND window, std::string *error_mes
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets()); // if we get this far, there will always be a GLSL compiler capable of compiling these.
bool success = draw_->CreatePresets(); // if we get this far, there will always be a GLSL compiler capable of compiling these.
assert(success);
CHECK_GL_ERROR_IF_DEBUG();
return true; // Success
}

View File

@ -203,8 +203,9 @@ bool WindowsVulkanContext::Init(HINSTANCE hInst, HWND hWnd, std::string *error_m
}
draw_ = Draw::T3DCreateVulkanContext(g_Vulkan);
assert(draw_->CreatePresets()); // Doesn't fail, we include the compiler.
return true;
bool success = draw_->CreatePresets();
assert(success); // Doesn't fail, we include the compiler.
return success;
}
void WindowsVulkanContext::Shutdown() {

View File

@ -133,7 +133,8 @@ bool AndroidEGLGraphicsContext::Init(ANativeWindow *wnd, int backbufferWidth, in
gl->MakeCurrent();
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets()); // There will always be a GLSL compiler capable of compiling these.
bool success = draw_->CreatePresets(); // There will always be a GLSL compiler capable of compiling these.
assert(success);
return true;
}
@ -158,7 +159,8 @@ public:
AndroidJavaEGLGraphicsContext() {
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets());
bool success = draw_->CreatePresets();
assert(success);
}
~AndroidJavaEGLGraphicsContext() {
delete draw_;
@ -312,7 +314,8 @@ bool AndroidVulkanContext::Init(ANativeWindow *wnd, int desiredBackbufferSizeX,
}
g_Vulkan->InitObjects(true);
draw_ = Draw::T3DCreateVulkanContext(g_Vulkan);
assert(draw_->CreatePresets()); // Doesn't fail, we ship the compiler.
bool success = draw_->CreatePresets(); // Doesn't fail, we ship the compiler.
assert(success);
return true;
}

View File

@ -52,7 +52,8 @@ public:
GLDummyGraphicsContext() {
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets());
bool success = draw_->CreatePresets();
assert(success);
}
~GLDummyGraphicsContext() { delete draw_; }

View File

@ -44,7 +44,8 @@ class QtDummyGraphicsContext : public DummyGraphicsContext {
public:
QtDummyGraphicsContext() {
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets());
bool success = draw_->CreatePresets();
assert(success);
}
~QtDummyGraphicsContext() {
delete draw_;

View File

@ -55,7 +55,8 @@ public:
GLDummyGraphicsContext() {
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets());
bool success = draw_->CreatePresets();
assert(success);
}
~GLDummyGraphicsContext() { delete draw_; }

View File

@ -39,7 +39,8 @@ public:
IOSDummyGraphicsContext() {
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext();
assert(draw_->CreatePresets());
bool success = draw_->CreatePresets();
assert(success);
}
~IOSDummyGraphicsContext() {
delete draw_;