Separated GL Buffer stuff
This commit is contained in:
+44
-40
@@ -134,12 +134,10 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="auth_2d.cpp" />
|
||||
<ClCompile Include="bone_database.cpp" />
|
||||
<ClCompile Include="canonical_properties.cpp" />
|
||||
<ClCompile Include="clear_color.cpp" />
|
||||
<ClCompile Include="data_test\rob_osage_test.cpp" />
|
||||
<ClCompile Include="dw.cpp" />
|
||||
<ClCompile Include="GL\array_buffer.cpp" />
|
||||
<ClCompile Include="GL\element_array_buffer.cpp" />
|
||||
<ClCompile Include="GL\shader_storage_buffer.cpp" />
|
||||
<ClCompile Include="GL\uniform_buffer.cpp" />
|
||||
<ClCompile Include="Glitter\animation.cpp" />
|
||||
<ClCompile Include="Glitter\counter.cpp" />
|
||||
<ClCompile Include="Glitter\curve.cpp" />
|
||||
@@ -161,6 +159,26 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
<ClCompile Include="Glitter\render_group.cpp" />
|
||||
<ClCompile Include="Glitter\render_scene.cpp" />
|
||||
<ClCompile Include="Glitter\scene.cpp" />
|
||||
<ClCompile Include="data_test\rob_osage_test.cpp" />
|
||||
<ClCompile Include="graphics\color_change_dw.cpp" />
|
||||
<ClCompile Include="light_param\fog.cpp" />
|
||||
<ClCompile Include="light_param\light.cpp" />
|
||||
<ClCompile Include="mdl\disp_manager.cpp" />
|
||||
<ClCompile Include="mdl\draw_object.cpp" />
|
||||
<ClCompile Include="pv_game\dsc.cpp" />
|
||||
<ClCompile Include="pv_game\pvpp.cpp" />
|
||||
<ClCompile Include="pv_game\pvsr.cpp" />
|
||||
<ClCompile Include="pv_game\pv_game.cpp" />
|
||||
<ClCompile Include="renderer\dof.cpp" />
|
||||
<ClCompile Include="renderer\fbo.cpp" />
|
||||
<ClCompile Include="renderer\gl_program.cpp" />
|
||||
<ClCompile Include="renderer\transparency.cpp" />
|
||||
<ClCompile Include="rob\rob.cpp" />
|
||||
<ClCompile Include="auth_2d.cpp" />
|
||||
<ClCompile Include="bone_database.cpp" />
|
||||
<ClCompile Include="canonical_properties.cpp" />
|
||||
<ClCompile Include="clear_color.cpp" />
|
||||
<ClCompile Include="dw.cpp" />
|
||||
<ClCompile Include="auth_3d.cpp" />
|
||||
<ClCompile Include="camera.cpp" />
|
||||
<ClCompile Include="color.cpp" />
|
||||
@@ -169,30 +187,16 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
<ClCompile Include="file_handler.cpp" />
|
||||
<ClCompile Include="frame_rate_control.cpp" />
|
||||
<ClCompile Include="gl_state.cpp" />
|
||||
<ClCompile Include="graphics\color_change_dw.cpp" />
|
||||
<ClCompile Include="hook.cpp" />
|
||||
<ClCompile Include="light_param.cpp" />
|
||||
<ClCompile Include="light_param\fog.cpp" />
|
||||
<ClCompile Include="light_param\light.cpp" />
|
||||
<ClCompile Include="mdl\disp_manager.cpp" />
|
||||
<ClCompile Include="mdl\draw_object.cpp" />
|
||||
<ClCompile Include="object.cpp" />
|
||||
<ClCompile Include="print.cpp" />
|
||||
<ClCompile Include="print_work.cpp" />
|
||||
<ClCompile Include="pv_game\dsc.cpp" />
|
||||
<ClCompile Include="pv_game\pvpp.cpp" />
|
||||
<ClCompile Include="pv_game\pvsr.cpp" />
|
||||
<ClCompile Include="pv_game\pv_game.cpp" />
|
||||
<ClCompile Include="render.cpp" />
|
||||
<ClCompile Include="renderer\gl_program.cpp" />
|
||||
<ClCompile Include="render_context.cpp" />
|
||||
<ClCompile Include="render_manager.cpp" />
|
||||
<ClCompile Include="render_texture.cpp" />
|
||||
<ClCompile Include="renderer\dof.cpp" />
|
||||
<ClCompile Include="renderer\fbo.cpp" />
|
||||
<ClCompile Include="renderer\transparency.cpp" />
|
||||
<ClCompile Include="resolution_mode.cpp" />
|
||||
<ClCompile Include="rob\rob.cpp" />
|
||||
<ClCompile Include="screen_shot.cpp" />
|
||||
<ClCompile Include="shader.cpp" />
|
||||
<ClCompile Include="shader_ft.cpp" />
|
||||
@@ -210,13 +214,31 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
<ResourceCompile Include="DivaGL.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GL\array_buffer.hpp" />
|
||||
<ClInclude Include="GL\element_array_buffer.hpp" />
|
||||
<ClInclude Include="GL\shader_storage_buffer.hpp" />
|
||||
<ClInclude Include="GL\uniform_buffer.hpp" />
|
||||
<ClInclude Include="Glitter\glitter.hpp" />
|
||||
<ClInclude Include="data_test\rob_osage_test.hpp" />
|
||||
<ClInclude Include="graphics\color_change_dw.hpp" />
|
||||
<ClInclude Include="light_param\fog.hpp" />
|
||||
<ClInclude Include="light_param\light.hpp" />
|
||||
<ClInclude Include="mdl\disp_manager.hpp" />
|
||||
<ClInclude Include="mdl\draw_object.hpp" />
|
||||
<ClInclude Include="pv_game\dsc.hpp" />
|
||||
<ClInclude Include="pv_game\pvpp.hpp" />
|
||||
<ClInclude Include="pv_game\pvsr.hpp" />
|
||||
<ClInclude Include="pv_game\pv_game.hpp" />
|
||||
<ClInclude Include="renderer\gl_program.hpp" />
|
||||
<ClInclude Include="renderer\dof.hpp" />
|
||||
<ClInclude Include="renderer\fbo.hpp" />
|
||||
<ClInclude Include="renderer\transparency.hpp" />
|
||||
<ClInclude Include="rob\rob.hpp" />
|
||||
<ClInclude Include="auth_2d.hpp" />
|
||||
<ClInclude Include="bone_database.hpp" />
|
||||
<ClInclude Include="canonical_properties.hpp" />
|
||||
<ClInclude Include="clear_color.hpp" />
|
||||
<ClInclude Include="data_test\rob_osage_test.hpp" />
|
||||
<ClInclude Include="dw.hpp" />
|
||||
<ClInclude Include="Glitter\glitter.hpp" />
|
||||
<ClInclude Include="auth_3d.hpp" />
|
||||
<ClInclude Include="camera.hpp" />
|
||||
<ClInclude Include="color.hpp" />
|
||||
@@ -224,37 +246,19 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
<ClInclude Include="file_handler.hpp" />
|
||||
<ClInclude Include="frame_rate_control.hpp" />
|
||||
<ClInclude Include="gl.hpp" />
|
||||
<ClInclude Include="gl_array_buffer.hpp" />
|
||||
<ClInclude Include="gl_element_array_buffer.hpp" />
|
||||
<ClInclude Include="gl_shader_storage_buffer.hpp" />
|
||||
<ClInclude Include="gl_state.hpp" />
|
||||
<ClInclude Include="gl_uniform_buffer.hpp" />
|
||||
<ClInclude Include="graphics\color_change_dw.hpp" />
|
||||
<ClInclude Include="hook.hpp" />
|
||||
<ClInclude Include="item_table.hpp" />
|
||||
<ClInclude Include="light_param.hpp" />
|
||||
<ClInclude Include="light_param\fog.hpp" />
|
||||
<ClInclude Include="light_param\light.hpp" />
|
||||
<ClInclude Include="mdl\disp_manager.hpp" />
|
||||
<ClInclude Include="mdl\draw_object.hpp" />
|
||||
<ClInclude Include="object.hpp" />
|
||||
<ClInclude Include="print.hpp" />
|
||||
<ClInclude Include="print_work.hpp" />
|
||||
<ClInclude Include="pv_game\dsc.hpp" />
|
||||
<ClInclude Include="pv_game\pvpp.hpp" />
|
||||
<ClInclude Include="pv_game\pvsr.hpp" />
|
||||
<ClInclude Include="pv_game\pv_game.hpp" />
|
||||
<ClInclude Include="render.hpp" />
|
||||
<ClInclude Include="renderer\gl_program.hpp" />
|
||||
<ClInclude Include="render_context.hpp" />
|
||||
<ClInclude Include="render_manager.hpp" />
|
||||
<ClInclude Include="render_texture.hpp" />
|
||||
<ClInclude Include="renderer\dof.hpp" />
|
||||
<ClInclude Include="renderer\fbo.hpp" />
|
||||
<ClInclude Include="renderer\transparency.hpp" />
|
||||
<ClInclude Include="resolution_mode.hpp" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="rob\rob.hpp" />
|
||||
<ClInclude Include="screen_shot.hpp" />
|
||||
<ClInclude Include="shader.hpp" />
|
||||
<ClInclude Include="shader_ft.hpp" />
|
||||
|
||||
@@ -3,33 +3,15 @@
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "array_buffer.hpp"
|
||||
#include "../gl_state.hpp"
|
||||
|
||||
#include "wrap.hpp"
|
||||
#include "gl_state.hpp"
|
||||
|
||||
struct GLArrayBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline GLArrayBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline GLArrayBuffer(GLuint buffer) : buffer(buffer) {
|
||||
|
||||
}
|
||||
|
||||
inline ~GLArrayBuffer() {
|
||||
|
||||
}
|
||||
|
||||
inline void Bind(bool force = false) {
|
||||
namespace GL {
|
||||
void ArrayBuffer::Bind(bool force) {
|
||||
gl_state_bind_array_buffer(buffer, force);
|
||||
}
|
||||
|
||||
inline void Create(size_t size) {
|
||||
void ArrayBuffer::Create(size_t size) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -48,7 +30,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Create(size_t size, const void* data, bool dynamic = false) {
|
||||
void ArrayBuffer::Create(size_t size, const void* data, bool dynamic) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -69,18 +51,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Destroy() {
|
||||
void ArrayBuffer::Destroy() {
|
||||
if (buffer) {
|
||||
glDeleteBuffers(1, &buffer);
|
||||
buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline void* MapMemory() {
|
||||
void* ArrayBuffer::MapMemory() {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -104,7 +82,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void* MapMemory(size_t offset, size_t length) {
|
||||
void* ArrayBuffer::MapMemory(size_t offset, size_t length) {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -128,11 +106,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
inline void UnmapMemory() {
|
||||
void ArrayBuffer::UnmapMemory() {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -144,7 +118,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
void ArrayBuffer::WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -155,17 +129,4 @@ public:
|
||||
glBufferSubData(GL_ARRAY_BUFFER, (GLsizeiptr)offset, (GLsizeiptr)size, data);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
if (GL_VERSION_4_5)
|
||||
glNamedBufferSubData(buffer, 0, sizeof(T), &data);
|
||||
else {
|
||||
gl_state_bind_array_buffer(buffer);
|
||||
glBufferSubData(GL_ARRAY_BUFFER, 0, sizeof(T), &data);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../KKdLib/default.hpp"
|
||||
#include "../wrap.hpp"
|
||||
|
||||
namespace GL {
|
||||
struct ArrayBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline ArrayBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ArrayBuffer(GLuint buffer) : buffer(buffer) {
|
||||
|
||||
}
|
||||
|
||||
inline ~ArrayBuffer() {
|
||||
|
||||
}
|
||||
|
||||
void Bind(bool force = false);
|
||||
void Create(size_t size);
|
||||
void Create(size_t size, const void* data, bool dynamic = false);
|
||||
void Destroy();
|
||||
void* MapMemory();
|
||||
void* MapMemory(size_t offset, size_t length);
|
||||
void UnmapMemory();
|
||||
void WriteMemory(size_t offset, size_t size, const void* data);
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
WriteMemory(0, sizeof(T), &data);
|
||||
}
|
||||
|
||||
inline operator GLuint() const {
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3,29 +3,15 @@
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "element_array_buffer.hpp"
|
||||
#include "../gl_state.hpp"
|
||||
|
||||
#include "wrap.hpp"
|
||||
#include "gl_state.hpp"
|
||||
|
||||
struct GLElementArrayBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline GLElementArrayBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ~GLElementArrayBuffer() {
|
||||
|
||||
}
|
||||
|
||||
inline void Bind(bool force = false) {
|
||||
namespace GL {
|
||||
void ElementArrayBuffer::Bind(bool force) {
|
||||
gl_state_bind_element_array_buffer(buffer, force);
|
||||
}
|
||||
|
||||
inline void Create(size_t size) {
|
||||
void ElementArrayBuffer::Create(size_t size) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -44,7 +30,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Create(size_t size, const void* data, bool dynamic = false) {
|
||||
void ElementArrayBuffer::Create(size_t size, const void* data, bool dynamic) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -65,18 +51,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Destroy() {
|
||||
void ElementArrayBuffer::Destroy() {
|
||||
if (buffer) {
|
||||
glDeleteBuffers(1, &buffer);
|
||||
buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline void* MapMemory() {
|
||||
void* ElementArrayBuffer::MapMemory() {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -100,7 +82,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void* MapMemory(size_t offset, size_t length) {
|
||||
void* ElementArrayBuffer::MapMemory(size_t offset, size_t length) {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -124,11 +106,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
inline void UnmapMemory() {
|
||||
void ElementArrayBuffer::UnmapMemory() {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -140,7 +118,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
void ElementArrayBuffer::WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -151,17 +129,4 @@ public:
|
||||
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, (GLsizeiptr)offset, (GLsizeiptr)size, data);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
if (GL_VERSION_4_5)
|
||||
glNamedBufferSubData(buffer, 0, sizeof(T), &data);
|
||||
else {
|
||||
gl_state_bind_element_array_buffer(buffer);
|
||||
glBufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, sizeof(T), &data);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../KKdLib/default.hpp"
|
||||
#include "../wrap.hpp"
|
||||
|
||||
namespace GL {
|
||||
struct ElementArrayBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline ElementArrayBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ~ElementArrayBuffer() {
|
||||
|
||||
}
|
||||
|
||||
void Bind(bool force = false);
|
||||
void Create(size_t size);
|
||||
void Create(size_t size, const void* data, bool dynamic = false);
|
||||
void Destroy();
|
||||
void* MapMemory();
|
||||
void* MapMemory(size_t offset, size_t length);
|
||||
void UnmapMemory();
|
||||
void WriteMemory(size_t offset, size_t size, const void* data);
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
WriteMemory(0, sizeof(T), &data);
|
||||
}
|
||||
|
||||
inline operator GLuint() const {
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3,29 +3,15 @@
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shader_storage_buffer.hpp"
|
||||
#include "../gl_state.hpp"
|
||||
|
||||
#include "wrap.hpp"
|
||||
#include "gl_state.hpp"
|
||||
|
||||
struct GLShaderStorageBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline GLShaderStorageBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ~GLShaderStorageBuffer() {
|
||||
|
||||
}
|
||||
|
||||
inline void Bind(int32_t index, bool force = false) {
|
||||
namespace GL {
|
||||
void ShaderStorageBuffer::Bind(int32_t index, bool force) {
|
||||
gl_state_bind_shader_storage_buffer_base(index, buffer, force);
|
||||
}
|
||||
|
||||
inline void Create(size_t size) {
|
||||
void ShaderStorageBuffer::Create(size_t size) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -44,7 +30,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Create(size_t size, const void* data, bool dynamic = false) {
|
||||
void ShaderStorageBuffer::Create(size_t size, const void* data, bool dynamic) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -65,18 +51,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Destroy() {
|
||||
void ShaderStorageBuffer::Destroy() {
|
||||
if (buffer) {
|
||||
glDeleteBuffers(1, &buffer);
|
||||
buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline void* MapMemory() {
|
||||
void* ShaderStorageBuffer::MapMemory() {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -100,7 +82,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void* MapMemory(size_t offset, size_t length) {
|
||||
void* ShaderStorageBuffer::MapMemory(size_t offset, size_t length) {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -124,11 +106,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
inline void UnmapMemory() {
|
||||
void ShaderStorageBuffer::UnmapMemory() {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -140,7 +118,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
void ShaderStorageBuffer::WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -151,17 +129,4 @@ public:
|
||||
glBufferSubData(GL_SHADER_STORAGE_BUFFER, (GLsizeiptr)offset, (GLsizeiptr)size, data);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
if (GL_VERSION_4_5)
|
||||
glNamedBufferSubData(buffer, 0, sizeof(T), &data);
|
||||
else {
|
||||
gl_state_bind_shader_storage_buffer(buffer);
|
||||
glBufferSubData(GL_SHADER_STORAGE_BUFFER, 0, sizeof(T), &data);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../KKdLib/default.hpp"
|
||||
#include "../wrap.hpp"
|
||||
|
||||
namespace GL {
|
||||
struct ShaderStorageBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline ShaderStorageBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ~ShaderStorageBuffer() {
|
||||
|
||||
}
|
||||
|
||||
void Bind(int32_t index, bool force = false);
|
||||
void Create(size_t size);
|
||||
void Create(size_t size, const void* data, bool dynamic = false);
|
||||
void Destroy();
|
||||
void* MapMemory();
|
||||
void* MapMemory(size_t offset, size_t length);
|
||||
void UnmapMemory();
|
||||
void WriteMemory(size_t offset, size_t size, const void* data);
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
WriteMemory(0, sizeof(T), &data);
|
||||
}
|
||||
|
||||
inline operator GLuint() const {
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -3,29 +3,15 @@
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "uniform_buffer.hpp"
|
||||
#include "../gl_state.hpp"
|
||||
|
||||
#include "wrap.hpp"
|
||||
#include "gl_state.hpp"
|
||||
|
||||
struct GLUniformBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline GLUniformBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ~GLUniformBuffer() {
|
||||
|
||||
}
|
||||
|
||||
inline void Bind(int32_t index, bool force = false) {
|
||||
namespace GL {
|
||||
void UniformBuffer::Bind(int32_t index, bool force) {
|
||||
gl_state_bind_uniform_buffer_base(index, buffer, force);
|
||||
}
|
||||
|
||||
inline void Create(size_t size) {
|
||||
void UniformBuffer::Create(size_t size) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -44,7 +30,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Create(size_t size, const void* data, bool dynamic = false) {
|
||||
void UniformBuffer::Create(size_t size, const void* data, bool dynamic) {
|
||||
if (buffer)
|
||||
return;
|
||||
|
||||
@@ -65,18 +51,14 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void Destroy() {
|
||||
void UniformBuffer::Destroy() {
|
||||
if (buffer) {
|
||||
glDeleteBuffers(1, &buffer);
|
||||
buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline void* MapMemory() {
|
||||
void* UniformBuffer::MapMemory() {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -100,7 +82,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline void* MapMemory(size_t offset, size_t length) {
|
||||
void* UniformBuffer::MapMemory(size_t offset, size_t length) {
|
||||
if (!buffer)
|
||||
return 0;
|
||||
|
||||
@@ -124,11 +106,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
inline void UnmapMemory() {
|
||||
void UniformBuffer::UnmapMemory() {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -140,7 +118,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
inline void WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
void UniformBuffer::WriteMemory(size_t offset, size_t size, const void* data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
@@ -151,17 +129,4 @@ public:
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, (GLsizeiptr)offset, (GLsizeiptr)size, data);
|
||||
}
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
if (!buffer)
|
||||
return;
|
||||
|
||||
if (GL_VERSION_4_5)
|
||||
glNamedBufferSubData(buffer, 0, sizeof(T), &data);
|
||||
else {
|
||||
gl_state_bind_uniform_buffer(buffer);
|
||||
glBufferSubData(GL_UNIFORM_BUFFER, 0, sizeof(T), &data);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../../KKdLib/default.hpp"
|
||||
#include "../wrap.hpp"
|
||||
|
||||
namespace GL {
|
||||
struct UniformBuffer {
|
||||
private:
|
||||
GLuint buffer;
|
||||
|
||||
public:
|
||||
inline UniformBuffer() : buffer() {
|
||||
|
||||
}
|
||||
|
||||
inline ~UniformBuffer() {
|
||||
|
||||
}
|
||||
|
||||
void Bind(int32_t index, bool force = false);
|
||||
void Create(size_t size);
|
||||
void Create(size_t size, const void* data, bool dynamic = false);
|
||||
void Destroy();
|
||||
void* MapMemory();
|
||||
void* MapMemory(size_t offset, size_t length);
|
||||
void UnmapMemory();
|
||||
void WriteMemory(size_t offset, size_t size, const void* data);
|
||||
|
||||
inline bool IsNull() {
|
||||
return !buffer;
|
||||
}
|
||||
|
||||
inline bool NotNull() {
|
||||
return !!buffer;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void WriteMemory(T& data) {
|
||||
WriteMemory(0, sizeof(T), &data);
|
||||
}
|
||||
|
||||
inline operator GLuint() const {
|
||||
return buffer;
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -28,7 +28,7 @@ namespace Glitter {
|
||||
*angle = (float_t)M_PI - *angle;
|
||||
}
|
||||
|
||||
void CreateBuffer(int32_t max_count, bool is_quad, GLuint& vao, GLArrayBuffer& vbo, GLElementArrayBuffer& ebo) {
|
||||
void CreateBuffer(int32_t max_count, bool is_quad, GLuint& vao, GL::ArrayBuffer& vbo, GL::ElementArrayBuffer& ebo) {
|
||||
glGenVertexArrays(1, &vao);
|
||||
gl_state_bind_vertex_array(vao, true);
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Glitter {
|
||||
gl_state_bind_element_array_buffer(0);
|
||||
}
|
||||
|
||||
void DeleteBuffer(GLuint& vao, GLArrayBuffer& vbo, GLElementArrayBuffer& ebo) {
|
||||
void DeleteBuffer(GLuint& vao, GL::ArrayBuffer& vbo, GL::ElementArrayBuffer& ebo) {
|
||||
ebo.Destroy();
|
||||
vbo.Destroy();
|
||||
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
#include "../../KKdLib/hash.hpp"
|
||||
#include "../../KKdLib/mat.hpp"
|
||||
#include "../../KKdLib/vec.hpp"
|
||||
#include "../GL/array_buffer.hpp"
|
||||
#include "../GL/element_array_buffer.hpp"
|
||||
#include "../color.hpp"
|
||||
#include "../file_handler.hpp"
|
||||
#include "../frame_rate_control.hpp"
|
||||
#include "../gl.hpp"
|
||||
#include "../gl_array_buffer.hpp"
|
||||
#include "../gl_element_array_buffer.hpp"
|
||||
#include "../object.hpp"
|
||||
#include "../task.hpp"
|
||||
#include "../types.hpp"
|
||||
@@ -981,12 +981,12 @@ namespace Glitter {
|
||||
struct Sub {
|
||||
Glitter::Particle::Data data;
|
||||
Glitter::Buffer* buffer;
|
||||
GLArrayBuffer vbo;
|
||||
GL::ArrayBuffer vbo;
|
||||
int32_t max_count;
|
||||
bool field_168;
|
||||
int32_t dword16C;
|
||||
GLuint vao;
|
||||
GLElementArrayBuffer ebo;
|
||||
GL::ElementArrayBuffer ebo;
|
||||
DrawListData* draw_list;
|
||||
};
|
||||
|
||||
@@ -1147,12 +1147,12 @@ namespace Glitter {
|
||||
ParticleInst* particle_inst;
|
||||
DispType disp_type;
|
||||
FogType fog_type;
|
||||
GLArrayBuffer vbo;
|
||||
GL::ArrayBuffer vbo;
|
||||
float_t emission;
|
||||
bool use_own_buffer;
|
||||
int32_t dword12C;
|
||||
GLuint vao;
|
||||
GLElementArrayBuffer ebo;
|
||||
GL::ElementArrayBuffer ebo;
|
||||
size_t disp;
|
||||
mat4 mat_draw;
|
||||
DrawListData* draw_list;
|
||||
@@ -1192,8 +1192,8 @@ namespace Glitter {
|
||||
DispType disp_type;
|
||||
FogType fog_type;
|
||||
GLuint vao;
|
||||
GLArrayBuffer vbo;
|
||||
GLElementArrayBuffer ebo;
|
||||
GL::ArrayBuffer vbo;
|
||||
GL::ElementArrayBuffer ebo;
|
||||
float_t emission;
|
||||
DrawListData draw_list;
|
||||
|
||||
@@ -1462,8 +1462,8 @@ namespace Glitter {
|
||||
extern void axis_angle_from_vectors(vec3* axis, float_t* angle, const vec3* vec0, const vec3* vec1);
|
||||
|
||||
extern void CreateBuffer(int32_t max_count, bool is_quad,
|
||||
GLuint& vao, GLArrayBuffer& vbo, GLElementArrayBuffer& ebo);
|
||||
extern void DeleteBuffer(GLuint& vao, GLArrayBuffer& vbo, GLElementArrayBuffer& ebo);
|
||||
GLuint& vao, GL::ArrayBuffer& vbo, GL::ElementArrayBuffer& ebo);
|
||||
extern void DeleteBuffer(GLuint& vao, GL::ArrayBuffer& vbo, GL::ElementArrayBuffer& ebo);
|
||||
|
||||
extern void Patch();
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Glitter {
|
||||
else {
|
||||
size_t particle = *(size_t*)((size_t)rend_group->particle_inst + 0x98 + 0x178);
|
||||
rend_group->vao = *((GLuint*)(particle + 0x40 + 0x170));
|
||||
rend_group->ebo = *((GLElementArrayBuffer*)(particle + 0x40 + 0x174));
|
||||
rend_group->ebo = *((GL::ElementArrayBuffer*)(particle + 0x40 + 0x174));
|
||||
rend_group->draw_list = *(DrawListData**)(particle
|
||||
+ 0x40 + 0x170 + sizeof(GLuint) * 2);
|
||||
}
|
||||
|
||||
+36
-31
@@ -7,14 +7,19 @@
|
||||
#include "../KKdLib/prj/algorithm.hpp"
|
||||
#include "../KKdLib/prj/vector_pair.hpp"
|
||||
#include "../KKdLib/hash.hpp"
|
||||
#include "GL/element_array_buffer.hpp"
|
||||
#include "GL/shader_storage_buffer.hpp"
|
||||
#include "GL/uniform_buffer.hpp"
|
||||
#include "rob/rob.hpp"
|
||||
#include "auth_3d.hpp"
|
||||
#include "file_handler.hpp"
|
||||
#include "frame_rate_control.hpp"
|
||||
#include "gl_state.hpp"
|
||||
#include "gl_element_array_buffer.hpp"
|
||||
#include "render_context.hpp"
|
||||
#include "render_manager.hpp"
|
||||
#include "render_texture.hpp"
|
||||
#include "shader_ft.hpp"
|
||||
#include "stage.hpp"
|
||||
#include "stage_param.hpp"
|
||||
#include "texture.hpp"
|
||||
#include <Helpers.h>
|
||||
@@ -228,8 +233,8 @@ struct particle_vertex_data {
|
||||
};
|
||||
|
||||
struct star_catalog_milky_way {
|
||||
GLArrayBuffer vbo;
|
||||
GLElementArrayBuffer ebo;
|
||||
GL::ArrayBuffer vbo;
|
||||
GL::ElementArrayBuffer ebo;
|
||||
GLuint vao;
|
||||
uint16_t restart_index;
|
||||
int32_t idx_count;
|
||||
@@ -247,7 +252,7 @@ struct star_catalog_milky_way {
|
||||
float_t longitude_offset_degs_10, float_t latitude_offset_degs_10);
|
||||
void create_default_sphere();
|
||||
void delete_buffers();
|
||||
void draw(const mat4& vp, const mat4& model, texture* tex, GLUniformBuffer& scene_ubo);
|
||||
void draw(const mat4& vp, const mat4& model, texture* tex, GL::UniformBuffer& scene_ubo);
|
||||
};
|
||||
|
||||
static_assert(sizeof(star_catalog_milky_way) == 0x34, "\"star_catalog_milky_way\" struct should have a size of 0x34");
|
||||
@@ -414,48 +419,48 @@ struct water_particle_scene_shader_data {
|
||||
vec4 g_state_point_attenuation;
|
||||
};
|
||||
|
||||
static prj::vector_pair<EffectFogRing*, GLShaderStorageBuffer> fog_ring_ssbo;
|
||||
static prj::vector_pair<EffectFogRing*, GL::ShaderStorageBuffer> fog_ring_ssbo;
|
||||
|
||||
static GLuint leaf_ptcl_vao;
|
||||
static GLArrayBuffer leaf_ptcl_vbo;
|
||||
static GLElementArrayBuffer leaf_ptcl_ebo;
|
||||
static GLUniformBuffer leaf_particle_scene_ubo;
|
||||
static GL::ArrayBuffer leaf_ptcl_vbo;
|
||||
static GL::ElementArrayBuffer leaf_ptcl_ebo;
|
||||
static GL::UniformBuffer leaf_particle_scene_ubo;
|
||||
static const size_t leaf_ptcl_count = 0x800;
|
||||
|
||||
static GLuint ptcl_vao;
|
||||
static GLArrayBuffer ptcl_vbo;
|
||||
static GLUniformBuffer particle_scene_ubo;
|
||||
static GL::ArrayBuffer ptcl_vbo;
|
||||
static GL::UniformBuffer particle_scene_ubo;
|
||||
static const size_t ptcl_count = 0x400;
|
||||
|
||||
static GLShaderStorageBuffer rain_ssbo;
|
||||
static GLUniformBuffer rain_particle_scene_ubo;
|
||||
static GLUniformBuffer rain_particle_batch_ubo;
|
||||
static GL::ShaderStorageBuffer rain_ssbo;
|
||||
static GL::UniformBuffer rain_particle_scene_ubo;
|
||||
static GL::UniformBuffer rain_particle_batch_ubo;
|
||||
static const size_t rain_ptcl_count = 0x8000;
|
||||
|
||||
static GLUniformBuffer ripple_batch_ubo;
|
||||
static GLUniformBuffer ripple_scene_ubo;
|
||||
static GL::UniformBuffer ripple_batch_ubo;
|
||||
static GL::UniformBuffer ripple_scene_ubo;
|
||||
|
||||
static GLShaderStorageBuffer ripple_emit_ssbo;
|
||||
static GLUniformBuffer ripple_emit_scene_ubo;
|
||||
static GL::ShaderStorageBuffer ripple_emit_ssbo;
|
||||
static GL::UniformBuffer ripple_emit_scene_ubo;
|
||||
static const size_t ripple_emit_count = 5000;
|
||||
|
||||
static GLShaderStorageBuffer snow_ssbo;
|
||||
static GLShaderStorageBuffer snow_gpu_ssbo;
|
||||
static GLShaderStorageBuffer snow_fallen_ssbo;
|
||||
static GLUniformBuffer snow_particle_scene_ubo;
|
||||
static GLUniformBuffer snow_particle_batch_ubo;
|
||||
static GL::ShaderStorageBuffer snow_ssbo;
|
||||
static GL::ShaderStorageBuffer snow_gpu_ssbo;
|
||||
static GL::ShaderStorageBuffer snow_fallen_ssbo;
|
||||
static GL::UniformBuffer snow_particle_scene_ubo;
|
||||
static GL::UniformBuffer snow_particle_batch_ubo;
|
||||
static const size_t snow_ptcl_count = 0x8000;
|
||||
static const size_t snow_ptcl_fallen_count = 0x2000;
|
||||
|
||||
static GLShaderStorageBuffer stars_ssbo;
|
||||
static GLUniformBuffer stars_scene_ubo;
|
||||
static GLUniformBuffer stars_batch_ubo;
|
||||
static GL::ShaderStorageBuffer stars_ssbo;
|
||||
static GL::UniformBuffer stars_scene_ubo;
|
||||
static GL::UniformBuffer stars_batch_ubo;
|
||||
static int32_t star_count;
|
||||
static int32_t star_b_count;
|
||||
static GLuint star_sampler;
|
||||
|
||||
static prj::vector_pair<water_particle*, GLShaderStorageBuffer> water_particle_ssbo;
|
||||
static GLUniformBuffer water_particle_scene_ubo;
|
||||
static prj::vector_pair<water_particle*, GL::ShaderStorageBuffer> water_particle_ssbo;
|
||||
static GL::UniformBuffer water_particle_scene_ubo;
|
||||
|
||||
static float_t& snow_particle_delta_frame = *(float_t*)0x0000000140C9A4E0;
|
||||
|
||||
@@ -814,7 +819,7 @@ HOOK(void, FASTCALL, EffectFogRing__calc_vert, 0x000000001403495B0, EffectFogRin
|
||||
if (elem == fog_ring_ssbo.end())
|
||||
return;
|
||||
|
||||
GLShaderStorageBuffer& ssbo = elem->second;
|
||||
GL::ShaderStorageBuffer& ssbo = elem->second;
|
||||
|
||||
float_t density = fog_ring->density;
|
||||
fog_ring_data* ptcl_data = fog_ring->ptcl_data;
|
||||
@@ -1674,7 +1679,7 @@ void star_catalog_milky_way::delete_buffers() {
|
||||
}
|
||||
}
|
||||
|
||||
void star_catalog_milky_way::draw(const mat4& vp, const mat4& mat, texture* tex, GLUniformBuffer& scene_ubo) {
|
||||
void star_catalog_milky_way::draw(const mat4& vp, const mat4& mat, texture* tex, GL::UniformBuffer& scene_ubo) {
|
||||
if (!vao)
|
||||
return;
|
||||
|
||||
@@ -1920,7 +1925,7 @@ void water_particle::draw(mat4* mat) {
|
||||
if (elem == water_particle_ssbo.end())
|
||||
return;
|
||||
|
||||
GLShaderStorageBuffer& ssbo = elem->second;
|
||||
GL::ShaderStorageBuffer& ssbo = elem->second;
|
||||
|
||||
water_particle_vertex_data* vtx_data = (water_particle_vertex_data*)ssbo.MapMemory();
|
||||
if (!vtx_data)
|
||||
@@ -1978,7 +1983,7 @@ static void draw_fog_particle(EffectFogRing* data, mat4* mat) {
|
||||
if (elem == fog_ring_ssbo.end())
|
||||
return;
|
||||
|
||||
GLShaderStorageBuffer& ssbo = elem->second;
|
||||
GL::ShaderStorageBuffer& ssbo = elem->second;
|
||||
|
||||
shaders_ft.set(SHADER_FT_FOGPTCL);
|
||||
gl_state_enable_blend();
|
||||
|
||||
@@ -6,15 +6,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "../KKdLib/default.hpp"
|
||||
#include "../KKdLib/vec.hpp"
|
||||
#include "../KKdLib/mat.hpp"
|
||||
#include "../KKdLib/vec.hpp"
|
||||
#include "gl_shader_storage_buffer.hpp"
|
||||
#include "gl_uniform_buffer.hpp"
|
||||
#include "rob/rob.hpp"
|
||||
#include "render_texture.hpp"
|
||||
#include "stage.hpp"
|
||||
#include "stage_param.hpp"
|
||||
|
||||
enum EffectType {
|
||||
EFFECT_INVALID = -1,
|
||||
|
||||
+2
-2
@@ -464,7 +464,7 @@ typedef enum SpecialNumbers {
|
||||
WGL_FONT_POLYGONS = 1,
|
||||
} SpecialNumbers;
|
||||
|
||||
typedef enum GL {
|
||||
typedef enum _GL {
|
||||
GL_POINTS = 0x0000,
|
||||
GL_LINES = 0x0001,
|
||||
GL_LINE_LOOP = 0x0002,
|
||||
@@ -5938,7 +5938,7 @@ typedef enum GL {
|
||||
WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256,
|
||||
WGL_NO_RESET_NOTIFICATION_ARB = 0x8261,
|
||||
WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126,
|
||||
} GL;
|
||||
} _GL;
|
||||
|
||||
typedef enum RegisterCombinerPname {
|
||||
GL_COMBINE = 0x8570,
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
#include "../../KKdLib/default.hpp"
|
||||
#include "../../KKdLib/mat.hpp"
|
||||
#include "../../KKdLib/vec.hpp"
|
||||
#include "../gl_array_buffer.hpp"
|
||||
#include "../gl_element_array_buffer.hpp"
|
||||
#include "../GL/array_buffer.hpp"
|
||||
#include "../GL/element_array_buffer.hpp"
|
||||
#include "../color.hpp"
|
||||
#include "../object.hpp"
|
||||
#include "../shadow.hpp"
|
||||
@@ -397,8 +397,8 @@ namespace mdl {
|
||||
};
|
||||
|
||||
struct etc_vertex_array {
|
||||
GLArrayBuffer vertex_buffer;
|
||||
GLElementArrayBuffer index_buffer;
|
||||
GL::ArrayBuffer vertex_buffer;
|
||||
GL::ElementArrayBuffer index_buffer;
|
||||
int32_t alive_time;
|
||||
GLuint vertex_array;
|
||||
EtcObj::Data data;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include "renderer/dof.hpp"
|
||||
#include "renderer/transparency.hpp"
|
||||
#include "camera.hpp"
|
||||
#include "gl_uniform_buffer.hpp"
|
||||
#include "GL/uniform_buffer.hpp"
|
||||
|
||||
enum tone_map_method {
|
||||
TONE_MAP_YCC_EXPONENT = 0,
|
||||
|
||||
@@ -614,12 +614,3 @@ void render_context::init() {
|
||||
sss_data* sss_data_get() {
|
||||
return &_sss_data;
|
||||
}
|
||||
|
||||
void fbo_blit(GLuint src_fbo, GLuint dst_fbo,
|
||||
GLint src_x, GLint src_y, GLint src_width, GLint src_height,
|
||||
GLint dst_x, GLint dst_y, GLint dst_width, GLint dst_height, GLbitfield mask, GLenum filter) {
|
||||
gl_state_bind_read_framebuffer(src_fbo);
|
||||
gl_state_bind_draw_framebuffer(dst_fbo);
|
||||
glBlitFramebuffer(src_x, src_y, src_x + src_width, src_y + src_height,
|
||||
dst_x, dst_y, dst_x + dst_width, dst_y + dst_height, mask, filter);
|
||||
}
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
#include "../KKdLib/default.hpp"
|
||||
#include "../KKdLib/mat.hpp"
|
||||
#include "../KKdLib/vec.hpp"
|
||||
#include "GL/array_buffer.hpp"
|
||||
#include "GL/uniform_buffer.hpp"
|
||||
#include "light_param/fog.hpp"
|
||||
#include "light_param/light.hpp"
|
||||
#include "mdl/disp_manager.hpp"
|
||||
#include "camera.hpp"
|
||||
#include "gl_array_buffer.hpp"
|
||||
#include "gl_element_array_buffer.hpp"
|
||||
#include "gl_uniform_buffer.hpp"
|
||||
#include "render.hpp"
|
||||
#include "render_manager.hpp"
|
||||
#include "render_texture.hpp"
|
||||
@@ -374,10 +373,10 @@ struct render_context {
|
||||
vec4 g_near_far;
|
||||
|
||||
GLuint box_vao;
|
||||
GLArrayBuffer box_vbo;
|
||||
GL::ArrayBuffer box_vbo;
|
||||
|
||||
GLuint lens_ghost_vao;
|
||||
GLArrayBuffer lens_ghost_vbo;
|
||||
GL::ArrayBuffer lens_ghost_vbo;
|
||||
|
||||
GLuint common_vao;
|
||||
|
||||
@@ -386,31 +385,31 @@ struct render_context {
|
||||
RenderTexture screen_buffer;
|
||||
RenderTexture shadow_buffer;
|
||||
|
||||
GLUniformBuffer camera_blur_ubo;
|
||||
GLUniformBuffer contour_coef_ubo;
|
||||
GLUniformBuffer contour_params_ubo;
|
||||
GLUniformBuffer filter_scene_ubo;
|
||||
GLUniformBuffer esm_filter_batch_ubo;
|
||||
GLUniformBuffer imgfilter_batch_ubo;
|
||||
GLUniformBuffer exposure_measure_ubo;
|
||||
GLUniformBuffer gaussian_coef_ubo;
|
||||
GLUniformBuffer glass_eye_batch_ubo;
|
||||
GLUniformBuffer glitter_batch_ubo;
|
||||
GLUniformBuffer quad_ubo;
|
||||
GLUniformBuffer sprite_scene_ubo;
|
||||
GLUniformBuffer sss_filter_gaussian_coef_ubo;
|
||||
GLUniformBuffer sun_quad_ubo;
|
||||
GLUniformBuffer transparency_batch_ubo;
|
||||
GLUniformBuffer tone_map_ubo;
|
||||
GL::UniformBuffer camera_blur_ubo;
|
||||
GL::UniformBuffer contour_coef_ubo;
|
||||
GL::UniformBuffer contour_params_ubo;
|
||||
GL::UniformBuffer filter_scene_ubo;
|
||||
GL::UniformBuffer esm_filter_batch_ubo;
|
||||
GL::UniformBuffer imgfilter_batch_ubo;
|
||||
GL::UniformBuffer exposure_measure_ubo;
|
||||
GL::UniformBuffer gaussian_coef_ubo;
|
||||
GL::UniformBuffer glass_eye_batch_ubo;
|
||||
GL::UniformBuffer glitter_batch_ubo;
|
||||
GL::UniformBuffer quad_ubo;
|
||||
GL::UniformBuffer sprite_scene_ubo;
|
||||
GL::UniformBuffer sss_filter_gaussian_coef_ubo;
|
||||
GL::UniformBuffer sun_quad_ubo;
|
||||
GL::UniformBuffer transparency_batch_ubo;
|
||||
GL::UniformBuffer tone_map_ubo;
|
||||
|
||||
obj_shader_shader_data obj_shader;
|
||||
obj_scene_shader_data obj_scene;
|
||||
obj_batch_shader_data obj_batch;
|
||||
obj_skinning_shader_data obj_skinning;
|
||||
GLUniformBuffer obj_shader_ubo;
|
||||
GLUniformBuffer obj_scene_ubo;
|
||||
GLUniformBuffer obj_batch_ubo;
|
||||
GLUniformBuffer obj_skinning_ubo;
|
||||
GL::UniformBuffer obj_shader_ubo;
|
||||
GL::UniformBuffer obj_scene_ubo;
|
||||
GL::UniformBuffer obj_batch_ubo;
|
||||
GL::UniformBuffer obj_skinning_ubo;
|
||||
|
||||
GLuint empty_texture_2d;
|
||||
GLuint empty_texture_cube_map;
|
||||
@@ -437,7 +436,3 @@ extern draw_state_struct& draw_state;
|
||||
extern render_context* rctx;
|
||||
|
||||
extern sss_data* sss_data_get();
|
||||
|
||||
void fbo_blit(GLuint src_fbo, GLuint dst_fbo,
|
||||
GLint src_x, GLint src_y, GLint src_width, GLint src_height,
|
||||
GLint dst_x, GLint dst_y, GLint dst_width, GLint dst_height, GLbitfield mask, GLenum filter);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../KKdLib/default.hpp"
|
||||
#include "../gl_uniform_buffer.hpp"
|
||||
#include "../GL/uniform_buffer.hpp"
|
||||
#include "../render_texture.hpp"
|
||||
#include "fbo.hpp"
|
||||
#include "gl_program.hpp"
|
||||
@@ -53,8 +53,8 @@ namespace renderer {
|
||||
GLuint samplers[2];
|
||||
GLuint vao;
|
||||
GLProgram program[9];
|
||||
GLUniformBuffer common_ubo;
|
||||
GLUniformBuffer texcoords_ubo;
|
||||
GL::UniformBuffer common_ubo;
|
||||
GL::UniformBuffer texcoords_ubo;
|
||||
|
||||
DOF3(int32_t width, int32_t height);
|
||||
~DOF3();
|
||||
|
||||
@@ -325,7 +325,7 @@ HOOK(void, FASTCALL, RobCloth__UpdateVertexBuffer, 0x000000014021CF00, obj_mesh*
|
||||
return;
|
||||
|
||||
vertex_buffer->cycle_index();
|
||||
GLArrayBuffer buffer = vertex_buffer->get_buffer();
|
||||
GL::ArrayBuffer buffer = vertex_buffer->get_buffer();
|
||||
size_t data = (size_t)buffer.MapMemory();
|
||||
if (!data)
|
||||
return;
|
||||
@@ -920,7 +920,7 @@ void rob_chara_age_age_object::disp(size_t chara_index,
|
||||
|
||||
obj_vert_buf.cycle_index();
|
||||
|
||||
GLArrayBuffer buffer = obj_vert_buf.get_buffer();
|
||||
GL::ArrayBuffer buffer = obj_vert_buf.get_buffer();
|
||||
size_t vtx_data = (size_t)buffer.MapMemory();
|
||||
if (!vtx_data)
|
||||
return;
|
||||
|
||||
@@ -4,3 +4,13 @@
|
||||
*/
|
||||
|
||||
#include "shared.hpp"
|
||||
#include "gl_state.hpp"
|
||||
|
||||
void fbo_blit(GLuint src_fbo, GLuint dst_fbo,
|
||||
GLint src_x, GLint src_y, GLint src_width, GLint src_height,
|
||||
GLint dst_x, GLint dst_y, GLint dst_width, GLint dst_height, GLbitfield mask, GLenum filter) {
|
||||
gl_state_bind_read_framebuffer(src_fbo);
|
||||
gl_state_bind_draw_framebuffer(dst_fbo);
|
||||
glBlitFramebuffer(src_x, src_y, src_x + src_width, src_y + src_height,
|
||||
dst_x, dst_y, dst_x + dst_width, dst_y + dst_height, mask, filter);
|
||||
}
|
||||
|
||||
@@ -17,3 +17,7 @@ enum blur_filter_mode {
|
||||
BLUR_FILTER_32,
|
||||
BLUR_FILTER_MAX,
|
||||
};
|
||||
|
||||
extern void fbo_blit(GLuint src_fbo, GLuint dst_fbo,
|
||||
GLint src_x, GLint src_y, GLint src_width, GLint src_height,
|
||||
GLint dst_x, GLint dst_y, GLint dst_width, GLint dst_height, GLbitfield mask, GLenum filter);
|
||||
|
||||
@@ -69,9 +69,9 @@ namespace spr {
|
||||
std::vector<sprite_draw_vertex> vertex_buffer;
|
||||
std::vector<uint32_t> index_buffer;
|
||||
GLuint vao;
|
||||
GLArrayBuffer vbo;
|
||||
GL::ArrayBuffer vbo;
|
||||
size_t vbo_vertex_count;
|
||||
GLElementArrayBuffer ebo;
|
||||
GL::ElementArrayBuffer ebo;
|
||||
size_t ebo_index_count;
|
||||
|
||||
RenderData();
|
||||
|
||||
Reference in New Issue
Block a user