]> git.tdb.fi Git - libs/gl.git/commitdiff
Minor, largely cosmetic tweaks
authorMikko Rasa <tdb@tdb.fi>
Fri, 14 Jan 2022 22:06:58 +0000 (00:06 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 14 Jan 2022 22:06:58 +0000 (00:06 +0200)
source/backends/opengl/buffer_backend.h
source/backends/opengl/extension.h
source/backends/vulkan/pipelinestate_backend.cpp
source/backends/vulkan/renderer_backend.h
source/backends/vulkan/texture_backend.cpp
source/core/bufferable.h
source/effects/environmentmap.cpp
source/render/renderer.h
source/render/sequence.cpp
source/render/sequence.h

index 06c128af15ddbab4f5b3479eab6548a36268be96..446b1d2db2c550ac11838230285c4d1f2617c213 100644 (file)
@@ -20,7 +20,7 @@ protected:
        ~OpenGLBuffer();
 
        void allocate();
-       void sub_data(size_t, size_t, const void *);
+       void sub_data(std::size_t, std::size_t, const void *);
 
        unsigned get_multiplicity() const { return 1; }
 
index 779963578899bbeb2dea2e6de24e08d1a8b549bd..27dae6fcd6c8a95d5cccc3a22cc4784d39158d58 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef MSP_GL_EXTENSION_H_
-#define MSP_GL_EXTENSION_H_
+#ifndef MSP_GL_OPENGL_EXTENSION_H_
+#define MSP_GL_OPENGL_EXTENSION_H_
 
 #include <string>
 #include "backend.h"
index 6107fa495e984cbc6aa2744f00d4cef81c6c5473..1d381022ace90136fc193681d97361a3b5f3d063 100644 (file)
@@ -68,10 +68,13 @@ void VulkanPipelineState::update() const
                                t.changed = false;
                        }
 
-               descriptor_set_handles.resize(self.shprog->get_n_descriptor_sets());
-               for(unsigned i=0; i<descriptor_set_handles.size(); ++i)
-                       if(changed_sets&(1<<i))
-                               descriptor_set_handles[i] = device.get_pipeline_cache().get_descriptor_set(self, i);
+               if(changed_sets)
+               {
+                       descriptor_set_handles.resize(self.shprog->get_n_descriptor_sets());
+                       for(unsigned i=0; i<descriptor_set_handles.size(); ++i)
+                               if(changed_sets&(1<<i))
+                                       descriptor_set_handles[i] = device.get_pipeline_cache().get_descriptor_set(self, i);
+               }
        }
 
        changes = 0;
index d4ebc326df01ac628928aa682d237e2e429224fc..fed048410b0e18f26cce9d645fe355723ee54b42 100644 (file)
@@ -12,8 +12,8 @@ class VulkanRenderer: public NonCopyable
 {
 protected:
        PipelineState pipeline_state;
-       Semaphore *begin_semaphore;
-       Semaphore *end_semaphore;
+       Semaphore *begin_semaphore = 0;
+       Semaphore *end_semaphore = 0;
 
        void begin();
        void begin(Semaphore &);
index 4e2e82249dde43a951ecfb82741a92442d00072c..bf2692172c922295c835012ccc0637ab2d909aa8 100644 (file)
@@ -147,10 +147,11 @@ void VulkanTexture::generate_mipmap()
                                change_layout(i+1, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, true);
                        },
                        [this, i](VkCommandBuffer cmd_buf, VkBuffer, size_t){
+                               const Texture &self = *static_cast<const Texture *>(this);
                                const VulkanFunctions &vk = device.get_functions();
 
                                VkImageBlit region = { };
-                               region.srcSubresource.aspectMask = get_vulkan_aspect(get_components(static_cast<const Texture *>(this)->storage_fmt));
+                               region.srcSubresource.aspectMask = get_vulkan_aspect(get_components(self.storage_fmt));
                                region.srcSubresource.mipLevel = i;
                                region.srcSubresource.baseArrayLayer = 0;
                                region.srcSubresource.layerCount = 1;
index d49f0149ca4cb79bd659d8abeccdf7ce579cdf13..29acafe0f346c3e914bfe76d7ca4134e0c7822f6 100644 (file)
@@ -1,6 +1,7 @@
 #ifndef MSP_GL_BUFFERABLE_H_
 #define MSP_GL_BUFFERABLE_H_
 
+#include <cstddef>
 #include <msp/core/noncopyable.h>
 #include "buffer.h"
 
index 2caecb56982a519ff65c12ca1ffdb6c96498316e..f6e1c41186442791a98b19d0cad600d829e61aba 100644 (file)
@@ -52,10 +52,10 @@ EnvironmentMap::EnvironmentMap(unsigned s, PixelFormat f, unsigned l, Renderable
        if(l>1)
        {
                specular_fbos.resize(l-1);
-               for(unsigned i=1; i<l; ++i)
+               for(unsigned i=0; i+1<l; ++i)
                {
-                       specular_fbos[i-1].set_format((COLOR_ATTACHMENT,f));
-                       specular_fbos[i-1].attach_layered(COLOR_ATTACHMENT, env_tex, i);
+                       specular_fbos[i].set_format((COLOR_ATTACHMENT,f));
+                       specular_fbos[i].attach_layered(COLOR_ATTACHMENT, env_tex, i+1);
                }
 
                LinAl::Matrix<float, 3, 3> face_matrices[6];
index c176f87aa231664f5eccfb442317421737004f47..51989f7711f8b84bd8a43a1eb8d872cb2a3cf7d2 100644 (file)
@@ -4,6 +4,7 @@
 #include <set>
 #include <vector>
 #include "commands.h"
+#include "cullface.h"
 #include "matrix.h"
 #include "programdata.h"
 #include "renderer_backend.h"
@@ -13,16 +14,20 @@ namespace Msp {
 namespace GL {
 
 class Batch;
+class Blend;
 class Buffer;
 class Camera;
 union ClearValue;
+class DepthTest;
 class Material;
 class Mesh;
 class Lighting;
 class Program;
 class QueryPool;
+struct Rect;
 class Renderable;
 class Sampler;
+class StencilTest;
 class Texture;
 class VertexSetup;
 
index 74b8bc3b0b4fe9a6835d9f5fab5326dddcc62fe3..e2986a249904a8c1fae136c6ef90e21a6d5c26bb 100644 (file)
@@ -12,7 +12,7 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-Tag Sequence::noclear_tag = "noclear";
+const Tag Sequence::noclear_tag = "noclear";
 
 Sequence::Sequence(unsigned w, unsigned h, const FrameFormat &f):
        width(w),
index 6ee74986d5ac412d8dc7642981f1d0004354c8d3..a5ae2e7c416122933ed3770dc3ec75d38775340c 100644 (file)
@@ -82,7 +82,7 @@ private:
        int clear_stencil = 0;
        std::vector<OwnedObject> owned_data;
 
-       static Tag noclear_tag;
+       static const Tag noclear_tag;
 
 public:
        Sequence() = default;