diff --git a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h index 90c92eac..3264f5d3 100644 --- a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h +++ b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompiler.h @@ -150,50 +150,50 @@ struct LatteDecompilerShader { LatteDecompilerShader(LatteConst::ShaderType shaderType) : shaderType(shaderType) {} - LatteDecompilerShader* next; + LatteDecompilerShader* next{nullptr}; LatteConst::ShaderType shaderType; - uint64 baseHash; - uint64 auxHash; + uint64 baseHash{0}; + uint64 auxHash{0}; // vertex shader struct LatteFetchShader* compatibleFetchShader{}; // error tracking - bool hasError; // if set, the shader cannot be used + bool hasError{false}; // if set, the shader cannot be used // optimized access / iteration // list of uniform buffers used uint8 uniformBufferList[LATTE_NUM_MAX_UNIFORM_BUFFERS]; - uint8 uniformBufferListCount; + uint8 uniformBufferListCount{ 0 }; // list of used texture units (faster access than iterating textureUnitMask) uint8 textureUnitList[LATTE_NUM_MAX_TEX_UNITS]; - uint8 textureUnitListCount; + uint8 textureUnitListCount{ 0 }; // input - Latte::E_DIM textureUnitDim[LATTE_NUM_MAX_TEX_UNITS]; // dimension of texture unit, from the currently set texture + Latte::E_DIM textureUnitDim[LATTE_NUM_MAX_TEX_UNITS]{}; // dimension of texture unit, from the currently set texture bool textureIsIntegerFormat[LATTE_NUM_MAX_TEX_UNITS]{}; // analyzer stage (uniforms) - uint8 uniformMode; // determines how uniforms are managed within the shader (see LATTE_DECOMPILER_UNIFORM_MODE_* constants) - uint64 uniformDataHash64[2]; // used to avoid redundant calls to glUniform* + uint8 uniformMode{0}; // determines how uniforms are managed within the shader (see LATTE_DECOMPILER_UNIFORM_MODE_* constants) + uint64 uniformDataHash64[2]{0}; // used to avoid redundant calls to glUniform* std::vector list_remappedUniformEntries; // analyzer stage (textures) std::bitset textureUnitMask2; - uint16 textureUnitSamplerAssignment[LATTE_NUM_MAX_TEX_UNITS]; // LATTE_DECOMPILER_SAMPLER_NONE means undefined - bool textureUsesDepthCompare[LATTE_NUM_MAX_TEX_UNITS]; + uint16 textureUnitSamplerAssignment[LATTE_NUM_MAX_TEX_UNITS]{ 0 }; // LATTE_DECOMPILER_SAMPLER_NONE means undefined + bool textureUsesDepthCompare[LATTE_NUM_MAX_TEX_UNITS]{}; // analyzer stage (pixel outputs) - uint32 pixelColorOutputMask; // from LSB to MSB, 1 bit per written output. 1 if written (indices of color attachments) + uint32 pixelColorOutputMask{ 0 }; // from LSB to MSB, 1 bit per written output. 1 if written (indices of color attachments) // analyzer stage (geometry shader parameters/inputs) - uint32 ringParameterCount; - uint32 ringParameterCountFromPrevStage; // used in geometry shader to hold VS ringParameterCount + uint32 ringParameterCount{ 0 }; + uint32 ringParameterCountFromPrevStage{ 0 }; // used in geometry shader to hold VS ringParameterCount // analyzer stage (misc) std::bitset streamoutBufferWriteMask; - bool hasStreamoutBufferWrite; + bool hasStreamoutBufferWrite{ false }; // output code - class StringBuf* strBuf_shaderSource{nullptr}; + class StringBuf* strBuf_shaderSource{ nullptr }; // separable shaders - RendererShader* shader; - bool isCustomShader; + RendererShader* shader{ nullptr }; + bool isCustomShader{ false }; - uint32 outputParameterMask; + uint32 outputParameterMask{ 0 }; // resource mapping (binding points) - LatteDecompilerShaderResourceMapping resourceMapping; + LatteDecompilerShaderResourceMapping resourceMapping{}; // uniforms struct { @@ -210,7 +210,7 @@ struct LatteDecompilerShader sint32 loc_verticesPerInstance; sint32 loc_streamoutBufferBase[LATTE_NUM_STREAMOUT_BUFFER]; sint32 uniformRangeSize; // entire size of uniform variable block - }uniform; + }uniform{ 0 }; // fast access struct _RemappedUniformBufferGroup { diff --git a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp index 581bfee5..0bd4eb6f 100644 --- a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp +++ b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerEmitGLSLHeader.hpp @@ -309,7 +309,10 @@ namespace LatteDecompiler if (decompilerContext->options->spirvInstrinsics.hasRoundingModeRTEFloat32) { src->add("#extension GL_EXT_spirv_intrinsics: enable" _CRLF); - src->add("spirv_execution_mode(4462, 32);" _CRLF); // RoundingModeRTE 32 + // set RoundingModeRTE + src->add("spirv_execution_mode(4462, 16);" _CRLF); + src->add("spirv_execution_mode(4462, 32);" _CRLF); + src->add("spirv_execution_mode(4462, 64);" _CRLF); } src->add("#else" _CRLF); // OpenGL defines diff --git a/src/Cafe/HW/Latte/Renderer/RendererShader.cpp b/src/Cafe/HW/Latte/Renderer/RendererShader.cpp index 67b76b4e..f66dc9f4 100644 --- a/src/Cafe/HW/Latte/Renderer/RendererShader.cpp +++ b/src/Cafe/HW/Latte/Renderer/RendererShader.cpp @@ -17,7 +17,7 @@ uint32 RendererShader::GeneratePrecompiledCacheId() v += (EMULATOR_VERSION_MINOR * 100u); // settings that can influence shaders - v += (uint32)g_current_game_profile->GetAccurateShaderMul() * 133; // this option modifies shaders + v += (uint32)g_current_game_profile->GetAccurateShaderMul() * 133; return v; } diff --git a/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp b/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp index 718bca3a..5b79ffd8 100644 --- a/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp +++ b/src/gui/windows/TextureRelationViewer/TextureRelationWindow.cpp @@ -228,7 +228,7 @@ void TextureRelationViewerWindow::_setTextureRelationListItemTexture(wxListCtrl* uiList->SetItem(rowIndex, columnIndex, tempStr); columnIndex++; // tilemode - sprintf(tempStr, "%d", texInfo->tileMode); + sprintf(tempStr, "%d", (int)texInfo->tileMode); uiList->SetItem(rowIndex, columnIndex, tempStr); columnIndex++; // sliceRange