Skip to content

Commit

Permalink
WiiU: refactors.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaspider committed Sep 17, 2020
1 parent 25b6b6c commit 6f4cc47
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions GPU/GX2/FragmentShaderGeneratorGX2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ void FragmentShaderGeneratorGX2::Emit(const FShaderID &id, GX2PixelShader *ps) {
if (stencilToAlpha != REPLACE_ALPHA_NO) {
switch (replaceAlphaWithStencilType) {
case STENCIL_VALUE_UNIFORM: {
int stencilOffset = offsetof(UB_VS_FS_Base, stencil) & ~0xF;
int stencilElem = (offsetof(UB_VS_FS_Base, stencil) & 0xF) >> 2;
replacedAlpha = makeConstant(UB_Bindings::Base, stencilOffset)[0]((Channel)stencilElem);
replacedAlpha = KCacheChannel(UB_Bindings::Base, offsetof(UB_VS_FS_Base, stencil), this);
break;
}

Expand Down
4 changes: 2 additions & 2 deletions GPU/GX2/VertexShaderGeneratorGX2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ void VertexShaderGeneratorGX2::Emit(const VShaderID &id, GX2VertexShader *vs) {
Reg pos = allocImportReg(VSInput::POSITION);
Reg tmp = allocReg();

GX2Emitter::Constant proj = makeConstant(UB_Bindings::Base, offsetof(UB_VS_FS_Base, proj));
GX2Emitter::KCacheRegs proj = KCacheRegs(UB_Bindings::Base, offsetof(UB_VS_FS_Base, proj), this);
if (id.Bit(VS_BIT_IS_THROUGH))
proj = makeConstant(UB_Bindings::Base, offsetof(UB_VS_FS_Base, proj_through));
proj = KCacheRegs(UB_Bindings::Base, offsetof(UB_VS_FS_Base, proj_through), this);

MUL(___(x), pos(x), proj[0](x));
MUL(___(y), pos(x), proj[0](y));
Expand Down
2 changes: 1 addition & 1 deletion ext/wiiu

0 comments on commit 6f4cc47

Please sign in to comment.