mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 20:58:38 +02:00
Reduce needless smart pointer duplication
This commit is contained in:
parent
d5456eda6c
commit
9a435cdca2
3 changed files with 7 additions and 7 deletions
|
@ -17,7 +17,7 @@ using namespace gpu;
|
||||||
using namespace gpu::gl;
|
using namespace gpu::gl;
|
||||||
|
|
||||||
void GLBackend::do_setInputFormat(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setInputFormat(const Batch& batch, size_t paramOffset) {
|
||||||
Stream::FormatPointer format = batch._streamFormats.get(batch._params[paramOffset]._uint);
|
const auto& format = batch._streamFormats.get(batch._params[paramOffset]._uint);
|
||||||
if (format != _input._format) {
|
if (format != _input._format) {
|
||||||
_input._format = format;
|
_input._format = format;
|
||||||
if (format) {
|
if (format) {
|
||||||
|
@ -37,7 +37,7 @@ void GLBackend::do_setInputFormat(const Batch& batch, size_t paramOffset) {
|
||||||
void GLBackend::do_setInputBuffer(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setInputBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
Offset stride = batch._params[paramOffset + 0]._uint;
|
Offset stride = batch._params[paramOffset + 0]._uint;
|
||||||
Offset offset = batch._params[paramOffset + 1]._uint;
|
Offset offset = batch._params[paramOffset + 1]._uint;
|
||||||
BufferPointer buffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
const auto& buffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
||||||
uint32 channel = batch._params[paramOffset + 3]._uint;
|
uint32 channel = batch._params[paramOffset + 3]._uint;
|
||||||
|
|
||||||
if (channel < getNumInputBuffers()) {
|
if (channel < getNumInputBuffers()) {
|
||||||
|
@ -119,7 +119,7 @@ void GLBackend::do_setIndexBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
_input._indexBufferType = (Type)batch._params[paramOffset + 2]._uint;
|
_input._indexBufferType = (Type)batch._params[paramOffset + 2]._uint;
|
||||||
_input._indexBufferOffset = batch._params[paramOffset + 0]._uint;
|
_input._indexBufferOffset = batch._params[paramOffset + 0]._uint;
|
||||||
|
|
||||||
BufferPointer indexBuffer = batch._buffers.get(batch._params[paramOffset + 1]._uint);
|
const auto& indexBuffer = batch._buffers.get(batch._params[paramOffset + 1]._uint);
|
||||||
if (indexBuffer != _input._indexBuffer) {
|
if (indexBuffer != _input._indexBuffer) {
|
||||||
_input._indexBuffer = indexBuffer;
|
_input._indexBuffer = indexBuffer;
|
||||||
if (indexBuffer) {
|
if (indexBuffer) {
|
||||||
|
@ -136,7 +136,7 @@ void GLBackend::do_setIndirectBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
_input._indirectBufferOffset = batch._params[paramOffset + 1]._uint;
|
_input._indirectBufferOffset = batch._params[paramOffset + 1]._uint;
|
||||||
_input._indirectBufferStride = batch._params[paramOffset + 2]._uint;
|
_input._indirectBufferStride = batch._params[paramOffset + 2]._uint;
|
||||||
|
|
||||||
BufferPointer buffer = batch._buffers.get(batch._params[paramOffset]._uint);
|
const auto& buffer = batch._buffers.get(batch._params[paramOffset]._uint);
|
||||||
if (buffer != _input._indirectBuffer) {
|
if (buffer != _input._indirectBuffer) {
|
||||||
_input._indirectBuffer = buffer;
|
_input._indirectBuffer = buffer;
|
||||||
if (buffer) {
|
if (buffer) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ using namespace gpu;
|
||||||
using namespace gpu::gl;
|
using namespace gpu::gl;
|
||||||
|
|
||||||
void GLBackend::do_setPipeline(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_setPipeline(const Batch& batch, size_t paramOffset) {
|
||||||
PipelinePointer pipeline = batch._pipelines.get(batch._params[paramOffset + 0]._uint);
|
const auto& pipeline = batch._pipelines.get(batch._params[paramOffset + 0]._uint);
|
||||||
|
|
||||||
if (_pipeline._pipeline == pipeline) {
|
if (_pipeline._pipeline == pipeline) {
|
||||||
return;
|
return;
|
||||||
|
@ -193,7 +193,7 @@ void GLBackend::do_setUniformBuffer(const Batch& batch, size_t paramOffset) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferPointer uniformBuffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
const auto& uniformBuffer = batch._buffers.get(batch._params[paramOffset + 2]._uint);
|
||||||
GLintptr rangeStart = batch._params[paramOffset + 1]._uint;
|
GLintptr rangeStart = batch._params[paramOffset + 1]._uint;
|
||||||
GLsizeiptr rangeSize = batch._params[paramOffset + 0]._uint;
|
GLsizeiptr rangeSize = batch._params[paramOffset + 0]._uint;
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ GLTexture* GLBackend::syncGPUObject(const TexturePointer& texturePointer) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLBackend::do_generateTextureMips(const Batch& batch, size_t paramOffset) {
|
void GLBackend::do_generateTextureMips(const Batch& batch, size_t paramOffset) {
|
||||||
TexturePointer resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
const auto& resourceTexture = batch._textures.get(batch._params[paramOffset + 0]._uint);
|
||||||
if (!resourceTexture) {
|
if (!resourceTexture) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue