mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 11:42:55 +02:00
Don't pass binding manually, link named call correctly
This commit is contained in:
parent
eb55e55367
commit
78cd4407db
4 changed files with 11 additions and 6 deletions
|
@ -92,9 +92,9 @@ void makeBindings(GLBackend::GLShader* shader) {
|
||||||
// now assign the ubo binding, then DON't relink!
|
// now assign the ubo binding, then DON't relink!
|
||||||
|
|
||||||
//Check for gpu specific uniform slotBindings
|
//Check for gpu specific uniform slotBindings
|
||||||
loc = glGetUniformBlockIndex(glprogram, "transformObjectBuffer");
|
loc = glGetProgramResourceIndex(glprogram, GL_SHADER_STORAGE_BLOCK, "transformObjectBuffer");
|
||||||
if (loc >= 0) {
|
if (loc >= 0) {
|
||||||
glUniformBlockBinding(glprogram, loc, gpu::TRANSFORM_OBJECT_SLOT);
|
glShaderStorageBlockBinding(glprogram, loc, gpu::TRANSFORM_OBJECT_SLOT);
|
||||||
shader->_transformObjectSlot = gpu::TRANSFORM_OBJECT_SLOT;
|
shader->_transformObjectSlot = gpu::TRANSFORM_OBJECT_SLOT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,8 +183,14 @@ void GLBackend::TransformStageState::update(size_t commandIndex, const StereoSta
|
||||||
void GLBackend::updateTransform() {
|
void GLBackend::updateTransform() {
|
||||||
_transform.update(_commandIndex, _stereo);
|
_transform.update(_commandIndex, _stereo);
|
||||||
|
|
||||||
auto& drawCallInfo = getDrawCallInfoBuffer()[_currentDraw];
|
auto& drawCallInfoBuffer = getDrawCallInfoBuffer();
|
||||||
glVertexAttribI2i(gpu::Stream::DRAW_CALL_INFO, drawCallInfo.index, drawCallInfo.unused);
|
if (_currentNamedCall.empty()) {
|
||||||
|
auto& drawCallInfo = drawCallInfoBuffer[_currentDraw];
|
||||||
|
glVertexAttribI2i(gpu::Stream::DRAW_CALL_INFO, (GLint)drawCallInfo.index, (GLint)drawCallInfo.unused);
|
||||||
|
} else {
|
||||||
|
glEnableVertexAttribArray(gpu::Stream::DRAW_CALL_INFO);
|
||||||
|
glVertexAttribIPointer(gpu::Stream::DRAW_CALL_INFO, 2, GL_SHORT, 4, drawCallInfoBuffer.data());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::resetTransformStage() {
|
void GLBackend::resetTransformStage() {
|
||||||
|
|
|
@ -40,7 +40,6 @@ public:
|
||||||
INSTANCE_SCALE = 8,
|
INSTANCE_SCALE = 8,
|
||||||
INSTANCE_TRANSLATE = 9,
|
INSTANCE_TRANSLATE = 9,
|
||||||
|
|
||||||
|
|
||||||
DRAW_CALL_INFO = 15, // Reserve last input slot for draw call infos
|
DRAW_CALL_INFO = 15, // Reserve last input slot for draw call infos
|
||||||
NUM_INPUT_SLOTS = DRAW_CALL_INFO + 1,
|
NUM_INPUT_SLOTS = DRAW_CALL_INFO + 1,
|
||||||
};
|
};
|
||||||
|
|
|
@ -27,7 +27,7 @@ struct TransformCamera {
|
||||||
|
|
||||||
in ivec2 _drawCallInfo;
|
in ivec2 _drawCallInfo;
|
||||||
|
|
||||||
layout(std430, binding=6) buffer transformObjectBuffer {
|
layout(std140) buffer transformObjectBuffer {
|
||||||
TransformObject _object[];
|
TransformObject _object[];
|
||||||
};
|
};
|
||||||
TransformObject getTransformObject() {
|
TransformObject getTransformObject() {
|
||||||
|
|
Loading…
Reference in a new issue