mirror of
https://github.com/Armored-Dragon/overte.git
synced 2025-03-11 16:13:16 +01:00
Mip generation texture slot is higher and doesn't interfere anymore
This commit is contained in:
parent
9bc85b3e5d
commit
6abffceb43
4 changed files with 28 additions and 5 deletions
|
@ -86,9 +86,14 @@ void GLBackend::do_generateTextureMipsWithPipeline(const Batch& batch, size_t pa
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not transfer the texture, this call is expected for rendering texture
|
// Always make sure the GLObject is in sync
|
||||||
GLTexture* object = syncGPUObject(resourceTexture);
|
GLTexture* object = syncGPUObject(resourceTexture);
|
||||||
if (!object) {
|
if (object) {
|
||||||
|
GLuint to = object->_texture;
|
||||||
|
glActiveTexture(GL_TEXTURE0 + gpu::slot::texture::MipCreationInput);
|
||||||
|
glBindTexture(object->_target, to);
|
||||||
|
(void)CHECK_GL_ERROR();
|
||||||
|
} else {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -418,8 +418,6 @@ void Batch::generateTextureMips(const TexturePointer& texture) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Batch::generateTextureMipsWithPipeline(const TexturePointer& texture, int numMips) {
|
void Batch::generateTextureMipsWithPipeline(const TexturePointer& texture, int numMips) {
|
||||||
setResourceTexture(gpu::slot::texture::MipCreationInput, texture);
|
|
||||||
|
|
||||||
ADD_COMMAND(generateTextureMipsWithPipeline);
|
ADD_COMMAND(generateTextureMipsWithPipeline);
|
||||||
|
|
||||||
_params.emplace_back(_textures.cache(texture));
|
_params.emplace_back(_textures.cache(texture));
|
||||||
|
|
20
libraries/gpu/src/gpu/MipGeneration.slh
Normal file
20
libraries/gpu/src/gpu/MipGeneration.slh
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<!
|
||||||
|
// MipGeneration.slh
|
||||||
|
// libraries/gpu/src
|
||||||
|
//
|
||||||
|
// Created by Olivier Prat on 10/16/18.
|
||||||
|
// Copyright 2018 High Fidelity, Inc.
|
||||||
|
//
|
||||||
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||||
|
!>
|
||||||
|
<@if not MIP_GENERATION_SLH@>
|
||||||
|
<@def MIP_GENERATION_SLH@>
|
||||||
|
|
||||||
|
<@include gpu/ShaderConstants.h@>
|
||||||
|
|
||||||
|
layout(binding=GPU_TEXTURE_MIP_CREATION_INPUT) uniform sampler2D texMap;
|
||||||
|
|
||||||
|
in vec2 varTexCoord0;
|
||||||
|
|
||||||
|
<@endif@>
|
|
@ -22,7 +22,7 @@
|
||||||
#define GPU_TEXTURE_TRANSFORM_OBJECT 31
|
#define GPU_TEXTURE_TRANSFORM_OBJECT 31
|
||||||
|
|
||||||
// Mip creation
|
// Mip creation
|
||||||
#define GPU_TEXTURE_MIP_CREATION_INPUT 0
|
#define GPU_TEXTURE_MIP_CREATION_INPUT 30
|
||||||
|
|
||||||
#define GPU_STORAGE_TRANSFORM_OBJECT 7
|
#define GPU_STORAGE_TRANSFORM_OBJECT 7
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue