mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-16 11:48:28 +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
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue