mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 05:00:20 +02:00
Merge branch 'master' of github.com:highfidelity/hifi into rename-getpos3
This commit is contained in:
commit
ee515a44e7
10 changed files with 155 additions and 11 deletions
|
@ -442,12 +442,16 @@ bool EntityTreeSendThread::traverseTreeAndBuildNextPacketPayload(EncodeBitstream
|
||||||
PrioritizedEntity queuedItem = _sendQueue.top();
|
PrioritizedEntity queuedItem = _sendQueue.top();
|
||||||
EntityItemPointer entity = queuedItem.getEntity();
|
EntityItemPointer entity = queuedItem.getEntity();
|
||||||
if (entity) {
|
if (entity) {
|
||||||
// Only send entities that match the jsonFilters, but keep track of everything we've tried to send so we don't try to send it again
|
const QUuid& entityID = entity->getID();
|
||||||
|
// Only send entities that match the jsonFilters, but keep track of everything we've tried to send so we don't try to send it again;
|
||||||
|
// also send if we previously matched since this represents change to a matched item.
|
||||||
bool entityMatchesFilters = entity->matchesJSONFilters(jsonFilters);
|
bool entityMatchesFilters = entity->matchesJSONFilters(jsonFilters);
|
||||||
if (entityMatchesFilters || entityNodeData->isEntityFlaggedAsExtra(entity->getID())) {
|
bool entityPreviouslyMatchedFilter = entityNodeData->sentFilteredEntity(entityID);
|
||||||
|
|
||||||
|
if (entityMatchesFilters || entityNodeData->isEntityFlaggedAsExtra(entityID) || entityPreviouslyMatchedFilter) {
|
||||||
if (!jsonFilters.isEmpty() && entityMatchesFilters) {
|
if (!jsonFilters.isEmpty() && entityMatchesFilters) {
|
||||||
// Record explicitly filtered-in entity so that extra entities can be flagged.
|
// Record explicitly filtered-in entity so that extra entities can be flagged.
|
||||||
entityNodeData->insertSentFilteredEntity(entity->getID());
|
entityNodeData->insertSentFilteredEntity(entityID);
|
||||||
}
|
}
|
||||||
OctreeElement::AppendState appendEntityState = entity->appendEntityData(&_packetData, params, _extraEncodeData);
|
OctreeElement::AppendState appendEntityState = entity->appendEntityData(&_packetData, params, _extraEncodeData);
|
||||||
|
|
||||||
|
@ -458,6 +462,10 @@ bool EntityTreeSendThread::traverseTreeAndBuildNextPacketPayload(EncodeBitstream
|
||||||
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
params.stopReason = EncodeBitstreamParams::DIDNT_FIT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (entityPreviouslyMatchedFilter && !entityMatchesFilters) {
|
||||||
|
entityNodeData->removeSentFilteredEntity(entityID);
|
||||||
|
}
|
||||||
++_numEntities;
|
++_numEntities;
|
||||||
}
|
}
|
||||||
if (queuedItem.shouldForceRemove()) {
|
if (queuedItem.shouldForceRemove()) {
|
||||||
|
|
|
@ -33,7 +33,7 @@ public:
|
||||||
// these can only be called from the OctreeSendThread for the given Node
|
// these can only be called from the OctreeSendThread for the given Node
|
||||||
void insertSentFilteredEntity(const QUuid& entityID) { _sentFilteredEntities.insert(entityID); }
|
void insertSentFilteredEntity(const QUuid& entityID) { _sentFilteredEntities.insert(entityID); }
|
||||||
void removeSentFilteredEntity(const QUuid& entityID) { _sentFilteredEntities.remove(entityID); }
|
void removeSentFilteredEntity(const QUuid& entityID) { _sentFilteredEntities.remove(entityID); }
|
||||||
bool sentFilteredEntity(const QUuid& entityID) { return _sentFilteredEntities.contains(entityID); }
|
bool sentFilteredEntity(const QUuid& entityID) const { return _sentFilteredEntities.contains(entityID); }
|
||||||
QSet<QUuid> getSentFilteredEntities() { return _sentFilteredEntities; }
|
QSet<QUuid> getSentFilteredEntities() { return _sentFilteredEntities; }
|
||||||
|
|
||||||
// the following flagged extra entity methods can only be called from the OctreeSendThread for the given Node
|
// the following flagged extra entity methods can only be called from the OctreeSendThread for the given Node
|
||||||
|
|
|
@ -93,12 +93,16 @@ GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] =
|
||||||
(&::gpu::gl::GLBackend::do_setUniformBuffer),
|
(&::gpu::gl::GLBackend::do_setUniformBuffer),
|
||||||
(&::gpu::gl::GLBackend::do_setResourceBuffer),
|
(&::gpu::gl::GLBackend::do_setResourceBuffer),
|
||||||
(&::gpu::gl::GLBackend::do_setResourceTexture),
|
(&::gpu::gl::GLBackend::do_setResourceTexture),
|
||||||
|
(&::gpu::gl::GLBackend::do_setResourceFramebufferSwapChainTexture),
|
||||||
|
|
||||||
(&::gpu::gl::GLBackend::do_setFramebuffer),
|
(&::gpu::gl::GLBackend::do_setFramebuffer),
|
||||||
|
(&::gpu::gl::GLBackend::do_setFramebufferSwapChain),
|
||||||
(&::gpu::gl::GLBackend::do_clearFramebuffer),
|
(&::gpu::gl::GLBackend::do_clearFramebuffer),
|
||||||
(&::gpu::gl::GLBackend::do_blit),
|
(&::gpu::gl::GLBackend::do_blit),
|
||||||
(&::gpu::gl::GLBackend::do_generateTextureMips),
|
(&::gpu::gl::GLBackend::do_generateTextureMips),
|
||||||
|
|
||||||
|
(&::gpu::gl::GLBackend::do_advance),
|
||||||
|
|
||||||
(&::gpu::gl::GLBackend::do_beginQuery),
|
(&::gpu::gl::GLBackend::do_beginQuery),
|
||||||
(&::gpu::gl::GLBackend::do_endQuery),
|
(&::gpu::gl::GLBackend::do_endQuery),
|
||||||
(&::gpu::gl::GLBackend::do_getQuery),
|
(&::gpu::gl::GLBackend::do_getQuery),
|
||||||
|
|
|
@ -123,15 +123,19 @@ public:
|
||||||
// Resource Stage
|
// Resource Stage
|
||||||
virtual void do_setResourceBuffer(const Batch& batch, size_t paramOffset) final;
|
virtual void do_setResourceBuffer(const Batch& batch, size_t paramOffset) final;
|
||||||
virtual void do_setResourceTexture(const Batch& batch, size_t paramOffset) final;
|
virtual void do_setResourceTexture(const Batch& batch, size_t paramOffset) final;
|
||||||
|
virtual void do_setResourceFramebufferSwapChainTexture(const Batch& batch, size_t paramOffset) final;
|
||||||
|
|
||||||
// Pipeline Stage
|
// Pipeline Stage
|
||||||
virtual void do_setPipeline(const Batch& batch, size_t paramOffset) final;
|
virtual void do_setPipeline(const Batch& batch, size_t paramOffset) final;
|
||||||
|
|
||||||
// Output stage
|
// Output stage
|
||||||
virtual void do_setFramebuffer(const Batch& batch, size_t paramOffset) final;
|
virtual void do_setFramebuffer(const Batch& batch, size_t paramOffset) final;
|
||||||
|
virtual void do_setFramebufferSwapChain(const Batch& batch, size_t paramOffset) final;
|
||||||
virtual void do_clearFramebuffer(const Batch& batch, size_t paramOffset) final;
|
virtual void do_clearFramebuffer(const Batch& batch, size_t paramOffset) final;
|
||||||
virtual void do_blit(const Batch& batch, size_t paramOffset) = 0;
|
virtual void do_blit(const Batch& batch, size_t paramOffset) = 0;
|
||||||
|
|
||||||
|
virtual void do_advance(const Batch& batch, size_t paramOffset) final;
|
||||||
|
|
||||||
// Query section
|
// Query section
|
||||||
virtual void do_beginQuery(const Batch& batch, size_t paramOffset) final;
|
virtual void do_beginQuery(const Batch& batch, size_t paramOffset) final;
|
||||||
virtual void do_endQuery(const Batch& batch, size_t paramOffset) final;
|
virtual void do_endQuery(const Batch& batch, size_t paramOffset) final;
|
||||||
|
@ -242,6 +246,8 @@ protected:
|
||||||
void setupStereoSide(int side);
|
void setupStereoSide(int side);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
virtual void setResourceTexture(unsigned int slot, const TexturePointer& resourceTexture);
|
||||||
|
virtual void setFramebuffer(const FramebufferPointer& framebuffer);
|
||||||
virtual void initInput() final;
|
virtual void initInput() final;
|
||||||
virtual void killInput() final;
|
virtual void killInput() final;
|
||||||
virtual void syncInputStateCache() final;
|
virtual void syncInputStateCache() final;
|
||||||
|
|
|
@ -37,6 +37,19 @@ void GLBackend::resetOutputStage() {
|
||||||
|
|
||||||
void GLBackend::do_setFramebuffer(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setFramebuffer(const Batch& batch, size_t paramOffset) {
|
||||||
auto framebuffer = batch._framebuffers.get(batch._params[paramOffset]._uint);
|
auto framebuffer = batch._framebuffers.get(batch._params[paramOffset]._uint);
|
||||||
|
setFramebuffer(framebuffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLBackend::do_setFramebufferSwapChain(const Batch& batch, size_t paramOffset) {
|
||||||
|
auto swapChain = batch._swapChains.get(batch._params[paramOffset]._uint);
|
||||||
|
if (swapChain) {
|
||||||
|
auto index = batch._params[paramOffset + 1]._uint;
|
||||||
|
FramebufferPointer framebuffer = static_cast<const FramebufferSwapChain*>(swapChain.get())->get(index);
|
||||||
|
setFramebuffer(framebuffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLBackend::setFramebuffer(const FramebufferPointer& framebuffer) {
|
||||||
if (_output._framebuffer != framebuffer) {
|
if (_output._framebuffer != framebuffer) {
|
||||||
auto newFBO = getFramebufferID(framebuffer);
|
auto newFBO = getFramebufferID(framebuffer);
|
||||||
if (_output._drawFBO != newFBO) {
|
if (_output._drawFBO != newFBO) {
|
||||||
|
@ -47,6 +60,13 @@ void GLBackend::do_setFramebuffer(const Batch& batch, size_t paramOffset) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GLBackend::do_advance(const Batch& batch, size_t paramOffset) {
|
||||||
|
auto ringbuffer = batch._swapChains.get(batch._params[paramOffset]._uint);
|
||||||
|
if (ringbuffer) {
|
||||||
|
ringbuffer->advance();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GLBackend::do_clearFramebuffer(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_clearFramebuffer(const Batch& batch, size_t paramOffset) {
|
||||||
if (_stereo.isStereo() && !_pipeline._stateCache.scissorEnable) {
|
if (_stereo.isStereo() && !_pipeline._stateCache.scissorEnable) {
|
||||||
qWarning("Clear without scissor in stereo mode");
|
qWarning("Clear without scissor in stereo mode");
|
||||||
|
|
|
@ -251,6 +251,31 @@ void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
|
||||||
releaseResourceTexture(slot);
|
releaseResourceTexture(slot);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
setResourceTexture(slot, resourceTexture);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLBackend::do_setResourceFramebufferSwapChainTexture(const Batch& batch, size_t paramOffset) {
|
||||||
|
GLuint slot = batch._params[paramOffset + 1]._uint;
|
||||||
|
if (slot >= (GLuint)MAX_NUM_RESOURCE_TEXTURES) {
|
||||||
|
qCDebug(gpugllogging) << "GLBackend::do_setResourceFramebufferSwapChainTexture: Trying to set a resource Texture at slot #" << slot << " which doesn't exist. MaxNumResourceTextures = " << getMaxNumResourceTextures();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
SwapChainPointer swapChain = batch._swapChains.get(batch._params[paramOffset + 0]._uint);
|
||||||
|
|
||||||
|
if (!swapChain) {
|
||||||
|
releaseResourceTexture(slot);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
auto index = batch._params[paramOffset + 2]._uint;
|
||||||
|
auto renderBufferSlot = batch._params[paramOffset + 3]._uint;
|
||||||
|
FramebufferPointer resourceFramebuffer = static_cast<const FramebufferSwapChain*>(swapChain.get())->get(index);
|
||||||
|
TexturePointer resourceTexture = resourceFramebuffer->getRenderBuffer(renderBufferSlot);
|
||||||
|
|
||||||
|
setResourceTexture(slot, resourceTexture);
|
||||||
|
}
|
||||||
|
|
||||||
|
void GLBackend::setResourceTexture(unsigned int slot, const TexturePointer& resourceTexture) {
|
||||||
// check cache before thinking
|
// check cache before thinking
|
||||||
if (_resource._textures[slot] == resourceTexture) {
|
if (_resource._textures[slot] == resourceTexture) {
|
||||||
return;
|
return;
|
||||||
|
@ -267,11 +292,11 @@ void GLBackend::do_setResourceTexture(const Batch& batch, size_t paramOffset) {
|
||||||
glActiveTexture(GL_TEXTURE0 + slot);
|
glActiveTexture(GL_TEXTURE0 + slot);
|
||||||
glBindTexture(target, to);
|
glBindTexture(target, to);
|
||||||
|
|
||||||
(void) CHECK_GL_ERROR();
|
(void)CHECK_GL_ERROR();
|
||||||
|
|
||||||
_resource._textures[slot] = resourceTexture;
|
_resource._textures[slot] = resourceTexture;
|
||||||
|
|
||||||
_stats._RSAmountTextureMemoryBounded += (int) object->size();
|
_stats._RSAmountTextureMemoryBounded += (int)object->size();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
releaseResourceTexture(slot);
|
releaseResourceTexture(slot);
|
||||||
|
|
|
@ -105,7 +105,7 @@ void GLBackend::TransformStageState::preUpdate(size_t commandIndex, const Stereo
|
||||||
if (_viewIsCamera && (_viewCorrectionEnabled && _correction.correction != glm::mat4())) {
|
if (_viewIsCamera && (_viewCorrectionEnabled && _correction.correction != glm::mat4())) {
|
||||||
// FIXME should I switch to using the camera correction buffer in Transform.slf and leave this out?
|
// FIXME should I switch to using the camera correction buffer in Transform.slf and leave this out?
|
||||||
Transform result;
|
Transform result;
|
||||||
_view.mult(result, _view, _correction.correction);
|
_view.mult(result, _view, _correction.correctionInverse);
|
||||||
if (_skybox) {
|
if (_skybox) {
|
||||||
result.setTranslation(vec3());
|
result.setTranslation(vec3());
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,47 @@ GLenum GLTexelFormat::evalGLTexelFormatInternal(const gpu::Element& dstFormat) {
|
||||||
case gpu::RGB:
|
case gpu::RGB:
|
||||||
case gpu::RGBA:
|
case gpu::RGBA:
|
||||||
case gpu::XY:
|
case gpu::XY:
|
||||||
result = GL_RG8;
|
switch (dstFormat.getType()) {
|
||||||
|
case gpu::UINT32:
|
||||||
|
result = GL_RG32UI;
|
||||||
|
break;
|
||||||
|
case gpu::INT32:
|
||||||
|
result = GL_RG32I;
|
||||||
|
break;
|
||||||
|
case gpu::FLOAT:
|
||||||
|
result = GL_RG32F;
|
||||||
|
break;
|
||||||
|
case gpu::UINT16:
|
||||||
|
result = GL_RG16UI;
|
||||||
|
break;
|
||||||
|
case gpu::INT16:
|
||||||
|
result = GL_RG16I;
|
||||||
|
break;
|
||||||
|
case gpu::HALF:
|
||||||
|
result = GL_RG16F;
|
||||||
|
break;
|
||||||
|
case gpu::UINT8:
|
||||||
|
result = GL_RG8UI;
|
||||||
|
break;
|
||||||
|
case gpu::INT8:
|
||||||
|
result = GL_RG8I;
|
||||||
|
break;
|
||||||
|
case gpu::NUINT8:
|
||||||
|
result = GL_RG8;
|
||||||
|
break;
|
||||||
|
case gpu::NINT8:
|
||||||
|
result = GL_RG8_SNORM;
|
||||||
|
break;
|
||||||
|
case gpu::NUINT32:
|
||||||
|
case gpu::NINT32:
|
||||||
|
case gpu::NUINT2:
|
||||||
|
case gpu::NINT2_10_10_10:
|
||||||
|
case gpu::COMPRESSED:
|
||||||
|
case gpu::NUINT16:
|
||||||
|
case gpu::NINT16:
|
||||||
|
case gpu::NUM_TYPES: // quiet compiler
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qCWarning(gpugllogging) << "Unknown combination of texel format";
|
qCWarning(gpugllogging) << "Unknown combination of texel format";
|
||||||
|
@ -312,7 +352,48 @@ GLTexelFormat GLTexelFormat::evalGLTexelFormat(const Element& dstFormat, const E
|
||||||
case gpu::RGB:
|
case gpu::RGB:
|
||||||
case gpu::RGBA:
|
case gpu::RGBA:
|
||||||
case gpu::XY:
|
case gpu::XY:
|
||||||
texel.internalFormat = GL_RG8;
|
switch (dstFormat.getType()) {
|
||||||
|
case gpu::UINT32:
|
||||||
|
texel.internalFormat = GL_RG32UI;
|
||||||
|
break;
|
||||||
|
case gpu::INT32:
|
||||||
|
texel.internalFormat = GL_RG32I;
|
||||||
|
break;
|
||||||
|
case gpu::FLOAT:
|
||||||
|
texel.internalFormat = GL_RG32F;
|
||||||
|
break;
|
||||||
|
case gpu::UINT16:
|
||||||
|
texel.internalFormat = GL_RG16UI;
|
||||||
|
break;
|
||||||
|
case gpu::INT16:
|
||||||
|
texel.internalFormat = GL_RG16I;
|
||||||
|
break;
|
||||||
|
case gpu::HALF:
|
||||||
|
texel.type = GL_FLOAT;
|
||||||
|
texel.internalFormat = GL_RG16F;
|
||||||
|
break;
|
||||||
|
case gpu::UINT8:
|
||||||
|
texel.internalFormat = GL_RG8UI;
|
||||||
|
break;
|
||||||
|
case gpu::INT8:
|
||||||
|
texel.internalFormat = GL_RG8I;
|
||||||
|
break;
|
||||||
|
case gpu::NUINT8:
|
||||||
|
texel.internalFormat = GL_RG8;
|
||||||
|
break;
|
||||||
|
case gpu::NINT8:
|
||||||
|
texel.internalFormat = GL_RG8_SNORM;
|
||||||
|
break;
|
||||||
|
case gpu::NUINT32:
|
||||||
|
case gpu::NINT32:
|
||||||
|
case gpu::NUINT2:
|
||||||
|
case gpu::NINT2_10_10_10:
|
||||||
|
case gpu::COMPRESSED:
|
||||||
|
case gpu::NUINT16:
|
||||||
|
case gpu::NINT16:
|
||||||
|
case gpu::NUM_TYPES: // quiet compiler
|
||||||
|
Q_UNREACHABLE();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
qCWarning(gpugllogging) << "Unknown combination of texel format";
|
qCWarning(gpugllogging) << "Unknown combination of texel format";
|
||||||
|
|
|
@ -88,7 +88,7 @@ class AntialiasingConfig : public render::Job::Config {
|
||||||
Q_PROPERTY(float blend MEMBER blend NOTIFY dirty)
|
Q_PROPERTY(float blend MEMBER blend NOTIFY dirty)
|
||||||
Q_PROPERTY(float sharpen MEMBER sharpen NOTIFY dirty)
|
Q_PROPERTY(float sharpen MEMBER sharpen NOTIFY dirty)
|
||||||
Q_PROPERTY(float covarianceGamma MEMBER covarianceGamma NOTIFY dirty)
|
Q_PROPERTY(float covarianceGamma MEMBER covarianceGamma NOTIFY dirty)
|
||||||
|
|
||||||
Q_PROPERTY(bool constrainColor MEMBER constrainColor NOTIFY dirty)
|
Q_PROPERTY(bool constrainColor MEMBER constrainColor NOTIFY dirty)
|
||||||
Q_PROPERTY(bool feedbackColor MEMBER feedbackColor NOTIFY dirty)
|
Q_PROPERTY(bool feedbackColor MEMBER feedbackColor NOTIFY dirty)
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ var currentSelectedBtn;
|
||||||
|
|
||||||
var SETTING_CURRENT_MODE_KEY = 'Android/Mode';
|
var SETTING_CURRENT_MODE_KEY = 'Android/Mode';
|
||||||
var MODE_VR = "VR", MODE_RADAR = "RADAR", MODE_MY_VIEW = "MY VIEW";
|
var MODE_VR = "VR", MODE_RADAR = "RADAR", MODE_MY_VIEW = "MY VIEW";
|
||||||
var DEFAULT_MODE = MODE_RADAR;
|
var DEFAULT_MODE = MODE_MY_VIEW;
|
||||||
var logEnabled = true;
|
var logEnabled = true;
|
||||||
|
|
||||||
var radar = Script.require('./radar.js');
|
var radar = Script.require('./radar.js');
|
||||||
|
|
Loading…
Reference in a new issue