mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-25 18:46:55 +01:00
Latte/Vulkan: Set RoundingModeRTE for all float types
Seems like GLSL's unpackHalf2x16() is affected by the 16bit rounding setting
This commit is contained in:
parent
f8ea594447
commit
466ad8d35e
@ -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<LatteDecompilerRemappedUniformEntry_t> list_remappedUniformEntries;
|
||||
// analyzer stage (textures)
|
||||
std::bitset<LATTE_NUM_MAX_TEX_UNITS> 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<LATTE_NUM_STREAMOUT_BUFFER> 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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user