mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
DX9: Enable vtxdec JIT, buildfix
This commit is contained in:
parent
4035b28503
commit
38b803aba4
4 changed files with 26 additions and 2 deletions
|
@ -521,7 +521,7 @@ void VertexDecoder::Step_NormalS8Skin() const
|
|||
void VertexDecoder::Step_NormalS16Skin() const
|
||||
{
|
||||
float *normal = (float *)(decoded_ + decFmt.nrmoff);
|
||||
const s16 *sv = (const u16_le*)(ptr_ + nrmoff);
|
||||
const s16 *sv = (const s16_le*)(ptr_ + nrmoff);
|
||||
const float fn[3] = { sv[0] * (1.0f / 32768.0f), sv[1] * (1.0f / 32768.0f), sv[2] * (1.0f / 32768.0f) };
|
||||
Norm3ByMatrix43(normal, fn, skinMatrix);
|
||||
}
|
||||
|
|
|
@ -1536,10 +1536,13 @@ void DIRECTX9_GPU::ClearCacheNextFrame() {
|
|||
|
||||
void DIRECTX9_GPU::Resized() {
|
||||
framebufferManager_.Resized();
|
||||
transformDraw_.Resized();
|
||||
}
|
||||
|
||||
void DIRECTX9_GPU::ClearShaderCache() {
|
||||
shaderManager_->ClearCache(true);
|
||||
}
|
||||
|
||||
std::vector<FramebufferInfo> DIRECTX9_GPU::GetFramebufferList() {
|
||||
return framebufferManager_.GetFramebufferList();
|
||||
}
|
||||
|
|
|
@ -173,6 +173,9 @@ TransformDrawEngineDX9::TransformDrawEngineDX9()
|
|||
uvScale = new UVScale[MAX_DEFERRED_DRAW_CALLS];
|
||||
}
|
||||
indexGen.Setup(decIndex);
|
||||
|
||||
decJitCache_ = new VertexDecoderJitCache();
|
||||
|
||||
InitDeviceObjects();
|
||||
}
|
||||
|
||||
|
@ -195,6 +198,9 @@ TransformDrawEngineDX9::~TransformDrawEngineDX9() {
|
|||
delete iter->second;
|
||||
}
|
||||
delete [] uvScale;
|
||||
|
||||
delete decJitCache_;
|
||||
|
||||
}
|
||||
|
||||
void TransformDrawEngineDX9::InitDeviceObjects() {
|
||||
|
@ -786,7 +792,7 @@ VertexDecoder *TransformDrawEngineDX9::GetVertexDecoder(u32 vtype) {
|
|||
if (iter != decoderMap_.end())
|
||||
return iter->second;
|
||||
VertexDecoder*dec = new VertexDecoder();
|
||||
dec->SetVertexType(vtype, decOptions_);
|
||||
dec->SetVertexType(vtype, decOptions_, decJitCache_);
|
||||
decoderMap_[vtype] = dec;
|
||||
return dec;
|
||||
}
|
||||
|
@ -1293,6 +1299,12 @@ rotateVBO:
|
|||
host->GPUNotifyDraw();
|
||||
}
|
||||
|
||||
void TransformDrawEngineDX9::Resized() {
|
||||
decJitCache_->Clear();
|
||||
|
||||
// ...
|
||||
}
|
||||
|
||||
bool TransformDrawEngineDX9::TestBoundingBox(void* control_points, int vertexCount, u32 vertType) {
|
||||
// Simplify away bones and morph before proceeding
|
||||
|
||||
|
@ -1367,6 +1379,10 @@ static Vec3f ScreenToDrawing(const Vec3f& coords) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool TransformDrawEngineDX9::IsCodePtrVertexDecoder(const u8 *ptr) const {
|
||||
return decJitCache_->IsInSpace(ptr);
|
||||
}
|
||||
|
||||
// TODO: This probably is not the best interface.
|
||||
bool TransformDrawEngineDX9::GetCurrentSimpleVertices(int count, std::vector<GPUDebugVertex> &vertices, std::vector<u16> &indices) {
|
||||
// This is always for the current vertices.
|
||||
|
|
|
@ -128,11 +128,14 @@ public:
|
|||
void DestroyDeviceObjects();
|
||||
void GLLost() {};
|
||||
|
||||
void Resized(); // TODO: Call
|
||||
|
||||
void DecimateTrackedVertexArrays();
|
||||
void ClearTrackedVertexArrays();
|
||||
|
||||
void SetupVertexDecoder(u32 vertType);
|
||||
|
||||
bool IsCodePtrVertexDecoder(const u8 *ptr) const;
|
||||
// This requires a SetupVertexDecoder call first.
|
||||
int EstimatePerVertexCost();
|
||||
|
||||
|
@ -200,6 +203,8 @@ private:
|
|||
ShaderManagerDX9 *shaderManager_;
|
||||
TextureCacheDX9 *textureCache_;
|
||||
FramebufferManagerDX9 *framebufferManager_;
|
||||
VertexDecoderJitCache *decJitCache_;
|
||||
|
||||
|
||||
enum { MAX_DEFERRED_DRAW_CALLS = 128 };
|
||||
DeferredDrawCall drawCalls[MAX_DEFERRED_DRAW_CALLS];
|
||||
|
|
Loading…
Add table
Reference in a new issue