mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-05 22:41:18 +12:00
put query object into a separate file
This commit is contained in:
parent
a328c5e753
commit
4cce3699f3
5 changed files with 61 additions and 43 deletions
|
@ -567,6 +567,8 @@ if(ENABLE_METAL)
|
||||||
HW/Latte/Renderer/Metal/MetalSamplerCache.h
|
HW/Latte/Renderer/Metal/MetalSamplerCache.h
|
||||||
HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp
|
HW/Latte/Renderer/Metal/MetalHybridComputePipeline.cpp
|
||||||
HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h
|
HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h
|
||||||
|
HW/Latte/Renderer/Metal/MetalQuery.cpp
|
||||||
|
HW/Latte/Renderer/Metal/MetalQuery.h
|
||||||
HW/Latte/Renderer/Metal/MetalPerformanceMonitor.h
|
HW/Latte/Renderer/Metal/MetalPerformanceMonitor.h
|
||||||
HW/Latte/Renderer/Metal/UtilityShaderSource.h
|
HW/Latte/Renderer/Metal/UtilityShaderSource.h
|
||||||
)
|
)
|
||||||
|
|
17
src/Cafe/HW/Latte/Renderer/Metal/MetalQuery.cpp
Normal file
17
src/Cafe/HW/Latte/Renderer/Metal/MetalQuery.cpp
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
#include "Cafe/HW/Latte/Renderer/Metal/MetalQuery.h"
|
||||||
|
|
||||||
|
bool LatteQueryObjectMtl::getResult(uint64& numSamplesPassed)
|
||||||
|
{
|
||||||
|
cemuLog_log(LogType::MetalLogging, "LatteQueryObjectMtl::getResult: occlusion queries are not yet supported on Metal");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LatteQueryObjectMtl::begin()
|
||||||
|
{
|
||||||
|
cemuLog_log(LogType::MetalLogging, "LatteQueryObjectMtl::begin: occlusion queries are not yet supported on Metal");
|
||||||
|
}
|
||||||
|
|
||||||
|
void LatteQueryObjectMtl::end()
|
||||||
|
{
|
||||||
|
cemuLog_log(LogType::MetalLogging, "LatteQueryObjectMtl::end: occlusion queries are not yet supported on Metal");
|
||||||
|
}
|
19
src/Cafe/HW/Latte/Renderer/Metal/MetalQuery.h
Normal file
19
src/Cafe/HW/Latte/Renderer/Metal/MetalQuery.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Cafe/HW/Latte/Core/LatteQueryObject.h"
|
||||||
|
|
||||||
|
#include "Cafe/HW/Latte/Renderer/Metal/MetalCommon.h"
|
||||||
|
|
||||||
|
// HACK: Dummy occlusion query object
|
||||||
|
class LatteQueryObjectMtl : public LatteQueryObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LatteQueryObjectMtl(class MetalRenderer* mtlRenderer) : m_mtlr{mtlRenderer} {}
|
||||||
|
|
||||||
|
bool getResult(uint64& numSamplesPassed) override;
|
||||||
|
void begin() override;
|
||||||
|
void end() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
class MetalRenderer* m_mtlr;
|
||||||
|
};
|
|
@ -9,6 +9,7 @@
|
||||||
#include "Cafe/HW/Latte/Renderer/Metal/MetalSamplerCache.h"
|
#include "Cafe/HW/Latte/Renderer/Metal/MetalSamplerCache.h"
|
||||||
#include "Cafe/HW/Latte/Renderer/Metal/LatteTextureReadbackMtl.h"
|
#include "Cafe/HW/Latte/Renderer/Metal/LatteTextureReadbackMtl.h"
|
||||||
#include "Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h"
|
#include "Cafe/HW/Latte/Renderer/Metal/MetalHybridComputePipeline.h"
|
||||||
|
#include "Cafe/HW/Latte/Renderer/Metal/MetalQuery.h"
|
||||||
#include "Cafe/HW/Latte/Renderer/Metal/LatteToMtl.h"
|
#include "Cafe/HW/Latte/Renderer/Metal/LatteToMtl.h"
|
||||||
|
|
||||||
#include "Cafe/HW/Latte/Renderer/Metal/UtilityShaderSource.h"
|
#include "Cafe/HW/Latte/Renderer/Metal/UtilityShaderSource.h"
|
||||||
|
@ -1282,6 +1283,24 @@ void MetalRenderer::indexData_uploadIndexMemory(uint32 bufferIndex, uint32 offse
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LatteQueryObject* MetalRenderer::occlusionQuery_create() {
|
||||||
|
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_create: Occlusion queries are not yet supported on Metal");
|
||||||
|
|
||||||
|
return new LatteQueryObjectMtl(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetalRenderer::occlusionQuery_destroy(LatteQueryObject* queryObj) {
|
||||||
|
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_destroy: occlusion queries are not yet supported on Metal");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetalRenderer::occlusionQuery_flush() {
|
||||||
|
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_flush: occlusion queries are not yet supported on Metal");
|
||||||
|
}
|
||||||
|
|
||||||
|
void MetalRenderer::occlusionQuery_updateState() {
|
||||||
|
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_updateState: occlusion queries are not yet supported on Metal");
|
||||||
|
}
|
||||||
|
|
||||||
void MetalRenderer::SetBuffer(MTL::RenderCommandEncoder* renderCommandEncoder, MetalShaderType shaderType, MTL::Buffer* buffer, size_t offset, uint32 index)
|
void MetalRenderer::SetBuffer(MTL::RenderCommandEncoder* renderCommandEncoder, MetalShaderType shaderType, MTL::Buffer* buffer, size_t offset, uint32 index)
|
||||||
{
|
{
|
||||||
auto& boundBuffer = m_state.m_encoderState.m_buffers[shaderType][index];
|
auto& boundBuffer = m_state.m_encoderState.m_buffers[shaderType][index];
|
||||||
|
|
|
@ -155,32 +155,6 @@ enum class MetalEncoderType
|
||||||
Blit,
|
Blit,
|
||||||
};
|
};
|
||||||
|
|
||||||
// HACK: Dummy occlusion query object for Metal
|
|
||||||
class LatteQueryObjectMtl : public LatteQueryObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LatteQueryObjectMtl(class MetalRenderer* mtlRenderer) : m_mtlr{mtlRenderer} {}
|
|
||||||
|
|
||||||
bool getResult(uint64& numSamplesPassed) override
|
|
||||||
{
|
|
||||||
cemuLog_log(LogType::MetalLogging, "LatteQueryObjectMtl::getResult: occlusion queries are not yet supported on Metal");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void begin() override
|
|
||||||
{
|
|
||||||
cemuLog_log(LogType::MetalLogging, "LatteQueryObjectMtl::begin: occlusion queries are not yet supported on Metal");
|
|
||||||
}
|
|
||||||
|
|
||||||
void end() override
|
|
||||||
{
|
|
||||||
cemuLog_log(LogType::MetalLogging, "LatteQueryObjectMtl::end: occlusion queries are not yet supported on Metal");
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
class MetalRenderer* m_mtlr;
|
|
||||||
};
|
|
||||||
|
|
||||||
class MetalRenderer : public Renderer
|
class MetalRenderer : public Renderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -296,23 +270,10 @@ public:
|
||||||
void indexData_uploadIndexMemory(uint32 bufferIndex, uint32 offset, uint32 size) override;
|
void indexData_uploadIndexMemory(uint32 bufferIndex, uint32 offset, uint32 size) override;
|
||||||
|
|
||||||
// occlusion queries
|
// occlusion queries
|
||||||
LatteQueryObject* occlusionQuery_create() override {
|
LatteQueryObject* occlusionQuery_create() override;
|
||||||
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_create: Occlusion queries are not yet supported on Metal");
|
void occlusionQuery_destroy(LatteQueryObject* queryObj) override;
|
||||||
|
void occlusionQuery_flush() override;
|
||||||
return new LatteQueryObjectMtl(this);
|
void occlusionQuery_updateState() override;
|
||||||
}
|
|
||||||
|
|
||||||
void occlusionQuery_destroy(LatteQueryObject* queryObj) override {
|
|
||||||
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_destroy: occlusion queries are not yet supported on Metal");
|
|
||||||
}
|
|
||||||
|
|
||||||
void occlusionQuery_flush() override {
|
|
||||||
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_flush: occlusion queries are not yet supported on Metal");
|
|
||||||
}
|
|
||||||
|
|
||||||
void occlusionQuery_updateState() override {
|
|
||||||
cemuLog_log(LogType::MetalLogging, "MetalRenderer::occlusionQuery_updateState: occlusion queries are not yet supported on Metal");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Helpers
|
// Helpers
|
||||||
MetalPerformanceMonitor& GetPerformanceMonitor() { return m_performanceMonitor; }
|
MetalPerformanceMonitor& GetPerformanceMonitor() { return m_performanceMonitor; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue