diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 13:18:04 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-06-19 13:18:04 +0300 |
commit | b4d053efc75424fca4b413ac1bc7a7e826fac629 (patch) | |
tree | 80647d9ca9109e997fce9911f202f98d7f8577d4 /source/blender/gpu/intern/gpu_framebuffer.c | |
parent | 349946bd010b1112b13c8594aabfb318c330bc0d (diff) |
Gawain API naming refactor
Use consistent prefix for gawain API names as well as
some abbreviations to avoid over-long names, see: D2678
Diffstat (limited to 'source/blender/gpu/intern/gpu_framebuffer.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_framebuffer.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c index 96c740410c5..d791f839e20 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.c +++ b/source/blender/gpu/intern/gpu_framebuffer.c @@ -448,9 +448,9 @@ void GPU_framebuffer_blur( const float fullscreencos[4][2] = {{-1.0f, -1.0f}, {1.0f, -1.0f}, {-1.0f, 1.0f}, {1.0f, 1.0f}}; const float fullscreenuvs[4][2] = {{0.0f, 0.0f}, {1.0f, 0.0f}, {0.0f, 1.0f}, {1.0f, 1.0f}}; - static VertexFormat format = {0}; - static VertexBuffer vbo = {{0}}; - static Batch batch = {{0}}; + static Gwn_VertFormat format = {0}; + static Gwn_VertBuf vbo = {{0}}; + static Gwn_Batch batch = {{0}}; const float scaleh[2] = {1.0f / GPU_texture_width(blurtex), 0.0f}; const float scalev[2] = {0.0f, 1.0f / GPU_texture_height(tex)}; @@ -464,23 +464,23 @@ void GPU_framebuffer_blur( if (format.attrib_ct == 0) { unsigned int i = 0; /* Vertex format */ - unsigned int pos = VertexFormat_add_attrib(&format, "pos", COMP_F32, 2, KEEP_FLOAT); - unsigned int uvs = VertexFormat_add_attrib(&format, "uvs", COMP_F32, 2, KEEP_FLOAT); + unsigned int pos = GWN_vertformat_attr_add(&format, "pos", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); + unsigned int uvs = GWN_vertformat_attr_add(&format, "uvs", GWN_COMP_F32, 2, GWN_FETCH_FLOAT); /* Vertices */ - VertexBuffer_init_with_format(&vbo, &format); - VertexBuffer_allocate_data(&vbo, 36); + GWN_vertbuf_init_with_format(&vbo, &format); + GWN_vertbuf_data_alloc(&vbo, 36); for (int j = 0; j < 3; ++j) { - VertexBuffer_set_attrib(&vbo, uvs, i, fullscreenuvs[j]); - VertexBuffer_set_attrib(&vbo, pos, i++, fullscreencos[j]); + GWN_vertbuf_attr_set(&vbo, uvs, i, fullscreenuvs[j]); + GWN_vertbuf_attr_set(&vbo, pos, i++, fullscreencos[j]); } for (int j = 1; j < 4; ++j) { - VertexBuffer_set_attrib(&vbo, uvs, i, fullscreenuvs[j]); - VertexBuffer_set_attrib(&vbo, pos, i++, fullscreencos[j]); + GWN_vertbuf_attr_set(&vbo, uvs, i, fullscreenuvs[j]); + GWN_vertbuf_attr_set(&vbo, pos, i++, fullscreencos[j]); } - Batch_init(&batch, GL_TRIANGLES, &vbo, NULL); + GWN_batch_init(&batch, GL_TRIANGLES, &vbo, NULL); } glDisable(GL_DEPTH_TEST); @@ -499,9 +499,9 @@ void GPU_framebuffer_blur( GPU_texture_bind(tex, 0); Batch_set_builtin_program(&batch, GPU_SHADER_SEP_GAUSSIAN_BLUR); - Batch_Uniform2f(&batch, "ScaleU", scaleh[0], scaleh[1]); - Batch_Uniform1i(&batch, "textureSource", GL_TEXTURE0); - Batch_draw(&batch); + GWN_batch_uniform_2f(&batch, "ScaleU", scaleh[0], scaleh[1]); + GWN_batch_uniform_1i(&batch, "textureSource", GL_TEXTURE0); + GWN_batch_draw(&batch); /* Blurring vertically */ glBindFramebuffer(GL_FRAMEBUFFER, fb->object); @@ -515,9 +515,9 @@ void GPU_framebuffer_blur( /* Hack to make the following uniform stick */ Batch_set_builtin_program(&batch, GPU_SHADER_SEP_GAUSSIAN_BLUR); - Batch_Uniform2f(&batch, "ScaleU", scalev[0], scalev[1]); - Batch_Uniform1i(&batch, "textureSource", GL_TEXTURE0); - Batch_draw(&batch); + GWN_batch_uniform_2f(&batch, "ScaleU", scalev[0], scalev[1]); + GWN_batch_uniform_1i(&batch, "textureSource", GL_TEXTURE0); + GWN_batch_draw(&batch); } void GPU_framebuffer_blit(GPUFrameBuffer *fb_read, int read_slot, GPUFrameBuffer *fb_write, int write_slot, bool use_depth) |