[Bf-blender-cvs] [bed9bf1907] HMD_viewport: Bunch of small HMD fixes, removed old now unused preferences

Joey Ferwerda noreply at git.blender.org
Mon Mar 6 02:18:20 CET 2017


Commit: bed9bf1907a18888a192d8aba21835d08cffd218
Author: Joey Ferwerda
Date:   Mon Mar 6 02:15:58 2017 +0100
Branches: HMD_viewport
https://developer.blender.org/rBbed9bf1907a18888a192d8aba21835d08cffd218

Bunch of small HMD fixes, removed old now unused preferences

===================================================================

M	extern/openhmd/src/platform-win32.c
M	source/blender/blenkernel/intern/screen.c
M	source/blender/editors/interface/resources.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/gpu/GPU_compositing.h
M	source/blender/gpu/intern/gpu_compositing.c
M	source/blender/makesdna/DNA_gpu_types.h
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c
M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/extern/openhmd/src/platform-win32.c b/extern/openhmd/src/platform-win32.c
index c6e0e0bc6b..9937a3c4f2 100644
--- a/extern/openhmd/src/platform-win32.c
+++ b/extern/openhmd/src/platform-win32.c
@@ -111,7 +111,7 @@ static int _enable_ovr_service = 0;
 void ohmd_toggle_ovr_service(int state) //State is 0 for Disable, 1 for Enable
 {
 	SC_HANDLE serviceDbHandle = OpenSCManager(NULL,NULL,SC_MANAGER_ALL_ACCESS);
-	SC_HANDLE serviceHandle = OpenService(serviceDbHandle, 'OVRService', SC_MANAGER_ALL_ACCESS);
+	SC_HANDLE serviceHandle = OpenService(serviceDbHandle, "OVRService", SC_MANAGER_ALL_ACCESS);
 
 	SERVICE_STATUS_PROCESS status;
 	DWORD bytesNeeded;
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index b76391c99a..65cc82fc86 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -687,6 +687,5 @@ void BKE_screen_gpu_fx_validate(GPUFXSettings *fx_settings)
 	    (fx_settings->fx_flag & GPU_FX_FLAG_LensDist))
 	{
 		fx_settings->lensdist = MEM_callocN(sizeof(GPULensDistSettings), __func__);
-		GPU_fx_compositor_init_lensdist_settings(fx_settings->lensdist);
 	}
 }
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 9b3f4e0d68..3d29087620 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -2776,7 +2776,6 @@ void init_userdef_do_versions(void)
 			U.hmd_settings.device = -1;
 		}
 		U.hmd_settings.flag = (USER_HMD_USE_DEVICE_IPD | USER_HMD_USE_DEVICE_ROT);
-		U.hmd_settings.lensdist_shader = GPU_FX_LENSDIST_GENERIC;
 		U.hmd_settings.custom_ipd = 0.061f;
 	}
 
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 18c03247a2..b4986a6b69 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -454,10 +454,7 @@ static void view3d_init(wmWindowManager *wm, ScrArea *sa)
 
 	/* Make sure the HMD view is initialized with the shader set in UserPrefs. */
 	if (is_hmd_view && v3d->fx_settings.lensdist) {
-		v3d->fx_settings.lensdist->type = U.hmd_settings.lensdist_shader;
-		if (U.hmd_settings.lensdist_shader != GPU_FX_LENSDIST_NONE) {
 			v3d->fx_settings.fx_flag |= GPU_FX_FLAG_LensDist;
-		}
 	}
 #else
 	UNUSED_VARS(wm, sa);
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index bcf4339084..557ba00bd4 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3148,7 +3148,7 @@ void ED_view3d_draw_offscreen(
 			is_persp = rv3d->is_persp;
 		const bool is_left = v3d->multiview_eye == STEREO_LEFT_ID;
 		void* hmd_distortion_params = WM_device_HMD_distortion_parameters_get();
-		GPU_fx_do_composite_pass(fx, winmat, is_persp, scene, ofs, &ar->winx, is_left, hmd_distortion_params);
+		GPU_fx_do_composite_pass(fx, winmat, is_persp, scene, ofs, is_left, hmd_distortion_params);
 	}
 
 	if ((v3d->flag2 & V3D_RENDER_SHADOW) == 0) {
@@ -3932,10 +3932,9 @@ static void view3d_main_region_draw_objects(
 
 	/* post process */
 	if (do_compositing) {
-		const wmWindowManager *wm = CTX_wm_manager(C);
 		const bool is_left = v3d->multiview_eye == STEREO_LEFT_ID;
 		void *hmd_distortion_params = (wm->hmd_view.hmd_win == win && win->screen->is_hmd_running) ? WM_device_HMD_distortion_parameters_get() : NULL;
-		GPU_fx_do_composite_pass(rv3d->compositor, rv3d->winmat, rv3d->is_persp, scene, NULL, &ar->winx, is_left, hmd_distortion_params);
+		GPU_fx_do_composite_pass(rv3d->compositor, rv3d->winmat, rv3d->is_persp, scene, NULL, is_left, hmd_distortion_params);
 	}
 
 	/* Disable back anti-aliasing */
diff --git a/source/blender/gpu/GPU_compositing.h b/source/blender/gpu/GPU_compositing.h
index 49e78a9a81..d7ee1239ba 100644
--- a/source/blender/gpu/GPU_compositing.h
+++ b/source/blender/gpu/GPU_compositing.h
@@ -94,7 +94,7 @@ bool GPU_fx_compositor_initialize_passes(
 bool GPU_fx_do_composite_pass(
         GPUFX *fx, float projmat[4][4], bool is_persp,
         struct Scene *scene, struct GPUOffScreen *ofs,
-        const short region_size[2], bool is_left, void* hmd_distortion_parms);
+        bool is_left, void* hmd_distortion_parms);
 
 /* bind new depth buffer for XRay pass */
 void GPU_fx_compositor_setup_XRay_pass(GPUFX *fx, bool do_xray);
@@ -104,7 +104,6 @@ void GPU_fx_compositor_XRay_resolve(GPUFX *fx);
 
 void GPU_fx_compositor_init_dof_settings(struct GPUDOFSettings *dof);
 void GPU_fx_compositor_init_ssao_settings(struct GPUSSAOSettings *ssao);
-void GPU_fx_compositor_init_lensdist_settings(struct GPULensDistSettings *fx_lensdist);
 
 
 /* initialize and cache the shader unform interface for effects */
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 1a57f9824e..ad8baeaf40 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -399,7 +399,7 @@ bool GPU_fx_compositor_initialize_passes(
 	if (!fx_settings->ssao || fx_settings->ssao->samples < 1) {
 		fx_flag &= ~GPU_FX_FLAG_SSAO;
 	}
-	if (!fx_settings->lensdist || fx_settings->lensdist->type == GPU_FX_LENSDIST_NONE) {
+	if (!fx_settings->lensdist) {
 		fx_flag &= ~GPU_FX_FLAG_LensDist;
 	}
 
@@ -730,7 +730,7 @@ void GPU_fx_compositor_XRay_resolve(GPUFX *fx)
 bool GPU_fx_do_composite_pass(
         GPUFX *fx, float projmat[4][4], bool is_persp,
         struct Scene *scene, struct GPUOffScreen *ofs,
-        const short region_size[2], bool is_left, void *hmd_distortion_params)
+        bool is_left, void *hmd_distortion_params)
 {
 	GPUTexture *src, *target;
 	int numslots = 0;
@@ -1295,7 +1295,6 @@ bool GPU_fx_do_composite_pass(
 
 	/* third pass, Lens Distortion */
 	if (fx->effects & GPU_FX_FLAG_LensDist) {
-		eGPULensDistType type = fx->settings.lensdist->type;
 		GPUShader *lensdist_shader = GPU_shader_get_builtin_fx_shader(GPU_SHADER_FX_LENS_DISTORTION, is_persp);
 
 		if (lensdist_shader && hmd_distortion_params) {
@@ -1389,11 +1388,6 @@ void GPU_fx_compositor_init_ssao_settings(GPUSSAOSettings *fx_ssao)
 	fx_ssao->samples = 20;
 }
 
-void GPU_fx_compositor_init_lensdist_settings(GPULensDistSettings *fx_lensdist)
-{
-	fx_lensdist->type = GPU_FX_LENSDIST_NONE;
-}
-
 void GPU_fx_shader_init_interface(struct GPUShader *shader, GPUFXShaderEffect effect)
 {
 	if (!shader)
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 2dde4f7f21..7eff5b705b 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -57,13 +57,6 @@ typedef struct GPULensDistSettings {
 	char pad[3];
 } GPULensDistSettings;
 
-typedef enum eGPULensDistType {
-	GPU_FX_LENSDIST_NONE = 0,
-	GPU_FX_LENSDIST_GENERIC  = 1,
-	GPU_FX_LENSDIST_DK1  = 2,
-	GPU_FX_LENSDIST_DK2  = 3,
-} eGPULensDistType;
-
 typedef struct GPUFXSettings {
 	GPUDOFSettings *dof;
 	GPUSSAOSettings *ssao;
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index e2824d95c2..629364eeb4 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -432,8 +432,7 @@ typedef struct WalkNavigation {
 
 struct HMDSettings {
 	short device; /* HMD device index */
-	char flag;
-	char lensdist_shader;
+	char flag, pad[5];
 	float custom_ipd;
 	/* Set while using custom_ipd (USER_HMD_USE_DEVICE_IPD) so we can reset to device IPD */
 	float init_ipd;
@@ -586,7 +585,6 @@ typedef struct UserDef {
 	short opensubdiv_compute_type, pad3[3];
 
 	struct HMDSettings hmd_settings;
-	int pad5;
 } UserDef;
 
 extern UserDef U; /* from blenkernel blender.c */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index b2262aa88d..4bdc2df65e 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -648,36 +648,6 @@ static int rna_userdef_hmd_active_device_poll(PointerRNA *UNUSED(ptr), const cha
 	return PROP_EDITABLE;
 }
 
-static void rna_userdef_hmd_lensdist_type_set(PointerRNA *UNUSED(ptr), int value)
-{
-	wmWindowManager *wm = G.main->wm.first;
-	wmWindow *hmd_win = wm->hmd_view.hmd_win;
-
-	/* store new value so it'll be applied the next time we open an HMD view */
-	U.hmd_settings.lensdist_shader = value;
-
-	if (hmd_win) {
-		for (ScrArea *sa = hmd_win->screen->areabase.first; sa; sa = sa->next) {
-			if (sa->spacetype == SPACE_VIEW3D) {
-				View3D *v3d = sa->spacedata.first;
-
-				if (value == GPU_FX_LENSDIST_NONE) {
-					v3d->fx_settings.fx_flag &= ~GPU_FX_FLAG_LensDist;
-				}
-				else {
-					v3d->fx_settings.fx_flag |= GPU_FX_FLAG_LensDist;
-				}
-
-				/* Set distortion type for 3D View but first we need to validate fx settings. */
-				BKE_screen_gpu_fx_validate(&v3d->fx_settings);
-				v3d->fx_settings.lensdist->type = value;
-				ED_area_tag_redraw(sa);
-				break;
-			}
-		}
-	}
-}
-
 void rna_userdef_hmd_custom_ipd_set(PointerRNA *UNUSED(ptr), float value)
 {
 	U.hmd_settings.custom_ipd = value;
@@ -4038,19 +4008,6 @@ static void rna_def_userdef_system(BlenderRNA *brna)
 		{0, NULL, 0, NULL, NULL}
 	};
 
-#ifdef WITH_INPUT_HMD
-	static EnumPropertyItem hmd_lensdist_type_items[] = {
-		{GPU_FX_LENSDIST_NONE, "NONE", 0, "None", "Don't use a lens distortion/correction shader for the HMD view"},
-		{GPU_FX_LENSDIST_GENERIC, "GENERIC", 0, "Generic", "Use a lens distortion/correction shader for generic use, "
-		                                                   "might not be perfect or work at all"},
-		{GPU_FX_LENSDIST_DK1, "DK1", 0, "Oculus DK1", "Use a lens distortion/correction shader for the "
-		                                              "Oculus DK1 (1280x800)"},
-		{GPU_FX_LENSDIST_DK2, "DK2", 0, "Oculus DK2/CV1", "Use a lens distortion/correction shader for the Oculus DK2 "
-		                                                  "(1080p) and CV1 (2160x1200)"},
-		{0, NULL, 0, NULL, NULL}
-	};
-#endif
-
 	srna = RNA_def_struct(brna, "UserPreferencesSystem", NULL);
 	RNA_def_struct_sdn

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list