mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-06-01 08:20:00 +02:00
Using shader locations directly in ShapePipeline
This commit is contained in:
parent
dfe51b57e8
commit
777ca7e010
1 changed files with 3 additions and 10 deletions
|
@ -33,15 +33,8 @@ void FadeEffect::build(render::Task::TaskConcept& task, const task::Varying& edi
|
||||||
|
|
||||||
render::ShapePipeline::BatchSetter FadeEffect::getBatchSetter() const {
|
render::ShapePipeline::BatchSetter FadeEffect::getBatchSetter() const {
|
||||||
return [this](const render::ShapePipeline& shapePipeline, gpu::Batch& batch, render::Args*) {
|
return [this](const render::ShapePipeline& shapePipeline, gpu::Batch& batch, render::Args*) {
|
||||||
auto program = shapePipeline.pipeline->getProgram();
|
batch.setResourceTexture(shapePipeline.locations->fadeMaskTextureUnit, _maskMap);
|
||||||
auto maskMapLocation = program->getTextures().findLocation("fadeMaskMap");
|
batch.setUniformBuffer(shapePipeline.locations->fadeParameterBufferUnit, _configurations);
|
||||||
auto bufferLocation = program->getUniformBuffers().findLocation("fadeParametersBuffer");
|
|
||||||
if (maskMapLocation != -1) {
|
|
||||||
batch.setResourceTexture(maskMapLocation, _maskMap);
|
|
||||||
}
|
|
||||||
if (bufferLocation != -1) {
|
|
||||||
batch.setUniformBuffer(bufferLocation, _configurations);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +49,7 @@ render::ShapePipeline::ItemSetter FadeEffect::getItemUniformSetter() const {
|
||||||
auto objectParamBufferLocation = program->getUniformBuffers().findLocation("fadeObjectParametersBuffer");
|
auto objectParamBufferLocation = program->getUniformBuffers().findLocation("fadeObjectParametersBuffer");
|
||||||
|
|
||||||
if (objectParamBufferLocation >= 0) {
|
if (objectParamBufferLocation >= 0) {
|
||||||
if (transitionState.paramsBuffer._size == 0) {
|
if (transitionState.paramsBuffer._size != sizeof(gpu::StructBuffer<FadeObjectParams>)) {
|
||||||
static_assert(sizeof(transitionState.paramsBuffer) == sizeof(gpu::StructBuffer<FadeObjectParams>), "Assuming gpu::StructBuffer is a helper class for gpu::BufferView");
|
static_assert(sizeof(transitionState.paramsBuffer) == sizeof(gpu::StructBuffer<FadeObjectParams>), "Assuming gpu::StructBuffer is a helper class for gpu::BufferView");
|
||||||
transitionState.paramsBuffer = gpu::StructBuffer<FadeObjectParams>();
|
transitionState.paramsBuffer = gpu::StructBuffer<FadeObjectParams>();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue