Permalink
Browse files

Merge pull request #10215 from unknownbrackets/minor

Improvements for things found in reporting
  • Loading branch information...
hrydgard committed Nov 30, 2017
2 parents 7b2ad5f + 7339c6c commit 24e5fbc1156d428a525f4202eecda45a8687dcb2
@@ -1148,7 +1148,7 @@ static Module *__KernelLoadELFFromPtr(const u8 *ptr, size_t elfSize, u32 loadAdd
// DO NOT change to else if, see above.
if (*magicPtr != 0x464c457f) {
ERROR_LOG_REPORT(SCEMODULE, "Wrong magic number %08x", *magicPtr);
ERROR_LOG(SCEMODULE, "Wrong magic number %08x", *magicPtr);
*error_string = "File corrupt";
if (newptr)
delete [] newptr;
@@ -2043,7 +2043,7 @@ void FramebufferManagerCommon::ReadFramebufferToMemory(VirtualFramebuffer *vfb,
if (x + w >= vfb->bufferWidth) {
w = vfb->bufferWidth - x;
}
if (vfb) {
if (vfb && vfb->fbo) {
// We'll pseudo-blit framebuffers here to get a resized version of vfb.
OptimizeDownloadRange(vfb, x, y, w, h);
if (vfb->renderWidth == vfb->width && vfb->renderHeight == vfb->height) {
@@ -574,7 +574,7 @@ void FramebufferManagerD3D11::BindFramebufferAsColorTexture(int stage, VirtualFr
} else if (framebuffer != currentRenderVfb_) {
draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0);
} else {
ERROR_LOG_REPORT_ONCE(d3d11SelfTexture, G3D, "Attempting to texture to target");
ERROR_LOG_REPORT_ONCE(d3d11SelfTexture, G3D, "Attempting to texture from target (src=%08x / target=%08x / flags=%d)", framebuffer->fb_address, currentRenderVfb_->fb_address, flags);
// Badness on D3D11 to bind the currently rendered-to framebuffer as a texture.
ID3D11ShaderResourceView *view = nullptr;
context_->PSSetShaderResources(stage, 1, &view);
@@ -43,7 +43,7 @@
#include "GPU/GLES/DrawEngineGLES.h"
#include "FramebufferManagerGLES.h"
Shader::Shader(const char *code, uint32_t glShaderType, bool useHWTransform, uint32_t attrMask, uint64_t uniformMask)
Shader::Shader(const ShaderID &id, const char *code, uint32_t glShaderType, bool useHWTransform, uint32_t attrMask, uint64_t uniformMask)
: failed_(false), useHWTransform_(useHWTransform), attrMask_(attrMask), uniformMask_(uniformMask) {
PROFILE_THIS_SCOPE("shadercomp");
isFragment_ = glShaderType == GL_FRAGMENT_SHADER;
@@ -70,10 +70,12 @@ Shader::Shader(const char *code, uint32_t glShaderType, bool useHWTransform, uin
ELOG("Error in shader compilation! %s\n", infoLog);
ELOG("Shader source:\n%s\n", (const char *)code);
#endif
ERROR_LOG(G3D, "Error in shader compilation!\n");
ERROR_LOG(G3D, "Info log: %s\n", infoLog);
std::string desc = GetShaderString(SHADER_STRING_SHORT_DESC, id);
ERROR_LOG(G3D, "Error in shader compilation for: %s", desc.c_str());
ERROR_LOG(G3D, "Info log: %s", infoLog);
ERROR_LOG(G3D, "Shader source:\n%s\n", (const char *)code);
Reporting::ReportMessage("Error in shader compilation: info: %s / code: %s", infoLog, (const char *)code);
Reporting::ReportMessage("Error in shader compilation: info: %s\n%s\n%s", infoLog, desc.c_str(), (const char *)code);
#ifdef SHADERLOG
OutputDebugStringUTF8(infoLog);
#endif
@@ -141,13 +143,17 @@ LinkedShader::LinkedShader(ShaderID VSID, Shader *vs, ShaderID FSID, Shader *fs,
ELOG("Could not link program:\n %s", buf);
#endif
ERROR_LOG(G3D, "Could not link program:\n %s", buf);
ERROR_LOG(G3D, "VS desc:\n%s\n", vs->GetShaderString(SHADER_STRING_SHORT_DESC, VSID).c_str());
ERROR_LOG(G3D, "FS desc:\n%s\n", fs->GetShaderString(SHADER_STRING_SHORT_DESC, FSID).c_str());
std::string vs_desc = vs->GetShaderString(SHADER_STRING_SHORT_DESC, VSID);
std::string fs_desc = fs->GetShaderString(SHADER_STRING_SHORT_DESC, FSID);
std::string vs_source = vs->GetShaderString(SHADER_STRING_SOURCE_CODE, VSID);
std::string fs_source = fs->GetShaderString(SHADER_STRING_SOURCE_CODE, FSID);
ERROR_LOG(G3D, "VS desc:\n%s", vs_desc.c_str());
ERROR_LOG(G3D, "FS desc:\n%s", fs_desc.c_str());
ERROR_LOG(G3D, "VS:\n%s\n", vs_source.c_str());
ERROR_LOG(G3D, "FS:\n%s\n", fs_source.c_str());
Reporting::ReportMessage("Error in shader program link: info: %s / fs: %s / vs: %s", buf, fs_source.c_str(), vs_source.c_str());
Reporting::ReportMessage("Error in shader program link: info: %s\nfs: %s\n%s\nvs: %s\n%s", buf, fs_desc.c_str(), fs_source.c_str(), vs_desc.c_str(), vs_source.c_str());
#ifdef SHADERLOG
OutputDebugStringUTF8(buf);
OutputDebugStringUTF8(vs_source.c_str());
@@ -738,15 +744,15 @@ Shader *ShaderManagerGLES::CompileFragmentShader(ShaderID FSID) {
if (!GenerateFragmentShader(FSID, codeBuffer_, &uniformMask)) {
return nullptr;
}
return new Shader(codeBuffer_, GL_FRAGMENT_SHADER, false, 0, uniformMask);
return new Shader(FSID, codeBuffer_, GL_FRAGMENT_SHADER, false, 0, uniformMask);
}
Shader *ShaderManagerGLES::CompileVertexShader(ShaderID VSID) {
bool useHWTransform = VSID.Bit(VS_BIT_USE_HW_TRANSFORM);
uint32_t attrMask;
uint64_t uniformMask;
GenerateVertexShader(VSID, codeBuffer_, &attrMask, &uniformMask);
return new Shader(codeBuffer_, GL_VERTEX_SHADER, useHWTransform, attrMask, uniformMask);
return new Shader(VSID, codeBuffer_, GL_VERTEX_SHADER, useHWTransform, attrMask, uniformMask);
}
Shader *ShaderManagerGLES::ApplyVertexShader(int prim, u32 vertType, ShaderID *VSID) {
@@ -797,7 +803,7 @@ Shader *ShaderManagerGLES::ApplyVertexShader(int prim, u32 vertType, ShaderID *V
uint32_t attrMask;
uint64_t uniformMask;
GenerateVertexShader(vsidTemp, codeBuffer_, &attrMask, &uniformMask);
vs = new Shader(codeBuffer_, GL_VERTEX_SHADER, false, attrMask, uniformMask);
vs = new Shader(vsidTemp, codeBuffer_, GL_VERTEX_SHADER, false, attrMask, uniformMask);
}
vsCache_.Insert(*VSID, vs);
@@ -124,7 +124,7 @@ class LinkedShader {
class Shader {
public:
Shader(const char *code, uint32_t glShaderType, bool useHWTransform, uint32_t attrMask, uint64_t uniformMask);
Shader(const ShaderID &id, const char *code, uint32_t glShaderType, bool useHWTransform, uint32_t attrMask, uint64_t uniformMask);
~Shader();
uint32_t shader;
@@ -450,7 +450,7 @@ VkImageView FramebufferManagerVulkan::BindFramebufferAsColorTexture(int stage, V
draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0);
return (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_TEXTURE0_IMAGEVIEW);
} else {
ERROR_LOG_REPORT_ONCE(vulkanSelfTexture, G3D, "Attempting to texture from target");
ERROR_LOG_REPORT_ONCE(vulkanSelfTexture, G3D, "Attempting to texture from target (src=%08x / target=%08x / flags=%d)", framebuffer->fb_address, currentRenderVfb_->fb_address, flags);
// To do this safely in Vulkan, we need to use input attachments.
return VK_NULL_HANDLE;
}
@@ -1314,10 +1314,6 @@ EventReturn ListView::OnItemCallback(int num, EventParams &e) {
View *focused = GetFocusedView();
OnChoice.Trigger(ev);
CreateAllItems();
// TODO: At this point, focused may no longer exist, depending on what OnChoice.Trigger does.
// Disable the refocus feature for now.
// if (focused)
// SetFocusedView(e.v);
return EVENT_DONE;
}

0 comments on commit 24e5fbc

Please sign in to comment.