Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 6 files). Show all
Unified · Split
| @@ -29,6 +29,8 @@ · 28 unmodified lines | |||
| 29 | #include "standardTransformPNTC_vert.h" | 29 | #include "standardTransformPNTC_vert.h" |
| 30 | #include "standardDrawTexture_frag.h" | 30 | #include "standardDrawTexture_frag.h" |
| 31 | 31 | ||
| 32 | #include "gpu/StandardShaderLib.h" | ||
| 33 | |||
| 32 | //#define WANT_DEBUG | 34 | //#define WANT_DEBUG |
| 33 | 35 | ||
| 34 | const int GeometryCache::UNKNOWN_ID = -1; | 36 | const int GeometryCache::UNKNOWN_ID = -1; |
| @@ -1660,16 +1662,20 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) { · 1625 unmodified lines | |||
| 1660 | 1662 | ||
| 1661 | auto state = std::make_shared<gpu::State>(); | 1663 | auto state = std::make_shared<gpu::State>(); |
| 1662 | 1664 | ||
| 1665 | |||
| 1663 | // enable decal blend | 1666 | // enable decal blend |
| 1664 | state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); | 1667 | state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); |
| 1665 | 1668 | ||
| 1666 | _standardDrawPipeline.reset(gpu::Pipeline::create(program, state)); | 1669 | _standardDrawPipeline.reset(gpu::Pipeline::create(program, state)); |
| 1667 | 1670 | ||
| 1671 | |||
| 1668 | auto stateNoBlend = std::make_shared<gpu::State>(); | 1672 | auto stateNoBlend = std::make_shared<gpu::State>(); |
| 1669 | stateNoBlend->setColorWriteMask(true, true, true, false); | 1673 | // stateNoBlend->setColorWriteMask(true, true, true, false); |
| 1670 | stateNoBlend->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); | 1674 | // stateNoBlend->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA); |
| 1671 | 1675 | ||
| 1672 | _standardDrawPipelineNoBlend.reset(gpu::Pipeline::create(program, stateNoBlend)); | 1676 | auto programNoBlend = gpu::ShaderPointer(gpu::Shader::createProgram(vs, gpu::StandardShaderLib::getDrawTextureOpaquePS())); |
| 1677 | gpu::Shader::makeProgram((*programNoBlend)); | ||
| 1678 | _standardDrawPipelineNoBlend.reset(gpu::Pipeline::create(programNoBlend, stateNoBlend)); | ||
| 1673 | } | 1679 | } |
| 1674 | if (noBlend) { | 1680 | if (noBlend) { |
| 1675 | batch.setPipeline(_standardDrawPipelineNoBlend); | 1681 | batch.setPipeline(_standardDrawPipelineNoBlend); |