Remove reference to WITH_LEGACY_OPENGL
We only keep this as a way to get GPU_stubs to run, in case we want to do a throughout cleanup in the codebase and want code using legacy calls to fail to build.
This commit is contained in:
parent
3527739002
commit
2383667a2e
|
@ -878,23 +878,6 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
|
|||
else
|
||||
m_hGLRC = s_sharedHGLRC;
|
||||
}
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
else {
|
||||
if (m_contextProfileMask != 0)
|
||||
fprintf(stderr, "Warning! Legacy WGL is unable to select between OpenGL profiles.");
|
||||
|
||||
if (m_contextMajorVersion != 0 || m_contextMinorVersion != 0)
|
||||
fprintf(stderr, "Warning! Legacy WGL is unable to select between OpenGL versions.");
|
||||
|
||||
if (m_contextFlags != 0)
|
||||
fprintf(stderr, "Warning! Legacy WGL is unable to set context flags.");
|
||||
|
||||
if (!s_singleContextMode || s_sharedHGLRC == NULL)
|
||||
m_hGLRC = ::wglCreateContext(m_hDC);
|
||||
else
|
||||
m_hGLRC = s_sharedHGLRC;
|
||||
}
|
||||
#endif // WITH_LEGACY_OPENGL
|
||||
|
||||
if (!WIN32_CHK(m_hGLRC != NULL)) {
|
||||
::wglMakeCurrent(prevHDC, prevHGLRC);
|
||||
|
@ -946,13 +929,7 @@ GHOST_TSuccess GHOST_ContextWGL::initializeDrawingContext()
|
|||
MB_OK | MB_ICONERROR);
|
||||
exit(0);
|
||||
}
|
||||
#if defined(WITH_LEGACY_OPENGL)
|
||||
else if (version[0] < '3') {
|
||||
// relax requirements for Mesa, which uses GL 3.0
|
||||
// while other drivers use GL 3.3+ compatibility profile
|
||||
#else
|
||||
else if (version[0] < '3' || (version[0] == '3' && version[2] < '3')) {
|
||||
#endif
|
||||
MessageBox(m_hWnd, "Blender requires a graphics driver with OpenGL 3.3 support.\n\n"
|
||||
"The program will now close.",
|
||||
"Blender - Unsupported Graphics Driver!",
|
||||
|
|
|
@ -1386,25 +1386,6 @@ GHOST_Context *GHOST_WindowX11::newDrawingContext(GHOST_TDrawingContextType type
|
|||
else
|
||||
delete context;
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
// since that failed try 3.0 (mostly for Mesa, which doesn't implement compatibility profile)
|
||||
context = new GHOST_ContextGLX(
|
||||
m_wantStereoVisual,
|
||||
m_wantNumOfAASamples,
|
||||
m_window,
|
||||
m_display,
|
||||
m_visualInfo,
|
||||
(GLXFBConfig)m_fbconfig,
|
||||
0, // no profile bit
|
||||
3, 0,
|
||||
GHOST_OPENGL_GLX_CONTEXT_FLAGS | (m_is_debug_context ? GLX_CONTEXT_DEBUG_BIT_ARB : 0),
|
||||
GHOST_OPENGL_GLX_RESET_NOTIFICATION_STRATEGY);
|
||||
|
||||
if (context->initializeDrawingContext())
|
||||
return context;
|
||||
else
|
||||
delete context;
|
||||
#endif // WITH_LEGACY_OPENGL
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
|
|
@ -344,27 +344,6 @@ void bindProgram(OpenSubdiv_GLMesh *gl_mesh, int program)
|
|||
glBindBufferBase(GL_UNIFORM_BUFFER, 0, g_lighting_ub);
|
||||
|
||||
/* Color */
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
GLboolean use_lighting;
|
||||
glGetBooleanv(GL_LIGHTING, &use_lighting);
|
||||
|
||||
if (use_lighting) {
|
||||
float color[4];
|
||||
glGetMaterialfv(GL_FRONT, GL_DIFFUSE, color);
|
||||
glUniform4fv(glGetUniformLocation(program, "diffuse"), 1, color);
|
||||
|
||||
glGetMaterialfv(GL_FRONT, GL_SPECULAR, color);
|
||||
glUniform4fv(glGetUniformLocation(program, "specular"), 1, color);
|
||||
|
||||
glGetMaterialfv(GL_FRONT, GL_SHININESS, color);
|
||||
glUniform1f(glGetUniformLocation(program, "shininess"), color[0]);
|
||||
}
|
||||
else {
|
||||
float color[4];
|
||||
glGetFloatv(GL_CURRENT_COLOR, color);
|
||||
glUniform4fv(glGetUniformLocation(program, "diffuse"), 1, color);
|
||||
}
|
||||
#else
|
||||
{
|
||||
/* TODO: stop using glGetMaterial */
|
||||
float color[4];
|
||||
|
@ -377,7 +356,6 @@ void bindProgram(OpenSubdiv_GLMesh *gl_mesh, int program)
|
|||
glGetMaterialfv(GL_FRONT, GL_SHININESS, color);
|
||||
glUniform1f(glGetUniformLocation(program, "shininess"), color[0]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Face-vertex data */
|
||||
if (gl_mesh->fvar_data != NULL) {
|
||||
|
@ -642,33 +620,6 @@ static GLuint prepare_patchDraw(OpenSubdiv_GLMesh *gl_mesh,
|
|||
glGetIntegerv(GL_SHADE_MODEL, &model);
|
||||
glGetBooleanv(GL_TEXTURE_2D, &use_texture_2d);
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glGetBooleanv(GL_LIGHTING, &use_lighting);
|
||||
if (model == GL_FLAT) {
|
||||
if (use_texture_2d) {
|
||||
program = use_lighting
|
||||
? g_flat_fill_texture2d_program
|
||||
: g_flat_fill_texture2d_shadeless_program;
|
||||
}
|
||||
else {
|
||||
program = use_lighting
|
||||
? g_flat_fill_solid_program
|
||||
: g_flat_fill_solid_shadeless_program;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (use_texture_2d) {
|
||||
program = use_lighting
|
||||
? g_smooth_fill_texture2d_program
|
||||
: g_smooth_fill_texture2d_shadeless_program;
|
||||
}
|
||||
else {
|
||||
program = use_lighting
|
||||
? g_smooth_fill_solid_program
|
||||
: g_smooth_fill_solid_shadeless_program;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (model == GL_FLAT) {
|
||||
if (use_texture_2d) {
|
||||
program = g_flat_fill_texture2d_program;
|
||||
|
@ -685,7 +636,6 @@ static GLuint prepare_patchDraw(OpenSubdiv_GLMesh *gl_mesh,
|
|||
program = g_smooth_fill_solid_program;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1161,85 +1161,8 @@ static bool tex_mat_set_face_editmesh_cb(void *userData, int index)
|
|||
void draw_mesh_textured(Scene *scene, SceneLayer *sl, View3D *v3d, RegionView3D *rv3d,
|
||||
Object *ob, DerivedMesh *dm, const int draw_flags)
|
||||
{
|
||||
#ifndef WITH_LEGACY_OPENGL
|
||||
/* some legacy GL calls here will *crash* blender */
|
||||
UNUSED_VARS(scene, sl, v3d, rv3d, ob, dm, draw_flags);
|
||||
return;
|
||||
#endif
|
||||
|
||||
/* if not cycles, or preview-modifiers, or drawing matcaps */
|
||||
if ((draw_flags & DRAW_MODIFIERS_PREVIEW) ||
|
||||
(v3d->flag2 & V3D_SHOW_SOLID_MATCAP) ||
|
||||
(BKE_scene_use_new_shading_nodes(scene) == false) ||
|
||||
((ob->mode & OB_MODE_TEXTURE_PAINT) && ELEM(v3d->drawtype, OB_TEXTURE, OB_SOLID)))
|
||||
{
|
||||
draw_mesh_textured_old(scene, sl, v3d, rv3d, ob, dm, draw_flags);
|
||||
return;
|
||||
}
|
||||
else if (ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT)) {
|
||||
draw_mesh_paint(v3d, rv3d, ob, dm, draw_flags);
|
||||
return;
|
||||
}
|
||||
|
||||
/* set opengl state for negative scale & color */
|
||||
if (ob->transflag & OB_NEG_SCALE) glFrontFace(GL_CW);
|
||||
else glFrontFace(GL_CCW);
|
||||
|
||||
Mesh *me = ob->data;
|
||||
|
||||
bool shadeless = ((v3d->flag2 & V3D_SHADELESS_TEX) &&
|
||||
((v3d->drawtype == OB_TEXTURE) || (ob->mode & OB_MODE_TEXTURE_PAINT)));
|
||||
bool two_sided_lighting = (me->flag & ME_TWOSIDED) != 0;
|
||||
|
||||
TexMatCallback data = {scene, ob, me, dm, shadeless, two_sided_lighting};
|
||||
bool (*set_face_cb)(void *, int);
|
||||
bool picking = (G.f & G_PICKSEL) != 0;
|
||||
|
||||
/* face hiding callback depending on mode */
|
||||
if (ob == scene->obedit)
|
||||
set_face_cb = tex_mat_set_face_editmesh_cb;
|
||||
else if (draw_flags & DRAW_FACE_SELECT)
|
||||
set_face_cb = tex_mat_set_face_mesh_cb;
|
||||
else
|
||||
set_face_cb = NULL;
|
||||
|
||||
/* test if we can use glsl */
|
||||
const int drawtype = view3d_effective_drawtype(v3d);
|
||||
bool glsl = (drawtype == OB_MATERIAL) && !picking;
|
||||
|
||||
GPU_begin_object_materials(v3d, rv3d, scene, sl, ob, glsl, NULL);
|
||||
|
||||
if (glsl || picking) {
|
||||
/* draw glsl or solid */
|
||||
dm->drawMappedFacesMat(dm,
|
||||
tex_mat_set_material_cb,
|
||||
set_face_cb, &data);
|
||||
}
|
||||
else {
|
||||
/* draw textured */
|
||||
dm->drawMappedFacesMat(dm,
|
||||
tex_mat_set_texture_cb,
|
||||
set_face_cb, &data);
|
||||
}
|
||||
|
||||
GPU_end_object_materials();
|
||||
|
||||
/* reset opengl state */
|
||||
GPU_end_object_materials();
|
||||
GPU_basic_shader_bind(GPU_SHADER_USE_COLOR);
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
glFrontFace(GL_CCW);
|
||||
|
||||
glMatrixMode(GL_TEXTURE);
|
||||
glLoadIdentity(); /* TEXTURE */
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
/* faceselect mode drawing over textured mesh */
|
||||
if (!(ob == scene->obedit) && (draw_flags & DRAW_FACE_SELECT)) {
|
||||
bool draw_select_edges = (ob->mode & OB_MODE_TEXTURE_PAINT) == 0;
|
||||
draw_mesh_face_select(rv3d, ob->data, dm, draw_select_edges);
|
||||
}
|
||||
}
|
||||
|
||||
/* Vertex Paint and Weight Paint */
|
||||
|
|
|
@ -9422,21 +9422,6 @@ static void bbs_mesh_verts(BMEditMesh *em, DerivedMesh *dm, int offset)
|
|||
immUnbindProgram();
|
||||
}
|
||||
|
||||
#if defined(WITH_LEGACY_OPENGL)
|
||||
static DMDrawOption bbs_mesh_wire__setDrawOptions(void *userData, int index)
|
||||
{
|
||||
drawBMOffset_userData *data = userData;
|
||||
BMEdge *eed = BM_edge_at_index(data->bm, index);
|
||||
|
||||
if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN)) {
|
||||
GPU_select_index_set(data->offset + index);
|
||||
return DM_DRAW_OPTION_NORMAL;
|
||||
}
|
||||
else {
|
||||
return DM_DRAW_OPTION_SKIP;
|
||||
}
|
||||
}
|
||||
#else
|
||||
static void bbs_mesh_wire__mapFunc(void *userData, int index, const float v0co[3], const float v1co[3])
|
||||
{
|
||||
drawBMOffset_userData *data = userData;
|
||||
|
@ -9450,16 +9435,13 @@ static void bbs_mesh_wire__mapFunc(void *userData, int index, const float v0co[3
|
|||
immVertex3fv(data->pos, v1co);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset)
|
||||
{
|
||||
drawBMOffset_userData data;
|
||||
data.bm = em->bm;
|
||||
data.offset = offset;
|
||||
|
||||
#if defined(WITH_LEGACY_OPENGL)
|
||||
dm->drawMappedEdges(dm, bbs_mesh_wire__setDrawOptions, &data);
|
||||
#else
|
||||
VertexFormat *format = immVertexFormat();
|
||||
|
||||
const int imm_len = dm->getNumEdges(dm) * 2;
|
||||
|
@ -9478,53 +9460,10 @@ static void bbs_mesh_wire(BMEditMesh *em, DerivedMesh *dm, int offset)
|
|||
immEnd();
|
||||
|
||||
immUnbindProgram();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(WITH_LEGACY_OPENGL)
|
||||
/**
|
||||
* dont set #GPU_framebuffer_index_set. just use to mask other
|
||||
*/
|
||||
static DMDrawOption bbs_mesh_mask__setSolidDrawOptions(void *userData, int index)
|
||||
{
|
||||
BMFace *efa = BM_face_at_index(userData, index);
|
||||
|
||||
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
|
||||
return DM_DRAW_OPTION_NORMAL;
|
||||
}
|
||||
else {
|
||||
return DM_DRAW_OPTION_SKIP;
|
||||
}
|
||||
}
|
||||
|
||||
static DMDrawOption bbs_mesh_solid__setSolidDrawOptions(void *userData, int index)
|
||||
{
|
||||
BMFace *efa = BM_face_at_index(userData, index);
|
||||
|
||||
if (!BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) {
|
||||
GPU_select_index_set(index + 1);
|
||||
return DM_DRAW_OPTION_NORMAL;
|
||||
}
|
||||
else {
|
||||
return DM_DRAW_OPTION_SKIP;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void bbs_mesh_face(BMEditMesh *em, DerivedMesh *dm, const bool use_select)
|
||||
{
|
||||
#if defined(WITH_LEGACY_OPENGL)
|
||||
if (use_select) {
|
||||
dm->drawMappedFaces(
|
||||
dm, bbs_mesh_solid__setSolidDrawOptions, NULL, NULL, em->bm,
|
||||
DM_DRAW_SKIP_HIDDEN | DM_DRAW_SELECT_USE_EDITMODE);
|
||||
}
|
||||
else {
|
||||
dm->drawMappedFaces(
|
||||
dm, bbs_mesh_mask__setSolidDrawOptions, NULL, NULL, em->bm,
|
||||
DM_DRAW_SKIP_HIDDEN | DM_DRAW_SELECT_USE_EDITMODE | DM_DRAW_SKIP_SELECT);
|
||||
}
|
||||
#else
|
||||
UNUSED_VARS(dm);
|
||||
|
||||
drawBMOffset_userData data;
|
||||
|
@ -9574,7 +9513,6 @@ static void bbs_mesh_face(BMEditMesh *em, DerivedMesh *dm, const bool use_select
|
|||
immEnd();
|
||||
|
||||
immUnbindProgram();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void bbs_mesh_solid__drawCenter(void *userData, int index, const float cent[3], const float UNUSED(no[3]))
|
||||
|
@ -9675,18 +9613,6 @@ static void bbs_mesh_solid_verts(Scene *scene, Object *ob)
|
|||
static void bbs_mesh_solid_faces(Scene *scene, Object *ob)
|
||||
{
|
||||
Mesh *me = ob->data;
|
||||
#if defined(WITH_LEGACY_OPENGL)
|
||||
DerivedMesh *dm = mesh_get_derived_final(scene, ob, scene->customdata_mask);
|
||||
|
||||
DM_update_materials(dm, ob);
|
||||
|
||||
if ((me->editflag & ME_EDIT_PAINT_FACE_SEL))
|
||||
dm->drawMappedFaces(dm, bbs_mesh_solid_hide__setDrawOpts, NULL, NULL, me, DM_DRAW_SKIP_HIDDEN);
|
||||
else
|
||||
dm->drawMappedFaces(dm, bbs_mesh_solid__setDrawOpts, NULL, NULL, me, 0);
|
||||
|
||||
dm->release(dm);
|
||||
#else
|
||||
UNUSED_VARS(scene, bbs_mesh_solid_hide__setDrawOpts, bbs_mesh_solid__setDrawOpts);
|
||||
Batch *batch;
|
||||
if ((me->editflag & ME_EDIT_PAINT_FACE_SEL)) {
|
||||
|
@ -9697,7 +9623,6 @@ static void bbs_mesh_solid_faces(Scene *scene, Object *ob)
|
|||
}
|
||||
Batch_set_builtin_program(batch, GPU_SHADER_3D_FLAT_COLOR_U32);
|
||||
Batch_draw(batch);
|
||||
#endif
|
||||
}
|
||||
|
||||
void draw_object_backbufsel(Scene *scene, View3D *v3d, RegionView3D *rv3d, Object *ob)
|
||||
|
|
|
@ -415,18 +415,12 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
|
|||
{
|
||||
if (alphablend == GPU_BLEND_SOLID) {
|
||||
glDisable(GL_BLEND);
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
#endif
|
||||
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
}
|
||||
else if (alphablend == GPU_BLEND_ADD) {
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_ONE, GL_ONE);
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
#endif
|
||||
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
}
|
||||
else if (ELEM(alphablend, GPU_BLEND_ALPHA, GPU_BLEND_ALPHA_SORT)) {
|
||||
|
@ -439,30 +433,12 @@ static void gpu_set_alpha_blend(GPUBlendMode alphablend)
|
|||
/* if U.glalphaclip == 1.0, some cards go bonkers...
|
||||
* turn off alpha test in this case */
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
/* added after 2.45 to clip alpha */
|
||||
if (U.glalphaclip == 1.0f) {
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
}
|
||||
else {
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, U.glalphaclip);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else if (alphablend == GPU_BLEND_CLIP) {
|
||||
glDisable(GL_BLEND);
|
||||
glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, 0.5f);
|
||||
#endif
|
||||
}
|
||||
else if (alphablend == GPU_BLEND_ALPHA_TO_COVERAGE) {
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, U.glalphaclip);
|
||||
#endif
|
||||
glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
|
||||
}
|
||||
}
|
||||
|
@ -2249,11 +2225,6 @@ void GPU_state_init(void)
|
|||
glDisable(GL_COLOR_LOGIC_OP);
|
||||
glDisable(GL_STENCIL_TEST);
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glDisable(GL_ALPHA_TEST);
|
||||
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
#endif
|
||||
|
||||
glDepthRange(0.0, 1.0);
|
||||
|
||||
glFrontFace(GL_CCW);
|
||||
|
@ -2265,22 +2236,12 @@ void GPU_state_init(void)
|
|||
|
||||
void GPU_enable_program_point_size(void)
|
||||
{
|
||||
#if defined(__APPLE__) && defined(WITH_LEGACY_OPENGL)
|
||||
/* TODO: remove this when we switch to core profile */
|
||||
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
#else
|
||||
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
void GPU_disable_program_point_size(void)
|
||||
{
|
||||
#if defined(__APPLE__) && defined(WITH_LEGACY_OPENGL)
|
||||
/* TODO: remove this when we switch to core profile */
|
||||
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
|
||||
#else
|
||||
glDisable(GL_PROGRAM_POINT_SIZE);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WITH_OPENSUBDIV
|
||||
|
@ -2478,11 +2439,6 @@ typedef struct {
|
|||
unsigned int is_scissor_test : 1;
|
||||
unsigned int is_stencil_test : 1;
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
unsigned int is_alpha_test : 1;
|
||||
bool is_light[8];
|
||||
#endif
|
||||
|
||||
bool is_clip_plane[6];
|
||||
|
||||
/* GL_DEPTH_BUFFER_BIT */
|
||||
|
@ -2539,15 +2495,6 @@ void gpuPushAttrib(eGPUAttribMask mask)
|
|||
Attrib.is_cull_face = glIsEnabled(GL_CULL_FACE);
|
||||
Attrib.is_depth_test = glIsEnabled(GL_DEPTH_TEST);
|
||||
Attrib.is_dither = glIsEnabled(GL_DITHER);
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
Attrib.is_alpha_test = glIsEnabled(GL_ALPHA_TEST);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
Attrib.is_light[i] = glIsEnabled(GL_LIGHT0 + i);
|
||||
}
|
||||
#endif
|
||||
|
||||
Attrib.is_line_smooth = glIsEnabled(GL_LINE_SMOOTH);
|
||||
Attrib.is_color_logic_op = glIsEnabled(GL_COLOR_LOGIC_OP);
|
||||
Attrib.is_multisample = glIsEnabled(GL_MULTISAMPLE);
|
||||
|
@ -2610,15 +2557,6 @@ void gpuPopAttrib()
|
|||
restore_mask(GL_CULL_FACE, Attrib.is_cull_face);
|
||||
restore_mask(GL_DEPTH_TEST, Attrib.is_depth_test);
|
||||
restore_mask(GL_DITHER, Attrib.is_dither);
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
restore_mask(GL_ALPHA_TEST, Attrib.is_alpha_test);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
restore_mask(GL_LIGHT0 + i, Attrib.is_light[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
restore_mask(GL_LINE_SMOOTH, Attrib.is_line_smooth);
|
||||
restore_mask(GL_COLOR_LOGIC_OP, Attrib.is_color_logic_op);
|
||||
restore_mask(GL_MULTISAMPLE, Attrib.is_multisample);
|
||||
|
|
|
@ -152,11 +152,6 @@ void gpu_extensions_init(void)
|
|||
glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &GG.maxubobinds);
|
||||
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &GG.maxubosize);
|
||||
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glGetIntegerv(GL_RED_BITS, &r);
|
||||
glGetIntegerv(GL_GREEN_BITS, &g);
|
||||
glGetIntegerv(GL_BLUE_BITS, &b);
|
||||
#else
|
||||
#ifndef NDEBUG
|
||||
GLint ret;
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
|
@ -169,7 +164,6 @@ void gpu_extensions_init(void)
|
|||
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &r);
|
||||
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE, &g);
|
||||
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE, &b);
|
||||
#endif
|
||||
GG.colordepth = r + g + b; /* Assumes same depth for RGB. */
|
||||
|
||||
if (GLEW_VERSION_3_2 || GLEW_ARB_texture_multisample) {
|
||||
|
|
|
@ -428,9 +428,6 @@ static GPUTexture *GPU_texture_create_nD(
|
|||
glTexParameteri(tex->target_base, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
|
||||
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glTexParameteri(tex->target_base, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
glTexParameteri(tex->target_base, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
@ -509,9 +506,6 @@ static GPUTexture *GPU_texture_cube_create(
|
|||
glTexParameteri(tex->target_base, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_R_TO_TEXTURE);
|
||||
glTexParameteri(tex->target_base, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL);
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glTexParameteri(tex->target_base, GL_DEPTH_TEXTURE_MODE, GL_INTENSITY);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
glTexParameteri(tex->target_base, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
@ -564,7 +558,7 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int textarget
|
|||
GPU_print_error_debug("Blender Texture Not Loaded");
|
||||
}
|
||||
else {
|
||||
GLint w, h, border;
|
||||
GLint w, h;
|
||||
|
||||
GLenum gettarget;
|
||||
|
||||
|
@ -576,16 +570,8 @@ GPUTexture *GPU_texture_from_blender(Image *ima, ImageUser *iuser, int textarget
|
|||
glBindTexture(textarget, tex->bindcode);
|
||||
glGetTexLevelParameteriv(gettarget, 0, GL_TEXTURE_WIDTH, &w);
|
||||
glGetTexLevelParameteriv(gettarget, 0, GL_TEXTURE_HEIGHT, &h);
|
||||
#ifdef WITH_LEGACY_OPENGL
|
||||
glGetTexLevelParameteriv(gettarget, 0, GL_TEXTURE_BORDER, &border);
|
||||
|
||||
tex->w = w - border;
|
||||
tex->h = h - border;
|
||||
#else
|
||||
tex->w = w;
|
||||
tex->h = h;
|
||||
UNUSED_VARS(border);
|
||||
#endif
|
||||
}
|
||||
|
||||
glBindTexture(textarget, 0);
|
||||
|
|
Loading…
Reference in New Issue