mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
d3d: Actually upload the clut texture.
This commit is contained in:
1 parent
78190f3e8c
commit
1dfecbf2b8
5 files changed
+23
-11
No files matched your search
+1
-2
@@ -1378,9 +1378,8 @@ if(ARMV7)
|
||||
set(GPU_NEON GPU/Common/TextureDecoderNEON.cpp)
|
||||
endif()
|
||||
add_library(GPU OBJECT
|
||||
GPU/Common/DepalettizeShaderCommon.h
|
||||
GPU/Common/DepalettizeShaderCommon.cpp
|
||||
GPU/Common/FramebufferCommon.h
|
||||
GPU/Common/DepalettizeShaderCommon.h
|
||||
GPU/Common/FramebufferCommon.cpp
|
||||
GPU/Common/FramebufferCommon.h
|
||||
GPU/Common/GPUDebugInterface.h
|
||||
|
||||
@@ -15,8 +15,6 @@
|
||||
// Official git repository and contact information can be found at
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "Common/Log.h"
|
||||
|
||||
@@ -93,10 +93,25 @@ LPDIRECT3DTEXTURE9 DepalShaderCacheDX9::GetClutTexture(const u32 clutID, u32 *ra
|
||||
|
||||
HRESULT hr = pD3Ddevice->CreateTexture(texturePixels, 1, 1, usage, (D3DFORMAT)D3DFMT(dstFmt), pool, &tex->texture, NULL);
|
||||
if (FAILED(hr)) {
|
||||
INFO_LOG(G3D, "Failed to create D3D texture for depal");
|
||||
ERROR_LOG(G3D, "Failed to create D3D texture for depal");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
D3DLOCKED_RECT rect;
|
||||
hr = tex->texture->LockRect(0, &rect, NULL, 0);
|
||||
if (FAILED(hr)) {
|
||||
ERROR_LOG(G3D, "Failed to lock D3D texture for depal");
|
||||
return nullptr;
|
||||
}
|
||||
// Regardless of format, the CLUT should always be 1024 bytes.
|
||||
memcpy(rect.pBits, rawClut, 1024);
|
||||
tex->texture->UnlockRect(0);
|
||||
|
||||
pD3Ddevice->SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
pD3Ddevice->SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
pD3Ddevice->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_POINT);
|
||||
pD3Ddevice->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
|
||||
|
||||
tex->lastFrame = gpuStats.numFlips;
|
||||
texCache_[realClutID] = tex;
|
||||
return tex->texture;
|
||||
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
|
||||
void BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst);
|
||||
|
||||
void BindFramebufferColor(int stage, VirtualFramebuffer *framebuffer, bool skipCopy);
|
||||
void BindFramebufferColor(int stage, VirtualFramebuffer *framebuffer, bool skipCopy = false);
|
||||
|
||||
virtual void ReadFramebufferToMemory(VirtualFramebuffer *vfb, bool sync, int x, int y, int w, int h) override;
|
||||
|
||||
|
||||
@@ -911,10 +911,10 @@ void TextureCacheDX9::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebu
|
||||
fbo_bind_as_render_target(depalFBO);
|
||||
|
||||
static const float pos[12 + 8] = {
|
||||
-1, -1, -1, 0, 0,
|
||||
1, -1, -1, 1, 0,
|
||||
1, 1, -1, 1, 1,
|
||||
-1, 1, -1, 0, 1,
|
||||
-1, -1, -1, 0, 0,
|
||||
1, -1, -1, 1, 0,
|
||||
1, 1, -1, 1, 1,
|
||||
-1, 1, -1, 0, 1,
|
||||
};
|
||||
static const u16 indices[4] = { 0, 1, 3, 2 };
|
||||
|
||||
@@ -957,7 +957,7 @@ void TextureCacheDX9::SetTextureFramebuffer(TexCacheEntry *entry, VirtualFramebu
|
||||
gstate_c.textureSimpleAlpha = alphaStatus == TexCacheEntry::STATUS_ALPHA_SIMPLE;
|
||||
} else {
|
||||
entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE;
|
||||
framebufferManager_->BindFramebufferColor(0, framebuffer, false);
|
||||
framebufferManager_->BindFramebufferColor(0, framebuffer);
|
||||
|
||||
gstate_c.textureFullAlpha = gstate.getTextureFormat() == GE_TFMT_5650;
|
||||
gstate_c.textureSimpleAlpha = gstate_c.textureFullAlpha;
|
||||
|
||||
Reference in new issue
Block a user