mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-07 05:46:05 +02:00
TextureCache::setPrimaryDrawBuffers can take a Batch
This commit is contained in:
parent
b11525debf
commit
4bb1b1a02f
2 changed files with 9 additions and 1 deletions
|
@ -247,6 +247,12 @@ GLuint TextureCache::getPrimarySpecularTextureID() {
|
|||
}
|
||||
|
||||
void TextureCache::setPrimaryDrawBuffers(bool color, bool normal, bool specular) {
|
||||
gpu::Batch batch;
|
||||
setPrimaryDrawBuffers(batch, color, normal, specular);
|
||||
gpu::GLBackend::renderBatch(batch);
|
||||
}
|
||||
|
||||
void TextureCache::setPrimaryDrawBuffers(gpu::Batch batch, bool color, bool normal, bool specular) {
|
||||
GLenum buffers[3];
|
||||
int bufferCount = 0;
|
||||
if (color) {
|
||||
|
@ -258,7 +264,7 @@ void TextureCache::setPrimaryDrawBuffers(bool color, bool normal, bool specular)
|
|||
if (specular) {
|
||||
buffers[bufferCount++] = GL_COLOR_ATTACHMENT2;
|
||||
}
|
||||
glDrawBuffers(bufferCount, buffers);
|
||||
batch._glDrawBuffers(bufferCount, buffers);
|
||||
}
|
||||
|
||||
gpu::FramebufferPointer TextureCache::getSecondaryFramebuffer() {
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#ifndef hifi_TextureCache_h
|
||||
#define hifi_TextureCache_h
|
||||
|
||||
#include <gpu/Batch.h>
|
||||
#include <gpu/GPUConfig.h>
|
||||
#include <gpu/Texture.h>
|
||||
#include <gpu/Framebuffer.h>
|
||||
|
@ -78,6 +79,7 @@ public:
|
|||
|
||||
/// Enables or disables draw buffers on the primary framebuffer. Note: the primary framebuffer must be bound.
|
||||
void setPrimaryDrawBuffers(bool color, bool normal = false, bool specular = false);
|
||||
void setPrimaryDrawBuffers(gpu::Batch batch, bool color, bool normal = false, bool specular = false);
|
||||
|
||||
/// Returns a pointer to the secondary framebuffer object, used as an additional render target when performing full
|
||||
/// screen effects.
|
||||
|
|
Loading…
Reference in a new issue