mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 17:50:42 +02:00
Debugging the ssbo bug
This commit is contained in:
parent
e95b16c5f9
commit
3360c5a968
2 changed files with 17 additions and 10 deletions
|
@ -94,7 +94,7 @@ const gpu::PipelinePointer GameWorkloadRenderItem::getPipeline() {
|
||||||
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
gpu::ShaderPointer program = gpu::Shader::createProgram(vs, ps);
|
||||||
|
|
||||||
gpu::Shader::BindingSet slotBindings;
|
gpu::Shader::BindingSet slotBindings;
|
||||||
slotBindings.insert(gpu::Shader::Binding("ssbo0Buffer", 0));
|
slotBindings.insert(gpu::Shader::Binding("ssbo0Buffer", 11));
|
||||||
gpu::Shader::makeProgram(*program, slotBindings);
|
gpu::Shader::makeProgram(*program, slotBindings);
|
||||||
|
|
||||||
auto state = std::make_shared<gpu::State>();
|
auto state = std::make_shared<gpu::State>();
|
||||||
|
@ -125,13 +125,14 @@ void GameWorkloadRenderItem::render(RenderArgs* args) {
|
||||||
// Bind program
|
// Bind program
|
||||||
batch.setPipeline(getPipeline());
|
batch.setPipeline(getPipeline());
|
||||||
|
|
||||||
batch.setResourceBuffer(0, _allProxiesBuffer);
|
// batch.setResourceBuffer(11, _allProxiesBuffer);
|
||||||
|
batch.setUniformBuffer(11, _allProxiesBuffer);
|
||||||
|
|
||||||
static const int NUM_VERTICES_PER_QUAD = 6;
|
static const int NUM_VERTICES_PER_QUAD = 3;
|
||||||
batch.draw(gpu::TRIANGLES, NUM_VERTICES_PER_QUAD * _numAllProxies, 0);
|
batch.draw(gpu::TRIANGLES, NUM_VERTICES_PER_QUAD * _numAllProxies, 0);
|
||||||
|
|
||||||
batch.setResourceBuffer(0, nullptr);
|
// batch.setResourceBuffer(11, nullptr);
|
||||||
|
batch.setUniformBuffer(11, nullptr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||||
|
|
|
@ -25,7 +25,7 @@ struct WorkloadProxy {
|
||||||
vec4 sphere;
|
vec4 sphere;
|
||||||
vec4 region;
|
vec4 region;
|
||||||
};
|
};
|
||||||
|
/*
|
||||||
#if defined(GPU_GL410)
|
#if defined(GPU_GL410)
|
||||||
uniform samplerBuffer ssbo0Buffer;
|
uniform samplerBuffer ssbo0Buffer;
|
||||||
WorkloadProxy getWorkloadProxy(int i) {
|
WorkloadProxy getWorkloadProxy(int i) {
|
||||||
|
@ -44,7 +44,13 @@ WorkloadProxy getWorkloadProxy(int i) {
|
||||||
return proxy;
|
return proxy;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
*/
|
||||||
|
uniform ssbo0Buffer {
|
||||||
|
WorkloadProxy proxies[1024];
|
||||||
|
};
|
||||||
|
WorkloadProxy getWorkloadProxy(int index) {
|
||||||
|
return proxies[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
out vec4 varColor;
|
out vec4 varColor;
|
||||||
|
@ -84,8 +90,8 @@ void main(void) {
|
||||||
2, 1, 3
|
2, 1, 3
|
||||||
);
|
);
|
||||||
|
|
||||||
int proxyID = gl_VertexID / 6;
|
int proxyID = gl_VertexID / 3;
|
||||||
int vertexID = gl_VertexID - proxyID * 6;
|
int vertexID = gl_VertexID - proxyID * 3;
|
||||||
|
|
||||||
vec4 cubeVec = UNIT_BOX[UNIT_BOX_LINE_INDICES[vertexID]];
|
vec4 cubeVec = UNIT_BOX[UNIT_BOX_LINE_INDICES[vertexID]];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue