mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-16 11:52:04 +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::Shader::BindingSet slotBindings;
|
||||
slotBindings.insert(gpu::Shader::Binding("ssbo0Buffer", 0));
|
||||
slotBindings.insert(gpu::Shader::Binding("ssbo0Buffer", 11));
|
||||
gpu::Shader::makeProgram(*program, slotBindings);
|
||||
|
||||
auto state = std::make_shared<gpu::State>();
|
||||
|
@ -121,17 +121,18 @@ void GameWorkloadRenderItem::render(RenderArgs* args) {
|
|||
batch.setProjectionTransform(projMat);
|
||||
batch.setViewTransform(viewMat);
|
||||
batch.setModelTransform(Transform());
|
||||
|
||||
|
||||
// Bind program
|
||||
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.setResourceBuffer(0, nullptr);
|
||||
|
||||
// batch.setResourceBuffer(11, nullptr);
|
||||
batch.setUniformBuffer(11, nullptr);
|
||||
|
||||
/*
|
||||
auto geometryCache = DependencyManager::get<GeometryCache>();
|
||||
|
|
|
@ -25,7 +25,7 @@ struct WorkloadProxy {
|
|||
vec4 sphere;
|
||||
vec4 region;
|
||||
};
|
||||
|
||||
/*
|
||||
#if defined(GPU_GL410)
|
||||
uniform samplerBuffer ssbo0Buffer;
|
||||
WorkloadProxy getWorkloadProxy(int i) {
|
||||
|
@ -44,7 +44,13 @@ WorkloadProxy getWorkloadProxy(int i) {
|
|||
return proxy;
|
||||
}
|
||||
#endif
|
||||
|
||||
*/
|
||||
uniform ssbo0Buffer {
|
||||
WorkloadProxy proxies[1024];
|
||||
};
|
||||
WorkloadProxy getWorkloadProxy(int index) {
|
||||
return proxies[index];
|
||||
}
|
||||
|
||||
|
||||
out vec4 varColor;
|
||||
|
@ -84,8 +90,8 @@ void main(void) {
|
|||
2, 1, 3
|
||||
);
|
||||
|
||||
int proxyID = gl_VertexID / 6;
|
||||
int vertexID = gl_VertexID - proxyID * 6;
|
||||
int proxyID = gl_VertexID / 3;
|
||||
int vertexID = gl_VertexID - proxyID * 3;
|
||||
|
||||
vec4 cubeVec = UNIT_BOX[UNIT_BOX_LINE_INDICES[vertexID]];
|
||||
|
||||
|
|
Loading…
Reference in a new issue