Fix constbuf updates to actually increment the write offset

Uses the register directly now as when we modify it we want the changes to be visible from macros too.
This commit is contained in:
Billy Laws 2022-03-16 20:49:25 +00:00 committed by PixelyIon
parent d2f3479610
commit 7e088ca465
2 changed files with 6 additions and 15 deletions

View File

@ -609,8 +609,6 @@ namespace skyline::gpu::interconnect {
};
ConstantBuffer constantBufferSelector; //!< The constant buffer selector is used to bind a constant buffer to a stage or update data in it
u32 constantBufferUpdateOffset{}; //!< The offset at which any inline constant buffer updata data is written
public:
void SetConstantBufferSelectorSize(u32 size) {
constantBufferSelector.size = size;
@ -644,13 +642,9 @@ namespace skyline::gpu::interconnect {
return constantBufferSelector;
}
void SetConstantBufferUpdateOffset(u32 offset) {
constantBufferUpdateOffset = offset;
}
void ConstantBufferUpdate(u32 data) {
void ConstantBufferUpdate(u32 data, u32 offset) {
auto constantBuffer{GetConstantBufferSelector().value()};
constantBuffer.Write(data, constantBufferUpdateOffset);
constantBuffer.Write(data, offset);
}
/* Shader Program */

View File

@ -570,10 +570,6 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
context.SetTexturePoolMaximumIndex(maximumIndex);
})
MAXWELL3D_STRUCT_CASE(constantBufferUpdate, offset, {
context.SetConstantBufferUpdateOffset(offset);
})
default:
break;
}
@ -665,7 +661,8 @@ namespace skyline::soc::gm20b::engine::maxwell3d {
#define CBUF_UPDATE_CALLBACKS(z, index, data_) \
MAXWELL3D_STRUCT_ARRAY_CASE(constantBufferUpdate, data, index, { \
context.ConstantBufferUpdate(data); \
context.ConstantBufferUpdate(data, registers.constantBufferUpdate->offset); \
registers.constantBufferUpdate->offset += 4; \
})
BOOST_PP_REPEAT(16, CBUF_UPDATE_CALLBACKS, 0)