mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 07:03:33 +02:00
Fix a case of pointer truncation in Vulkan on 32-bit. Fixes #12932
This commit is contained in:
@@ -664,7 +664,7 @@ public:
|
||||
}
|
||||
|
||||
virtual std::string GetInfoString(InfoField info) const = 0;
|
||||
virtual uintptr_t GetNativeObject(NativeObject obj) = 0;
|
||||
virtual uint64_t GetNativeObject(NativeObject obj) = 0;
|
||||
|
||||
virtual void HandleEvent(Event ev, int width, int height, void *param1 = nullptr, void *param2 = nullptr) = 0;
|
||||
|
||||
|
||||
@@ -131,26 +131,26 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uintptr_t GetNativeObject(NativeObject obj) override {
|
||||
uint64_t GetNativeObject(NativeObject obj) override {
|
||||
switch (obj) {
|
||||
case NativeObject::DEVICE:
|
||||
return (uintptr_t)device_;
|
||||
return (uint64_t)(uintptr_t)device_;
|
||||
case NativeObject::CONTEXT:
|
||||
return (uintptr_t)context_;
|
||||
return (uint64_t)(uintptr_t)context_;
|
||||
case NativeObject::DEVICE_EX:
|
||||
return (uintptr_t)device1_;
|
||||
return (uint64_t)(uintptr_t)device1_;
|
||||
case NativeObject::CONTEXT_EX:
|
||||
return (uintptr_t)context1_;
|
||||
return (uint64_t)(uintptr_t)context1_;
|
||||
case NativeObject::BACKBUFFER_COLOR_TEX:
|
||||
return (uintptr_t)bbRenderTargetTex_;
|
||||
return (uint64_t)(uintptr_t)bbRenderTargetTex_;
|
||||
case NativeObject::BACKBUFFER_DEPTH_TEX:
|
||||
return (uintptr_t)bbDepthStencilTex_;
|
||||
return (uint64_t)(uintptr_t)bbDepthStencilTex_;
|
||||
case NativeObject::BACKBUFFER_COLOR_VIEW:
|
||||
return (uintptr_t)bbRenderTargetView_;
|
||||
return (uint64_t)(uintptr_t)bbRenderTargetView_;
|
||||
case NativeObject::BACKBUFFER_DEPTH_VIEW:
|
||||
return (uintptr_t)bbDepthStencilView_;
|
||||
return (uint64_t)(uintptr_t)bbDepthStencilView_;
|
||||
case NativeObject::FEATURE_LEVEL:
|
||||
return (uintptr_t)featureLevel_;
|
||||
return (uint64_t)(uintptr_t)featureLevel_;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -572,14 +572,14 @@ public:
|
||||
void DrawUP(const void *vdata, int vertexCount) override;
|
||||
void Clear(int mask, uint32_t colorval, float depthVal, int stencilVal);
|
||||
|
||||
uintptr_t GetNativeObject(NativeObject obj) override {
|
||||
uint64_t GetNativeObject(NativeObject obj) override {
|
||||
switch (obj) {
|
||||
case NativeObject::CONTEXT:
|
||||
return (uintptr_t)d3d_;
|
||||
return (uint64_t)(uintptr_t)d3d_;
|
||||
case NativeObject::DEVICE:
|
||||
return (uintptr_t)device_;
|
||||
return (uint64_t)(uintptr_t)device_;
|
||||
case NativeObject::DEVICE_EX:
|
||||
return (uintptr_t)deviceEx_;
|
||||
return (uint64_t)(uintptr_t)deviceEx_;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -467,10 +467,10 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uintptr_t GetNativeObject(NativeObject obj) override {
|
||||
uint64_t GetNativeObject(NativeObject obj) override {
|
||||
switch (obj) {
|
||||
case NativeObject::RENDER_MANAGER:
|
||||
return (uintptr_t)&renderManager_;
|
||||
return (uint64_t)(uintptr_t)&renderManager_;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -455,25 +455,25 @@ public:
|
||||
std::vector<std::string> GetFeatureList() const override;
|
||||
std::vector<std::string> GetExtensionList() const override;
|
||||
|
||||
uintptr_t GetNativeObject(NativeObject obj) override {
|
||||
uint64_t GetNativeObject(NativeObject obj) override {
|
||||
switch (obj) {
|
||||
case NativeObject::FRAMEBUFFER_RENDERPASS:
|
||||
// Return a representative renderpass.
|
||||
return (uintptr_t)renderManager_.GetFramebufferRenderPass();
|
||||
return (uint64_t)renderManager_.GetFramebufferRenderPass();
|
||||
case NativeObject::BACKBUFFER_RENDERPASS:
|
||||
return (uintptr_t)renderManager_.GetBackbufferRenderPass();
|
||||
return (uint64_t)renderManager_.GetBackbufferRenderPass();
|
||||
case NativeObject::COMPATIBLE_RENDERPASS:
|
||||
return (uintptr_t)renderManager_.GetCompatibleRenderPass();
|
||||
return (uint64_t)renderManager_.GetCompatibleRenderPass();
|
||||
case NativeObject::INIT_COMMANDBUFFER:
|
||||
return (uintptr_t)renderManager_.GetInitCmd();
|
||||
return (uint64_t)renderManager_.GetInitCmd();
|
||||
case NativeObject::BOUND_TEXTURE0_IMAGEVIEW:
|
||||
return (uintptr_t)boundImageView_[0];
|
||||
return (uint64_t)boundImageView_[0];
|
||||
case NativeObject::BOUND_TEXTURE1_IMAGEVIEW:
|
||||
return (uintptr_t)boundImageView_[1];
|
||||
return (uint64_t)boundImageView_[1];
|
||||
case NativeObject::RENDER_MANAGER:
|
||||
return (uintptr_t)&renderManager_;
|
||||
return (uint64_t)(uintptr_t)&renderManager_;
|
||||
case NativeObject::NULL_IMAGEVIEW:
|
||||
return (uintptr_t)GetNullTexture()->GetImageView();
|
||||
return (uint64_t)GetNullTexture()->GetImageView();
|
||||
default:
|
||||
Crash();
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user