mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-27 03:18:46 +02:00
Starting to expose the number of changes to the input format
This commit is contained in:
parent
9ff9682b2a
commit
fb363180c8
4 changed files with 35 additions and 5 deletions
|
@ -173,6 +173,11 @@ Item {
|
||||||
prop: "frameSetPipelineCount",
|
prop: "frameSetPipelineCount",
|
||||||
label: "Pipelines",
|
label: "Pipelines",
|
||||||
color: "#E2334D"
|
color: "#E2334D"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: "frameSetInputFormatCount",
|
||||||
|
label: "Input Formats",
|
||||||
|
color: "#1AC567"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,13 +12,34 @@
|
||||||
|
|
||||||
using namespace gpu;
|
using namespace gpu;
|
||||||
|
|
||||||
|
|
||||||
|
GLBackend::GLInputFormat::GLInputFormat() {
|
||||||
|
}
|
||||||
|
|
||||||
|
GLBackend::GLInputFormat:: ~GLInputFormat() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
GLBackend::GLInputFormat* GLBackend::syncGPUObject(const Stream::Format& inputFormat) {
|
||||||
|
GLInputFormat* object = Backend::getGPUObject<GLBackend::GLInputFormat>(inputFormat);
|
||||||
|
|
||||||
|
if (object) {
|
||||||
|
return object;
|
||||||
|
}
|
||||||
|
|
||||||
|
object = new GLInputFormat();
|
||||||
|
Backend::setGPUObject(inputFormat, object);
|
||||||
|
}
|
||||||
|
|
||||||
void GLBackend::do_setInputFormat(Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setInputFormat(Batch& batch, size_t paramOffset) {
|
||||||
Stream::FormatPointer format = batch._streamFormats.get(batch._params[paramOffset]._uint);
|
Stream::FormatPointer format = batch._streamFormats.get(batch._params[paramOffset]._uint);
|
||||||
|
GLInputFormat* ifo = GLBackend::syncGPUObject(*format);
|
||||||
|
if (ifo) {
|
||||||
if (format != _input._format) {
|
if (format != _input._format) {
|
||||||
_input._format = format;
|
_input._format = format;
|
||||||
_input._invalidFormat = true;
|
_input._invalidFormat = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::do_setInputBuffer(Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setInputBuffer(Batch& batch, size_t paramOffset) {
|
||||||
|
@ -89,7 +110,7 @@ void GLBackend::syncInputStateCache() {
|
||||||
// Core 41 doesn't expose the features to really separate the vertex format from the vertex buffers binding
|
// Core 41 doesn't expose the features to really separate the vertex format from the vertex buffers binding
|
||||||
// Core 43 does :)
|
// Core 43 does :)
|
||||||
// FIXME crashing problem with glVertexBindingDivisor / glVertexAttribFormat
|
// FIXME crashing problem with glVertexBindingDivisor / glVertexAttribFormat
|
||||||
#if 1 || (GPU_INPUT_PROFILE == GPU_CORE_41)
|
#if(GPU_INPUT_PROFILE == GPU_CORE_41)
|
||||||
#define NO_SUPPORT_VERTEX_ATTRIB_FORMAT
|
#define NO_SUPPORT_VERTEX_ATTRIB_FORMAT
|
||||||
#else
|
#else
|
||||||
#define SUPPORT_VERTEX_ATTRIB_FORMAT
|
#define SUPPORT_VERTEX_ATTRIB_FORMAT
|
||||||
|
|
|
@ -50,6 +50,7 @@ void EngineStats::run(const SceneContextPointer& sceneContext, const RenderConte
|
||||||
config->frameTextureMemoryUsage = _gpuStats._RSAmountTextureMemoryBounded - gpuStats._RSAmountTextureMemoryBounded;
|
config->frameTextureMemoryUsage = _gpuStats._RSAmountTextureMemoryBounded - gpuStats._RSAmountTextureMemoryBounded;
|
||||||
|
|
||||||
config->frameSetPipelineCount = _gpuStats._PSNumSetPipelines - gpuStats._PSNumSetPipelines;
|
config->frameSetPipelineCount = _gpuStats._PSNumSetPipelines - gpuStats._PSNumSetPipelines;
|
||||||
|
config->frameSetInputFormatCount = _gpuStats._ISNumFormatChanges - gpuStats._ISNumFormatChanges;
|
||||||
|
|
||||||
config->emitDirty();
|
config->emitDirty();
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ namespace render {
|
||||||
Q_PROPERTY(quint32 frameTextureMemoryUsage MEMBER frameTextureMemoryUsage NOTIFY dirty)
|
Q_PROPERTY(quint32 frameTextureMemoryUsage MEMBER frameTextureMemoryUsage NOTIFY dirty)
|
||||||
|
|
||||||
Q_PROPERTY(quint32 frameSetPipelineCount MEMBER frameSetPipelineCount NOTIFY dirty)
|
Q_PROPERTY(quint32 frameSetPipelineCount MEMBER frameSetPipelineCount NOTIFY dirty)
|
||||||
|
Q_PROPERTY(quint32 frameSetInputFormatCount MEMBER frameSetInputFormatCount NOTIFY dirty)
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -78,6 +79,8 @@ namespace render {
|
||||||
|
|
||||||
quint32 frameSetPipelineCount{ 0 };
|
quint32 frameSetPipelineCount{ 0 };
|
||||||
|
|
||||||
|
quint32 frameSetInputFormatCount{ 0 };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void emitDirty() { emit dirty(); }
|
void emitDirty() { emit dirty(); }
|
||||||
|
|
Loading…
Reference in a new issue