mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-01-08 08:00:44 +01:00
fix: viewport
This commit is contained in:
parent
db709c3495
commit
c6f66167a5
@ -146,19 +146,18 @@ void MetalRenderer::DrawBackbufferQuad(LatteTextureView* texView, RendererOutput
|
|||||||
sint32 imageX, sint32 imageY, sint32 imageWidth, sint32 imageHeight,
|
sint32 imageX, sint32 imageY, sint32 imageWidth, sint32 imageHeight,
|
||||||
bool padView, bool clearBackground)
|
bool padView, bool clearBackground)
|
||||||
{
|
{
|
||||||
if (m_drawableAcquired)
|
if (!m_drawableAcquired)
|
||||||
{
|
{
|
||||||
debug_printf("drawable already acquired this frame\n");
|
debug_printf("drawable already acquired this frame\n");
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_drawableAcquired = true;
|
m_drawableAcquired = true;
|
||||||
|
|
||||||
// Acquire drawable
|
// Acquire drawable
|
||||||
m_drawable = m_metalLayer->nextDrawable();
|
m_drawable = m_metalLayer->nextDrawable();
|
||||||
if (!m_drawable)
|
if (!m_drawable)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MTL::Texture* presentTexture = static_cast<LatteTextureViewMtl*>(texView)->GetTexture();
|
MTL::Texture* presentTexture = static_cast<LatteTextureViewMtl*>(texView)->GetTexture();
|
||||||
@ -204,7 +203,7 @@ void MetalRenderer::AppendOverlayDebugInfo()
|
|||||||
|
|
||||||
void MetalRenderer::renderTarget_setViewport(float x, float y, float width, float height, float nearZ, float farZ, bool halfZ)
|
void MetalRenderer::renderTarget_setViewport(float x, float y, float width, float height, float nearZ, float farZ, bool halfZ)
|
||||||
{
|
{
|
||||||
m_state.viewport = MTL::Viewport{x, y + height, width, -height, nearZ, farZ};
|
m_state.viewport = MTL::Viewport{x, y, width, height, nearZ, farZ};
|
||||||
if (m_encoderType == MetalEncoderType::Render)
|
if (m_encoderType == MetalEncoderType::Render)
|
||||||
{
|
{
|
||||||
static_cast<MTL::RenderCommandEncoder*>(m_commandEncoder)->setViewport(m_state.viewport);
|
static_cast<MTL::RenderCommandEncoder*>(m_commandEncoder)->setViewport(m_state.viewport);
|
||||||
|
@ -13,6 +13,7 @@ inline const char* presentLibrarySource = \
|
|||||||
" VertexOut out;\n" \
|
" VertexOut out;\n" \
|
||||||
" out.position = float4(positions[vid], 0.0, 1.0);\n" \
|
" out.position = float4(positions[vid], 0.0, 1.0);\n" \
|
||||||
" out.texCoord = positions[vid] * 0.5 + 0.5;\n" \
|
" out.texCoord = positions[vid] * 0.5 + 0.5;\n" \
|
||||||
|
" out.texCoord.y = 1.0 - out.texCoord.y;\n" \
|
||||||
"\n" \
|
"\n" \
|
||||||
" return out;\n" \
|
" return out;\n" \
|
||||||
"}\n" \
|
"}\n" \
|
||||||
|
Loading…
Reference in New Issue
Block a user