mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-15 19:28:29 +12:00
Fix incorrect streamout buffer index in GS + refactor various code (#258)
This commit is contained in:
parent
4a3d02db55
commit
03f5967408
45 changed files with 70 additions and 92 deletions
|
@ -101,7 +101,7 @@ namespace Espresso
|
|||
|
||||
struct BOField
|
||||
{
|
||||
BOField() {};
|
||||
BOField() = default;
|
||||
BOField(uint8 bo) : bo(bo) {};
|
||||
|
||||
bool conditionInverted() const
|
||||
|
|
|
@ -10,7 +10,7 @@ class PPCFunctionBoundaryTracker
|
|||
public:
|
||||
struct PPCRange_t
|
||||
{
|
||||
PPCRange_t() {};
|
||||
PPCRange_t() = default;
|
||||
PPCRange_t(uint32 _startAddress) : startAddress(_startAddress) {};
|
||||
|
||||
uint32 startAddress{};
|
||||
|
|
|
@ -197,7 +197,7 @@ struct raLivenessLocation_t
|
|||
bool isRead;
|
||||
bool isWrite;
|
||||
|
||||
raLivenessLocation_t() {};
|
||||
raLivenessLocation_t() = default;
|
||||
|
||||
raLivenessLocation_t(sint32 index, bool isRead, bool isWrite)
|
||||
: index(index), isRead(isRead), isWrite(isWrite) {};
|
||||
|
|
|
@ -29,7 +29,7 @@ class IntervalTree2
|
|||
|
||||
struct InternalRange
|
||||
{
|
||||
InternalRange() {};
|
||||
InternalRange() = default;
|
||||
InternalRange(TRangeData _rangeBegin, TRangeData _rangeEnd) : rangeBegin(_rangeBegin), rangeEnd(_rangeEnd) { cemu_assert_debug(_rangeBegin < _rangeEnd); };
|
||||
|
||||
TRangeData rangeBegin;
|
||||
|
|
|
@ -208,7 +208,7 @@ LatteParsedGSCopyShader* LatteGSCopyShaderParser_parse(uint8* programData, uint3
|
|||
uint32 bufferIndex;
|
||||
if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM0_WRITE)
|
||||
bufferIndex = 0;
|
||||
else if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM0_WRITE)
|
||||
else if (cf_inst23_7 == GPU7_CF_INST_MEM_STREAM1_WRITE)
|
||||
bufferIndex = 1;
|
||||
else
|
||||
cemu_assert_debug(false);
|
||||
|
|
|
@ -493,17 +493,18 @@ bool LatteMRT::UpdateCurrentFBO()
|
|||
|
||||
sint32 colorAttachmentWidth;
|
||||
sint32 colorAttachmentHeight;
|
||||
|
||||
LatteTexture_getSize(colorAttachmentView->baseTexture, &colorAttachmentWidth, &colorAttachmentHeight, nullptr, colorAttachmentView->firstMip);
|
||||
|
||||
// set effective size
|
||||
sint32 effectiveWidth, effectiveHeight;
|
||||
LatteTexture_getEffectiveSize(colorAttachmentView->baseTexture, &effectiveWidth, &effectiveHeight, nullptr, colorAttachmentView->firstMip);
|
||||
if( rtEffectiveSize->width == 0 && rtEffectiveSize->height == 0 )
|
||||
if (rtEffectiveSize->width == 0 && rtEffectiveSize->height == 0)
|
||||
{
|
||||
rtEffectiveSize->width = effectiveWidth;
|
||||
rtEffectiveSize->height = effectiveHeight;
|
||||
}
|
||||
else if( rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight )
|
||||
else if (rtEffectiveSize->width != effectiveWidth && rtEffectiveSize->height != effectiveHeight)
|
||||
{
|
||||
#ifndef PUBLIC_RELEASE
|
||||
forceLog_printf("Color buffer size mismatch (%dx%d). Effective size: %dx%d Real size: %dx%d Mismatching texture: %08x %dx%d fmt %04x", rtEffectiveSize->width, rtEffectiveSize->height, effectiveWidth, effectiveHeight, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, colorAttachmentView->baseTexture->physAddress, colorAttachmentView->baseTexture->width, colorAttachmentView->baseTexture->height, (uint32)colorAttachmentView->baseTexture->format);
|
||||
|
|
|
@ -609,7 +609,7 @@ void LatteShaderCache_loadOrCompileSeparableShader(LatteDecompilerShader* shader
|
|||
|
||||
bool LatteShaderCache_readSeparableVertexShader(MemStreamReader& streamReader, uint8 version)
|
||||
{
|
||||
std::unique_ptr<LatteContextRegister> lcr(new LatteContextRegister());
|
||||
auto lcr = std::make_unique<LatteContextRegister>();
|
||||
if (version != 1)
|
||||
return false;
|
||||
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
||||
|
@ -658,7 +658,7 @@ bool LatteShaderCache_readSeparableGeometryShader(MemStreamReader& streamReader,
|
|||
{
|
||||
if (version != 1)
|
||||
return false;
|
||||
std::unique_ptr<LatteContextRegister> lcr(new LatteContextRegister());
|
||||
auto lcr = std::make_unique<LatteContextRegister>();
|
||||
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
||||
uint64 shaderAuxHash = streamReader.readBE<uint64>();
|
||||
uint32 vsRingParameterCount = streamReader.readBE<uint16>();
|
||||
|
@ -698,7 +698,7 @@ bool LatteShaderCache_readSeparablePixelShader(MemStreamReader& streamReader, ui
|
|||
{
|
||||
if (version != 1)
|
||||
return false;
|
||||
std::unique_ptr<LatteContextRegister> lcr(new LatteContextRegister());
|
||||
auto lcr = std::make_unique<LatteContextRegister>();
|
||||
uint64 shaderBaseHash = streamReader.readBE<uint64>();
|
||||
uint64 shaderAuxHash = streamReader.readBE<uint64>();
|
||||
bool usesGeometryShader = streamReader.readBE<uint8>() != 0;
|
||||
|
|
|
@ -214,6 +214,10 @@ void VulkanPipelineStableCache::LoadPipelineFromCache(std::span<uint8> fileData)
|
|||
if (!DeserializePipeline(streamReader, *cachedPipeline))
|
||||
{
|
||||
// failed to deserialize
|
||||
s_spinlockSharedInternal.acquire();
|
||||
delete lcr;
|
||||
delete cachedPipeline;
|
||||
s_spinlockSharedInternal.release();
|
||||
return;
|
||||
}
|
||||
// restored register view from compacted state
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
struct VulkanPipelineHash
|
||||
{
|
||||
VulkanPipelineHash() {};
|
||||
VulkanPipelineHash() = default;
|
||||
VulkanPipelineHash(uint64 h0, uint64 h1) : h0(h0), h1(h1) {};
|
||||
|
||||
uint64 h0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue