Cleanup: GPU: Encapsulate glProvokingVertex
This commit is contained in:
@@ -408,7 +408,7 @@ static void draw_uvs(SpaceImage *sima,
|
|||||||
{
|
{
|
||||||
/* We could modify the vbo's data filling
|
/* We could modify the vbo's data filling
|
||||||
* instead of modifying the provoking vert. */
|
* instead of modifying the provoking vert. */
|
||||||
glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
|
GPU_provoking_vertex(GPU_VERTEX_FIRST);
|
||||||
|
|
||||||
UI_GetThemeColor3fv(TH_EDGE_SELECT, col2);
|
UI_GetThemeColor3fv(TH_EDGE_SELECT, col2);
|
||||||
col2[3] = overlay_alpha;
|
col2[3] = overlay_alpha;
|
||||||
@@ -464,7 +464,7 @@ static void draw_uvs(SpaceImage *sima,
|
|||||||
GPU_batch_draw(batch->edges);
|
GPU_batch_draw(batch->edges);
|
||||||
GPU_depth_test(false);
|
GPU_depth_test(false);
|
||||||
|
|
||||||
glProvokingVertex(GL_LAST_VERTEX_CONVENTION);
|
GPU_provoking_vertex(GPU_VERTEX_LAST);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sima->flag & SI_SMOOTH_UV) {
|
if (sima->flag & SI_SMOOTH_UV) {
|
||||||
|
|||||||
@@ -46,6 +46,11 @@ typedef enum eGPUFaceCull {
|
|||||||
GPU_CULL_BACK,
|
GPU_CULL_BACK,
|
||||||
} eGPUFaceCull;
|
} eGPUFaceCull;
|
||||||
|
|
||||||
|
typedef enum eGPUProvokingVertex {
|
||||||
|
GPU_VERTEX_FIRST = 0,
|
||||||
|
GPU_VERTEX_LAST, /* Default */
|
||||||
|
} eGPUProvokingVertex;
|
||||||
|
|
||||||
/* Initialize
|
/* Initialize
|
||||||
* - sets the default Blender opengl state, if in doubt, check
|
* - sets the default Blender opengl state, if in doubt, check
|
||||||
* the contents of this function
|
* the contents of this function
|
||||||
@@ -60,6 +65,7 @@ void GPU_blend_set_func_separate(eGPUBlendFunction src_rgb,
|
|||||||
eGPUBlendFunction dst_alpha);
|
eGPUBlendFunction dst_alpha);
|
||||||
void GPU_face_culling(eGPUFaceCull culling);
|
void GPU_face_culling(eGPUFaceCull culling);
|
||||||
void GPU_front_facing(bool invert);
|
void GPU_front_facing(bool invert);
|
||||||
|
void GPU_provoking_vertex(eGPUProvokingVertex vert);
|
||||||
void GPU_depth_range(float near, float far);
|
void GPU_depth_range(float near, float far);
|
||||||
void GPU_depth_test(bool enable);
|
void GPU_depth_test(bool enable);
|
||||||
bool GPU_depth_test_enabled(void);
|
bool GPU_depth_test_enabled(void);
|
||||||
|
|||||||
@@ -94,6 +94,12 @@ void GPU_front_facing(bool invert)
|
|||||||
glFrontFace((invert) ? GL_CW : GL_CCW);
|
glFrontFace((invert) ? GL_CW : GL_CCW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPU_provoking_vertex(eGPUProvokingVertex vert)
|
||||||
|
{
|
||||||
|
glProvokingVertex((vert == GPU_VERTEX_FIRST) ? GL_FIRST_VERTEX_CONVENTION :
|
||||||
|
GL_LAST_VERTEX_CONVENTION);
|
||||||
|
}
|
||||||
|
|
||||||
void GPU_depth_range(float near, float far)
|
void GPU_depth_range(float near, float far)
|
||||||
{
|
{
|
||||||
/* glDepthRangef is only for OpenGL 4.1 or higher */
|
/* glDepthRangef is only for OpenGL 4.1 or higher */
|
||||||
|
|||||||
Reference in New Issue
Block a user