Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2020-09-08 01:30:38 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-09-08 05:15:50 +0300
commit28ea459a61f65de03724db8709271d41f6bf135b (patch)
treeb01a390416b317976227b5b72f25e416b90d445b /source/blender/gpu/intern
parent77f60a09310dad0cb41e2e2ec4a71f9bdb762e67 (diff)
GPUState: Encapsulate glPixelStorei inside the GLStateManager
Part of the Vulkan task T68990 Isolate the last remaining gl functions.
Diffstat (limited to 'source/blender/gpu/intern')
-rw-r--r--source/blender/gpu/intern/gpu_state.cc5
-rw-r--r--source/blender/gpu/intern/gpu_state_private.hh2
-rw-r--r--source/blender/gpu/intern/gpu_texture.cc7
3 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/gpu/intern/gpu_state.cc b/source/blender/gpu/intern/gpu_state.cc
index a88dc1beb00..68f0c290bc6 100644
--- a/source/blender/gpu/intern/gpu_state.cc
+++ b/source/blender/gpu/intern/gpu_state.cc
@@ -303,11 +303,6 @@ void GPU_finish(void)
GPU_context_active_get()->finish();
}
-void GPU_unpack_row_length_set(uint len)
-{
- glPixelStorei(GL_UNPACK_ROW_LENGTH, len);
-}
-
/** \} */
/* -------------------------------------------------------------------- */
diff --git a/source/blender/gpu/intern/gpu_state_private.hh b/source/blender/gpu/intern/gpu_state_private.hh
index 6ce240df108..9fee45e7bd4 100644
--- a/source/blender/gpu/intern/gpu_state_private.hh
+++ b/source/blender/gpu/intern/gpu_state_private.hh
@@ -166,6 +166,8 @@ class GPUStateManager {
virtual void texture_bind(Texture *tex, eGPUSamplerState sampler, int unit) = 0;
virtual void texture_unbind(Texture *tex) = 0;
virtual void texture_unbind_all(void) = 0;
+
+ virtual void texture_unpack_row_length_set(uint len) = 0;
};
} // namespace gpu
diff --git a/source/blender/gpu/intern/gpu_texture.cc b/source/blender/gpu/intern/gpu_texture.cc
index 0aa1a6553f9..95f922173b5 100644
--- a/source/blender/gpu/intern/gpu_texture.cc
+++ b/source/blender/gpu/intern/gpu_texture.cc
@@ -380,6 +380,13 @@ void GPU_texture_update(GPUTexture *tex, eGPUDataFormat data_format, const void
reinterpret_cast<Texture *>(tex)->update(data_format, data);
}
+/* Makes data interpretation aware of the source layout.
+ * Skipping pixels correctly when changing rows when doing partial update.*/
+void GPU_unpack_row_length_set(uint len)
+{
+ GPU_context_active_get()->state_manager->texture_unpack_row_length_set(len);
+}
+
void GPU_invalid_tex_init(void)
{
/* TODO remove */