mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
More texture work
This commit is contained in:
parent
dced84c9fc
commit
78d5fff2fe
3 changed files with 17 additions and 10 deletions
|
@ -320,7 +320,7 @@ static const CommandTableEntry commandTable[] = {
|
||||||
{ GE_CMD_BOUNDINGBOX, FLAG_EXECUTE, 0, &GPU_Vulkan::Execute_BoundingBox }, // + FLUSHBEFORE when we implement... or not, do we need to?
|
{ GE_CMD_BOUNDINGBOX, FLAG_EXECUTE, 0, &GPU_Vulkan::Execute_BoundingBox }, // + FLUSHBEFORE when we implement... or not, do we need to?
|
||||||
|
|
||||||
// Changing the vertex type requires us to flush.
|
// Changing the vertex type requires us to flush.
|
||||||
{ GE_CMD_VERTEXTYPE, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, 0, &GPU_Vulkan::Execute_VertexType },
|
{ GE_CMD_VERTEXTYPE, FLAG_FLUSHBEFOREONCHANGE | FLAG_EXECUTEONCHANGE, DIRTY_PROJMATRIX, &GPU_Vulkan::Execute_VertexType },
|
||||||
|
|
||||||
{ GE_CMD_BEZIER, FLAG_FLUSHBEFORE | FLAG_EXECUTE, 0, &GPU_Vulkan::Execute_Bezier },
|
{ GE_CMD_BEZIER, FLAG_FLUSHBEFORE | FLAG_EXECUTE, 0, &GPU_Vulkan::Execute_Bezier },
|
||||||
{ GE_CMD_SPLINE, FLAG_FLUSHBEFORE | FLAG_EXECUTE, 0, &GPU_Vulkan::Execute_Spline },
|
{ GE_CMD_SPLINE, FLAG_FLUSHBEFORE | FLAG_EXECUTE, 0, &GPU_Vulkan::Execute_Spline },
|
||||||
|
|
|
@ -34,6 +34,7 @@ void ConvertProjMatrixToVulkan(Matrix4x4 & in);
|
||||||
// Pretty much full. Will need more bits for more fine grained dirty tracking for lights.
|
// Pretty much full. Will need more bits for more fine grained dirty tracking for lights.
|
||||||
enum {
|
enum {
|
||||||
DIRTY_PROJMATRIX = (1 << 0),
|
DIRTY_PROJMATRIX = (1 << 0),
|
||||||
|
// 1 << 1 is free
|
||||||
DIRTY_FOGCOLOR = (1 << 2),
|
DIRTY_FOGCOLOR = (1 << 2),
|
||||||
DIRTY_FOGCOEF = (1 << 3),
|
DIRTY_FOGCOEF = (1 << 3),
|
||||||
DIRTY_TEXENV = (1 << 4),
|
DIRTY_TEXENV = (1 << 4),
|
||||||
|
@ -58,7 +59,7 @@ enum {
|
||||||
DIRTY_DEPTHRANGE = (1 << 20),
|
DIRTY_DEPTHRANGE = (1 << 20),
|
||||||
|
|
||||||
DIRTY_WORLDMATRIX = (1 << 21),
|
DIRTY_WORLDMATRIX = (1 << 21),
|
||||||
DIRTY_VIEWMATRIX = (1 << 22), // Maybe we'll fold this into projmatrix eventually
|
DIRTY_VIEWMATRIX = (1 << 22),
|
||||||
DIRTY_TEXMATRIX = (1 << 23),
|
DIRTY_TEXMATRIX = (1 << 23),
|
||||||
DIRTY_BONEMATRIX0 = (1 << 24),
|
DIRTY_BONEMATRIX0 = (1 << 24),
|
||||||
DIRTY_BONEMATRIX1 = (1 << 25),
|
DIRTY_BONEMATRIX1 = (1 << 25),
|
||||||
|
|
|
@ -1281,6 +1281,7 @@ void TextureCacheVulkan::SetTexture() {
|
||||||
lastBoundTexture = nullptr;
|
lastBoundTexture = nullptr;
|
||||||
}
|
}
|
||||||
delete entry->vkTex;
|
delete entry->vkTex;
|
||||||
|
entry->vkTex = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Clear the reliable bit if set.
|
// Clear the reliable bit if set.
|
||||||
|
@ -1363,10 +1364,6 @@ void TextureCacheVulkan::SetTexture() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
entry->vkTex = new CachedTextureVulkan();
|
|
||||||
|
|
||||||
lastBoundTexture = entry->vkTex;
|
|
||||||
|
|
||||||
// Adjust maxLevel to actually present levels..
|
// Adjust maxLevel to actually present levels..
|
||||||
bool badMipSizes = false;
|
bool badMipSizes = false;
|
||||||
for (u32 i = 0; i <= maxLevel; i++) {
|
for (u32 i = 0; i <= maxLevel; i++) {
|
||||||
|
@ -1443,9 +1440,17 @@ void TextureCacheVulkan::SetTexture() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ready or not, here I go...
|
// Ready or not, here I go...
|
||||||
|
if (replaceImages) {
|
||||||
|
if (!entry->vkTex) {
|
||||||
|
DebugBreak();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entry->vkTex = new CachedTextureVulkan();
|
||||||
entry->vkTex->texture_ = new VulkanTexture();
|
entry->vkTex->texture_ = new VulkanTexture();
|
||||||
VulkanTexture *image = entry->vkTex->texture_;
|
VulkanTexture *image = entry->vkTex->texture_;
|
||||||
image->Create(vulkan_, w, h, dstFmt);
|
image->Create(vulkan_, w, h, dstFmt);
|
||||||
|
}
|
||||||
|
lastBoundTexture = entry->vkTex;
|
||||||
|
|
||||||
// GLES2 doesn't have support for a "Max lod" which is critical as PSP games often
|
// GLES2 doesn't have support for a "Max lod" which is critical as PSP games often
|
||||||
// don't specify mips all the way down. As a result, we either need to manually generate
|
// don't specify mips all the way down. As a result, we either need to manually generate
|
||||||
|
@ -1453,6 +1458,7 @@ void TextureCacheVulkan::SetTexture() {
|
||||||
// be as good quality as the game's own (might even be better in some cases though).
|
// be as good quality as the game's own (might even be better in some cases though).
|
||||||
|
|
||||||
// Always load base level texture here
|
// Always load base level texture here
|
||||||
|
|
||||||
LoadTextureLevel(*entry, 0, replaceImages, scaleFactor, dstFmt);
|
LoadTextureLevel(*entry, 0, replaceImages, scaleFactor, dstFmt);
|
||||||
|
|
||||||
// Mipmapping only enable when texture scaling disable
|
// Mipmapping only enable when texture scaling disable
|
||||||
|
@ -1790,7 +1796,7 @@ void TextureCacheVulkan::LoadTextureLevel(TexCacheEntry &entry, int level, bool
|
||||||
|
|
||||||
if (replaceImages) {
|
if (replaceImages) {
|
||||||
// TODO: No support for texture shadows
|
// TODO: No support for texture shadows
|
||||||
DebugBreak();
|
// DebugBreak();
|
||||||
}
|
}
|
||||||
|
|
||||||
PROFILE_THIS_SCOPE("loadtex");
|
PROFILE_THIS_SCOPE("loadtex");
|
||||||
|
|
Loading…
Add table
Reference in a new issue