Unified · Split
| @@ -644,7 +644,7 @@ void Avatar::renderBillboard(RenderArgs* renderArgs) { · 643 unmodified lines | ||
| 644 | 644 | glm::vec2 texCoordBottomRight(1.0f, 1.0f); |
| 645 | 645 | |
| 646 | 646 | gpu::Batch& batch = *renderArgs->_batch; |
| 647 | − batch.setUniformTexture(0, _billboardTexture->getGPUTexture()); | |
| 647 | + batch.setResourceTexture(0, _billboardTexture->getGPUTexture()); | |
| 648 | 648 | DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, true); |
| 649 | 649 | DependencyManager::get<GeometryCache>()->renderQuad(batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight, |
| 650 | 650 | glm::vec4(1.0f, 1.0f, 1.0f, 1.0f)); |
| @@ -179,7 +179,7 @@ void ApplicationCompositor::bindCursorTexture(gpu::Batch& batch, uint8_t cursorI · 178 unmodified lines | ||
| 179 | 179 | _cursors[iconId] = DependencyManager::get<TextureCache>()-> |
| 180 | 180 | getImageTexture(iconPath); |
| 181 | 181 | } |
| 182 | − batch.setUniformTexture(0, _cursors[iconId]); | |
| 182 | + batch.setResourceTexture(0, _cursors[iconId]); | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | // Draws the FBO texture for the screen |
| @@ -196,7 +196,7 @@ void ApplicationOverlay::renderDomainConnectionStatusBorder(RenderArgs* renderAr · 195 unmodified lines | ||
| 196 | 196 | geometryCache->useSimpleDrawPipeline(batch); |
| 197 | 197 | batch.setProjectionTransform(mat4()); |
| 198 | 198 | batch.setModelTransform(mat4()); |
| 199 | − batch.setUniformTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture()); | |
| 199 | + batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture()); | |
| 200 | 200 | batch._glLineWidth(CONNECTION_STATUS_BORDER_LINE_WIDTH); |
| 201 | 201 | |
| 202 | 202 | // TODO animate the disconnect border for some excitement while not connected? |
| @@ -87,12 +87,12 @@ void BillboardOverlay::render(RenderArgs* args) { · 86 unmodified lines | ||
| 87 | 87 | transform.postScale(glm::vec3(getDimensions(), 1.0f)); |
| 88 | 88 | |
| 89 | 89 | batch->setModelTransform(transform); |
| 90 | − batch->setUniformTexture(0, _texture->getGPUTexture()); | |
| 90 | + batch->setResourceTexture(0, _texture->getGPUTexture()); | |
| 91 | 91 | |
| 92 | 92 | DependencyManager::get<GeometryCache>()->renderQuad(*batch, topLeft, bottomRight, texCoordTopLeft, texCoordBottomRight, |
| 93 | 93 | glm::vec4(color.red / MAX_COLOR, color.green / MAX_COLOR, color.blue / MAX_COLOR, alpha)); |
| 94 | 94 | |
| 95 | − batch->setUniformTexture(0, args->_whiteTexture); // restore default white color after me | |
| 95 | + batch->setResourceTexture(0, args->_whiteTexture); // restore default white color after me | |
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| @@ -50,7 +50,7 @@ void RenderableParticleEffectEntityItem::render(RenderArgs* args) { · 49 unmodified lines | ||
| 50 | 50 | Q_ASSERT(args->_batch); |
| 51 | 51 | gpu::Batch& batch = *args->_batch; |
| 52 | 52 | if (textured) { |
| 53 | − batch.setUniformTexture(0, _texture->getGPUTexture()); | |
| 53 | + batch.setResourceTexture(0, _texture->getGPUTexture()); | |
| 54 | 54 | } |
| 55 | 55 | batch.setModelTransform(getTransformToCenter()); |
| 56 | 56 | DependencyManager::get<DeferredLightingEffect>()->bindSimpleProgram(batch, textured); |
| @@ -227,15 +227,15 @@ void Batch::setUniformBuffer(uint32 slot, const BufferView& view) { · 226 unmodified lines | ||
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
| 230 | −void Batch::setUniformTexture(uint32 slot, const TexturePointer& texture) { | |
| 231 | − ADD_COMMAND(setUniformTexture); | |
| 230 | +void Batch::setResourceTexture(uint32 slot, const TexturePointer& texture) { | |
| 231 | + ADD_COMMAND(setResourceTexture); | |
| 232 | 232 | |
| 233 | 233 | _params.push_back(_textures.cache(texture)); |
| 234 | 234 | _params.push_back(slot); |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | −void Batch::setUniformTexture(uint32 slot, const TextureView& view) { | |
| 238 | − setUniformTexture(slot, view._texture); | |
| 237 | +void Batch::setResourceTexture(uint32 slot, const TextureView& view) { | |
| 238 | + setResourceTexture(slot, view._texture); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | void Batch::setFramebuffer(const FramebufferPointer& framebuffer) { |
| @@ -102,8 +102,8 @@ public: · 101 unmodified lines | ||
| 102 | 102 | void setUniformBuffer(uint32 slot, const BufferPointer& buffer, Offset offset, Offset size); |
| 103 | 103 | void setUniformBuffer(uint32 slot, const BufferView& view); // not a command, just a shortcut from a BufferView |
| 104 | 104 | |
| 105 | − void setUniformTexture(uint32 slot, const TexturePointer& view); | |
| 106 | − void setUniformTexture(uint32 slot, const TextureView& view); // not a command, just a shortcut from a TextureView | |
| 105 | + void setResourceTexture(uint32 slot, const TexturePointer& view); | |
| 106 | + void setResourceTexture(uint32 slot, const TextureView& view); // not a command, just a shortcut from a TextureView | |
| 107 | 107 | |
| 108 | 108 | // Framebuffer Stage |
| 109 | 109 | void setFramebuffer(const FramebufferPointer& framebuffer); |
| @@ -172,7 +172,7 @@ public: · 62 unmodified lines | ||
| 172 | 172 | COMMAND_setStateBlendFactor, |
| 173 | 173 | |
| 174 | 174 | COMMAND_setUniformBuffer, |
| 175 | − COMMAND_setUniformTexture, | |
| 175 | + COMMAND_setResourceTexture, | |
| 176 | 176 | |
| 177 | 177 | COMMAND_setFramebuffer, |
| 178 | 178 | |
| @@ -35,7 +35,7 @@ GLBackend::CommandCall GLBackend::_commandCalls[Batch::NUM_COMMANDS] = · 34 unmodified lines | ||
| 35 | 35 | (&::gpu::GLBackend::do_setStateBlendFactor), |
| 36 | 36 | |
| 37 | 37 | (&::gpu::GLBackend::do_setUniformBuffer), |
| 38 | − (&::gpu::GLBackend::do_setUniformTexture), | |
| 38 | + (&::gpu::GLBackend::do_setResourceTexture), | |
| 39 | 39 | |
| 40 | 40 | (&::gpu::GLBackend::do_setFramebuffer), |
| 41 | 41 | |
| @@ -309,7 +309,7 @@ protected: · 308 unmodified lines | ||
| 309 | 309 | |
| 310 | 310 | // Uniform Stage |
| 311 | 311 | void do_setUniformBuffer(Batch& batch, uint32 paramOffset); |
| 312 | − void do_setUniformTexture(Batch& batch, uint32 paramOffset); | |
| 312 | + void do_setResourceTexture(Batch& batch, uint32 paramOffset); | |
| 313 | 313 | |
| 314 | 314 | struct UniformStageState { |
| 315 | 315 | |
| @@ -188,7 +188,7 @@ void GLBackend::do_setUniformBuffer(Batch& batch, uint32 paramOffset) { · 187 unmodified lines | ||
| 188 | 188 | (void) CHECK_GL_ERROR(); |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | −void GLBackend::do_setUniformTexture(Batch& batch, uint32 paramOffset) { | |
| 191 | +void GLBackend::do_setResourceTexture(Batch& batch, uint32 paramOffset) { | |
| 192 | 192 | GLuint slot = batch._params[paramOffset + 1]._uint; |
| 193 | 193 | TexturePointer uniformTexture = batch._textures.get(batch._params[paramOffset + 0]._uint); |
| 194 | 194 | |
| @@ -103,7 +103,7 @@ void Skybox::render(gpu::Batch& batch, const ViewFrustum& viewFrustum, const Sky · 102 unmodified lines | ||
| 103 | 103 | batch.setInputBuffer(gpu::Stream::POSITION, theBuffer, 0, 8); |
| 104 | 104 | batch.setUniformBuffer(SKYBOX_CONSTANTS_SLOT, theConstants, 0, theConstants->getSize()); |
| 105 | 105 | batch.setInputFormat(theFormat); |
| 106 | − batch.setUniformTexture(0, skybox.getCubemap()); | |
| 106 | + batch.setResourceTexture(0, skybox.getCubemap()); | |
| 107 | 107 | batch.draw(gpu::TRIANGLE_STRIP, 4); |
| 108 | 108 | } |
| 109 | 109 | |
| @@ -147,7 +147,7 @@ void DeferredLightingEffect::bindSimpleProgram(gpu::Batch& batch, bool textured, · 146 unmodified lines | ||
| 147 | 147 | |
| 148 | 148 | if (!config.isTextured()) { |
| 149 | 149 | // If it is not textured, bind white texture and keep using textured pipeline |
| 150 | − batch.setUniformTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture()); | |
| 150 | + batch.setResourceTexture(0, DependencyManager::get<TextureCache>()->getWhiteTexture()); | |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| @@ -244,13 +244,13 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 90 unmodified lines | ||
| 244 | 244 | |
| 245 | 245 | batch.clearColorFramebuffer(freeFBO->getBufferMask(), glm::vec4(0.0f, 0.0f, 0.0f, 0.0f)); |
| 246 | 246 | |
| 247 | − batch.setUniformTexture(0, textureCache->getPrimaryColorTexture()); | |
| 247 | + batch.setResourceTexture(0, textureCache->getPrimaryColorTexture()); | |
| 248 | 248 | |
| 249 | − batch.setUniformTexture(1, textureCache->getPrimaryNormalTexture()); | |
| 249 | + batch.setResourceTexture(1, textureCache->getPrimaryNormalTexture()); | |
| 250 | 250 | |
| 251 | − batch.setUniformTexture(2, textureCache->getPrimarySpecularTexture()); | |
| 251 | + batch.setResourceTexture(2, textureCache->getPrimarySpecularTexture()); | |
| 252 | 252 | |
| 253 | − batch.setUniformTexture(3, textureCache->getPrimaryDepthTexture()); | |
| 253 | + batch.setResourceTexture(3, textureCache->getPrimaryDepthTexture()); | |
| 254 | 254 | |
| 255 | 255 | // get the viewport side (left, right, both) |
| 256 | 256 | int viewport[4]; |
| @@ -275,7 +275,7 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 18 unmodified lines | ||
| 275 | 275 | const LightLocations* locations = &_directionalLightLocations; |
| 276 | 276 | bool shadowsEnabled = _viewState->getShadowsEnabled(); |
| 277 | 277 | if (shadowsEnabled) { |
| 278 | − batch.setUniformTexture(4, textureCache->getShadowFramebuffer()->getDepthStencilBuffer()); | |
| 278 | + batch.setResourceTexture(4, textureCache->getShadowFramebuffer()->getDepthStencilBuffer()); | |
| 279 | 279 | |
| 280 | 280 | program = _directionalLightShadowMap; |
| 281 | 281 | locations = &_directionalLightShadowMapLocations; |
| @@ -329,7 +329,7 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 47 unmodified lines | ||
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | if (useSkyboxCubemap) { |
| 332 | − batch.setUniformTexture(5, _skybox->getCubemap()); | |
| 332 | + batch.setResourceTexture(5, _skybox->getCubemap()); | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | if (locations->lightBufferUnit >= 0) { |
| @@ -377,11 +377,11 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 41 unmodified lines | ||
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | if (useSkyboxCubemap) { |
| 380 | − batch.setUniformTexture(5, nullptr); | |
| 380 | + batch.setResourceTexture(5, nullptr); | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | if (shadowsEnabled) { |
| 384 | − batch.setUniformTexture(4, nullptr); | |
| 384 | + batch.setResourceTexture(4, nullptr); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | glm::vec4 sCoefficients(sWidth / 2.0f, 0.0f, 0.0f, sMin + sWidth / 2.0f); |
| @@ -530,10 +530,10 @@ void DeferredLightingEffect::render(RenderArgs* args) { · 142 unmodified lines | ||
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | // Probably not necessary in the long run because the gpu layer would unbound this texture if used as render target |
| 533 | − batch.setUniformTexture(0, nullptr); | |
| 534 | − batch.setUniformTexture(1, nullptr); | |
| 535 | − batch.setUniformTexture(2, nullptr); | |
| 536 | − batch.setUniformTexture(3, nullptr); | |
| 533 | + batch.setResourceTexture(0, nullptr); | |
| 534 | + batch.setResourceTexture(1, nullptr); | |
| 535 | + batch.setResourceTexture(2, nullptr); | |
| 536 | + batch.setResourceTexture(3, nullptr); | |
| 537 | 537 | |
| 538 | 538 | args->_context->syncCache(); |
| 539 | 539 | args->_context->render(batch); |
| @@ -551,7 +551,7 @@ void DeferredLightingEffect::copyBack(RenderArgs* args) { · 11 unmodified lines | ||
| 551 | 551 | batch.setFramebuffer(textureCache->getPrimaryFramebuffer()); |
| 552 | 552 | batch.setPipeline(_blitLightBuffer); |
| 553 | 553 | |
| 554 | − batch.setUniformTexture(0, freeFBO->getRenderBuffer(0)); | |
| 554 | + batch.setResourceTexture(0, freeFBO->getRenderBuffer(0)); | |
| 555 | 555 | |
| 556 | 556 | batch.setProjectionTransform(glm::mat4()); |
| 557 | 557 | batch.setViewTransform(Transform()); |
| @@ -2031,10 +2031,10 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 2030 unmodified lines | ||
| 2031 | 2031 | } |
| 2032 | 2032 | static bool showDiffuse = true; |
| 2033 | 2033 | if (showDiffuse && diffuseMap) { |
| 2034 | − batch.setUniformTexture(0, diffuseMap->getGPUTexture()); | |
| 2034 | + batch.setResourceTexture(0, diffuseMap->getGPUTexture()); | |
| 2035 | 2035 | |
| 2036 | 2036 | } else { |
| 2037 | − batch.setUniformTexture(0, textureCache->getWhiteTexture()); | |
| 2037 | + batch.setResourceTexture(0, textureCache->getWhiteTexture()); | |
| 2038 | 2038 | } |
| 2039 | 2039 | |
| 2040 | 2040 | if (locations->texcoordMatrices >= 0) { |
| @@ -2050,14 +2050,14 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 9 unmodified lines | ||
| 2050 | 2050 | |
| 2051 | 2051 | if (!mesh.tangents.isEmpty()) { |
| 2052 | 2052 | Texture* normalMap = networkPart.normalTexture.data(); |
| 2053 | − batch.setUniformTexture(1, !normalMap ? | |
| 2053 | + batch.setResourceTexture(1, !normalMap ? | |
| 2054 | 2054 | textureCache->getBlueTexture() : normalMap->getGPUTexture()); |
| 2055 | 2055 | |
| 2056 | 2056 | } |
| 2057 | 2057 | |
| 2058 | 2058 | if (locations->specularTextureUnit >= 0) { |
| 2059 | 2059 | Texture* specularMap = networkPart.specularTexture.data(); |
| 2060 | − batch.setUniformTexture(locations->specularTextureUnit, !specularMap ? | |
| 2060 | + batch.setResourceTexture(locations->specularTextureUnit, !specularMap ? | |
| 2061 | 2061 | textureCache->getWhiteTexture() : specularMap->getGPUTexture()); |
| 2062 | 2062 | } |
| 2063 | 2063 | |
| @@ -2074,7 +2074,7 @@ void Model::renderPart(RenderArgs* args, int meshIndex, int partIndex, bool tran · 10 unmodified lines | ||
| 2074 | 2074 | GLBATCH(glUniform2f)(locations->emissiveParams, emissiveOffset, emissiveScale); |
| 2075 | 2075 | |
| 2076 | 2076 | Texture* emissiveMap = networkPart.emissiveTexture.data(); |
| 2077 | − batch.setUniformTexture(locations->emissiveTextureUnit, !emissiveMap ? | |
| 2077 | + batch.setResourceTexture(locations->emissiveTextureUnit, !emissiveMap ? | |
| 2078 | 2078 | textureCache->getWhiteTexture() : emissiveMap->getGPUTexture()); |
| 2079 | 2079 | } |
| 2080 | 2080 | |
| @@ -236,7 +236,7 @@ void DrawOverlay3D::run(const SceneContextPointer& sceneContext, const RenderCon · 235 unmodified lines | ||
| 236 | 236 | batch.setViewTransform(viewMat); |
| 237 | 237 | |
| 238 | 238 | batch.setPipeline(getOpaquePipeline()); |
| 239 | − batch.setUniformTexture(0, args->_whiteTexture); | |
| 239 | + batch.setResourceTexture(0, args->_whiteTexture); | |
| 240 | 240 | |
| 241 | 241 | if (!inItems.empty()) { |
| 242 | 242 | batch.clearFramebuffer(gpu::Framebuffer::BUFFER_DEPTH, glm::vec4(), 1.f, 0); |
| @@ -423,7 +423,7 @@ void Font3D::drawString(gpu::Batch& batch, float x, float y, const QString& str, · 422 unmodified lines | ||
| 423 | 423 | |
| 424 | 424 | setupGPU(); |
| 425 | 425 | batch.setPipeline(_pipeline); |
| 426 | − batch.setUniformTexture(_fontLoc, _texture); | |
| 426 | + batch.setResourceTexture(_fontLoc, _texture); | |
| 427 | 427 | batch._glUniform1i(_outlineLoc, (effectType == TextRenderer3D::OUTLINE_EFFECT)); |
| 428 | 428 | batch._glUniform4fv(_colorLoc, 1, (const GLfloat*)color); |
| 429 | 429 | |