(Vulkan/Win32) C89_BUILD fixes

This commit is contained in:
twinaphex 2017-08-12 17:56:30 +02:00
parent 6611ccf3fa
commit 9c32d03c1e
7 changed files with 94 additions and 76 deletions

View File

@ -772,9 +772,12 @@ static void vulkan_check_dynamic_state(
if (vk->tracker.dirty & VULKAN_DIRTY_DYNAMIC_BIT) if (vk->tracker.dirty & VULKAN_DIRTY_DYNAMIC_BIT)
{ {
const VkRect2D sci = { VkRect2D sci;
{ vk->vp.x, vk->vp.y },
{ vk->vp.width, vk->vp.height }}; sci.offset.x = vk->vp.x;
sci.offset.y = vk->vp.y;
sci.extent.width = vk->vp.width;
sci.extent.height = vk->vp.height;
vkCmdSetViewport(vk->cmd, 0, 1, &vk->vk_vp); vkCmdSetViewport(vk->cmd, 0, 1, &vk->vk_vp);
vkCmdSetScissor (vk->cmd, 0, 1, &sci); vkCmdSetScissor (vk->cmd, 0, 1, &sci);
@ -1144,8 +1147,15 @@ struct vk_buffer_chain vulkan_buffer_chain_init(
VkDeviceSize alignment, VkDeviceSize alignment,
VkBufferUsageFlags usage) VkBufferUsageFlags usage)
{ {
struct vk_buffer_chain chain = { struct vk_buffer_chain chain;
block_size, alignment, 0, usage, NULL, NULL };
chain.block_size = block_size;
chain.alignment = alignment;
chain.offset = 0;
chain.usage = usage;
chain.head = NULL;
chain.current = NULL;
return chain; return chain;
} }
@ -1487,12 +1497,13 @@ static bool vulkan_context_init_device(gfx_ctx_vulkan_data_t *vk)
for (i = 0; i < queue_count; i++) for (i = 0; i < queue_count; i++)
{ {
VkQueueFlags required;
VkBool32 supported = VK_FALSE; VkBool32 supported = VK_FALSE;
vkGetPhysicalDeviceSurfaceSupportKHR( vkGetPhysicalDeviceSurfaceSupportKHR(
vk->context.gpu, i, vk->context.gpu, i,
vk->vk_surface, &supported); vk->vk_surface, &supported);
VkQueueFlags required = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT; required = VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_COMPUTE_BIT;
if (supported && ((queue_properties[i].queueFlags & required) == required)) if (supported && ((queue_properties[i].queueFlags & required) == required))
{ {
vk->context.graphics_queue_index = i; vk->context.graphics_queue_index = i;
@ -1573,6 +1584,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
{ {
unsigned i; unsigned i;
VkResult res; VkResult res;
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
VkInstanceCreateInfo info = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO }; VkInstanceCreateInfo info = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO };
VkApplicationInfo app = { VK_STRUCTURE_TYPE_APPLICATION_INFO }; VkApplicationInfo app = { VK_STRUCTURE_TYPE_APPLICATION_INFO };
@ -1647,7 +1659,7 @@ bool vulkan_context_init(gfx_ctx_vulkan_data_t *vk,
RARCH_LOG("Vulkan dynamic library loaded.\n"); RARCH_LOG("Vulkan dynamic library loaded.\n");
PFN_vkGetInstanceProcAddr GetInstanceProcAddr = GetInstanceProcAddr =
(PFN_vkGetInstanceProcAddr)dylib_proc(vulkan_library, "vkGetInstanceProcAddr"); (PFN_vkGetInstanceProcAddr)dylib_proc(vulkan_library, "vkGetInstanceProcAddr");
if (!GetInstanceProcAddr) if (!GetInstanceProcAddr)
@ -2018,10 +2030,11 @@ bool vulkan_surface_create(gfx_ctx_vulkan_data_t *vk,
case VULKAN_WSI_WIN32: case VULKAN_WSI_WIN32:
#ifdef _WIN32 #ifdef _WIN32
{ {
VkWin32SurfaceCreateInfoKHR surf_info;
PFN_vkCreateWin32SurfaceKHR create; PFN_vkCreateWin32SurfaceKHR create;
if (!VULKAN_SYMBOL_WRAPPER_LOAD_INSTANCE_SYMBOL(vk->context.instance, "vkCreateWin32SurfaceKHR", create)) if (!VULKAN_SYMBOL_WRAPPER_LOAD_INSTANCE_SYMBOL(vk->context.instance, "vkCreateWin32SurfaceKHR", create))
return false; return false;
VkWin32SurfaceCreateInfoKHR surf_info;
memset(&surf_info, 0, sizeof(surf_info)); memset(&surf_info, 0, sizeof(surf_info));

View File

@ -1194,12 +1194,12 @@ error:
static void vulkan_update_filter_chain(vk_t *vk) static void vulkan_update_filter_chain(vk_t *vk)
{ {
const struct vulkan_filter_chain_swapchain_info info = { struct vulkan_filter_chain_swapchain_info info;
vk->vk_vp,
vk->context->swapchain_format, info.viewport = vk->vk_vp;
vk->render_pass, info.format = vk->context->swapchain_format;
vk->context->num_swapchain_images, info.render_pass = vk->render_pass;
}; info.num_indices = vk->context->num_swapchain_images;
if (!vulkan_filter_chain_update_swapchain_info((vulkan_filter_chain_t*)vk->filter_chain, &info)) if (!vulkan_filter_chain_update_swapchain_info((vulkan_filter_chain_t*)vk->filter_chain, &info))
RARCH_ERR("Failed to update filter chain info. This will probably lead to a crash ...\n"); RARCH_ERR("Failed to update filter chain info. This will probably lead to a crash ...\n");
@ -1346,9 +1346,10 @@ static void vulkan_set_video_mode(void *data,
unsigned width, unsigned height, unsigned width, unsigned height,
bool fullscreen) bool fullscreen)
{ {
(void)data;
gfx_ctx_mode_t mode; gfx_ctx_mode_t mode;
(void)data;
mode.width = width; mode.width = width;
mode.height = height; mode.height = height;
mode.fullscreen = fullscreen; mode.fullscreen = fullscreen;

View File

@ -1,6 +1,7 @@
// /*
// File: vk_platform.h * File: vk_platform.h
// */
/* /*
** Copyright (c) 2014-2015 The Khronos Group Inc. ** Copyright (c) 2014-2015 The Khronos Group Inc.
** **
@ -24,7 +25,7 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif // __cplusplus #endif /* __cplusplus */
/* /*
*************************************************************************************************** ***************************************************************************************************
@ -47,22 +48,22 @@ extern "C"
* Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void); * Function pointer type: typedef void (VKAPI_PTR *PFN_vkCommand)(void);
*/ */
#if defined(_WIN32) #if defined(_WIN32)
// On Windows, Vulkan commands use the stdcall convention /* On Windows, Vulkan commands use the stdcall convention */
#define VKAPI_ATTR #define VKAPI_ATTR
#define VKAPI_CALL __stdcall #define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL #define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__) #elif defined(__ANDROID__) && defined(__ARM_EABI__) && !defined(__ARM_ARCH_7A__)
// Android does not support Vulkan in native code using the "armeabi" ABI. /* Android does not support Vulkan in native code using the "armeabi" ABI. */
#error "Vulkan requires the 'armeabi-v7a' or 'armeabi-v7a-hard' ABI on 32-bit ARM CPUs" #error "Vulkan requires the 'armeabi-v7a' or 'armeabi-v7a-hard' ABI on 32-bit ARM CPUs"
#elif defined(__ANDROID__) && defined(__ARM_ARCH_7A__) #elif defined(__ANDROID__) && defined(__ARM_ARCH_7A__)
// On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling /* On Android/ARMv7a, Vulkan functions use the armeabi-v7a-hard calling
// convention, even if the application's native code is compiled with the * convention, even if the application's native code is compiled with the
// armeabi-v7a calling convention. * armeabi-v7a calling convention. */
#define VKAPI_ATTR __attribute__((pcs("aapcs-vfp"))) #define VKAPI_ATTR __attribute__((pcs("aapcs-vfp")))
#define VKAPI_CALL #define VKAPI_CALL
#define VKAPI_PTR VKAPI_ATTR #define VKAPI_PTR VKAPI_ATTR
#else #else
// On other platforms, use the default calling convention /* On other platforms, use the default calling convention */
#define VKAPI_ATTR #define VKAPI_ATTR
#define VKAPI_CALL #define VKAPI_CALL
#define VKAPI_PTR #define VKAPI_PTR
@ -83,15 +84,15 @@ extern "C"
#else #else
#include <stdint.h> #include <stdint.h>
#endif #endif
#endif // !defined(VK_NO_STDINT_H) #endif /* !defined(VK_NO_STDINT_H) */
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } /* extern "C" */
#endif // __cplusplus #endif /* __cplusplus */
// Platform-specific headers required by platform window system extensions. /* Platform-specific headers required by platform window system extensions.
// These are enabled prior to #including "vulkan.h". The same enable then * These are enabled prior to #including "vulkan.h". The same enable then
// controls inclusion of the extension interfaces in vulkan.h. * controls inclusion of the extension interfaces in vulkan.h. */
#ifdef VK_USE_PLATFORM_ANDROID_KHR #ifdef VK_USE_PLATFORM_ANDROID_KHR
#include <android/native_window.h> #include <android/native_window.h>

View File

@ -1,6 +1,7 @@
// /*
// File: vk_sdk_platform.h * File: vk_sdk_platform.h
// */
/* /*
* Copyright (c) 2015-2016 The Khronos Group Inc. * Copyright (c) 2015-2016 The Khronos Group Inc.
* Copyright (c) 2015-2016 Valve Corporation * Copyright (c) 2015-2016 Valve Corporation
@ -27,20 +28,20 @@
#ifndef __cplusplus #ifndef __cplusplus
#undef inline #undef inline
#define inline __inline #define inline __inline
#endif // __cplusplus #endif /* __cplusplus */
#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) #if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/)
// C99: /* C99:
// Microsoft didn't implement C99 in Visual Studio; but started adding it with * Microsoft didn't implement C99 in Visual Studio; but started adding it with
// VS2013. However, VS2013 still didn't have snprintf(). The following is a * VS2013. However, VS2013 still didn't have snprintf(). The following is a
// work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the * work-around (Note: The _CRT_SECURE_NO_WARNINGS macro must be set in the
// "CMakeLists.txt" file). * "CMakeLists.txt" file).
// NOTE: This is fixed in Visual Studio 2015. * NOTE: This is fixed in Visual Studio 2015. */
#define snprintf _snprintf #define snprintf _snprintf
#endif #endif
#define strdup _strdup #define strdup _strdup
#endif // _WIN32 #endif /* _WIN32 */
#endif // VK_SDK_PLATFORM_H #endif /* VK_SDK_PLATFORM_H */

View File

@ -33,16 +33,18 @@ extern "C" {
#define VK_MAKE_VERSION(major, minor, patch) \ #define VK_MAKE_VERSION(major, minor, patch) \
(((major) << 22) | ((minor) << 12) | (patch)) (((major) << 22) | ((minor) << 12) | (patch))
// DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. /* DEPRECATED: This define has been removed. Specific version defines (e.g. VK_API_VERSION_1_0), or the VK_MAKE_VERSION macro, should be used instead. */
//#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0) #if 0
#define VK_API_VERSION VK_MAKE_VERSION(1, 0, 0)
#endif
// Vulkan 1.0 version number /* Vulkan 1.0 version number */
#define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0) #define VK_API_VERSION_1_0 VK_MAKE_VERSION(1, 0, 0)
#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22) #define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22)
#define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff) #define VK_VERSION_MINOR(version) (((uint32_t)(version) >> 12) & 0x3ff)
#define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff) #define VK_VERSION_PATCH(version) ((uint32_t)(version) & 0xfff)
// Version of this file /* Version of this file */
#define VK_HEADER_VERSION 17 #define VK_HEADER_VERSION 17

View File

@ -29,16 +29,16 @@
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif // __cplusplus #endif /* __cplusplus */
#define VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL 1024 #define VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL 1024
typedef struct VkDmaBufImageCreateInfo_ typedef struct VkDmaBufImageCreateInfo_
{ {
VkStructureType sType; // Must be VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL VkStructureType sType; /* Must be VK_STRUCTURE_TYPE_DMA_BUF_IMAGE_CREATE_INFO_INTEL */
const void* pNext; // Pointer to next structure. const void* pNext; /* Pointer to next structure. */
int fd; int fd;
VkFormat format; VkFormat format;
VkExtent3D extent; // Depth must be 1 VkExtent3D extent; /* Depth must be 1 */
uint32_t strideInBytes; uint32_t strideInBytes;
} VkDmaBufImageCreateInfo; } VkDmaBufImageCreateInfo;
@ -56,7 +56,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateDmaBufImageINTEL(
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } /* extern "C" */
#endif // __cplusplus #endif /* __cplusplus */
#endif // __VULKAN_INTEL_H__ #endif /* __VULKAN_INTEL_H__ */

View File

@ -101,7 +101,7 @@ typedef struct
HWND label_title; HWND label_title;
HWND label_val; HWND label_val;
} trackbar; } trackbar;
}; } elems;
} shader_param_ctrl_t; } shader_param_ctrl_t;
typedef struct typedef struct
@ -128,7 +128,7 @@ static bool shader_dlg_refresh_trackbar_label(int index,
snprintf(val_buffer, sizeof(val_buffer), "%.2f", snprintf(val_buffer, sizeof(val_buffer), "%.2f",
shader_info->data->parameters[index].current); shader_info->data->parameters[index].current);
SendMessage(g_shader_dlg.controls[index].trackbar.label_val, SendMessage(g_shader_dlg.controls[index].elems.trackbar.label_val,
WM_SETTEXT, 0, (LPARAM)val_buffer); WM_SETTEXT, 0, (LPARAM)val_buffer);
return true; return true;
@ -155,7 +155,7 @@ static void shader_dlg_params_refresh(void)
bool checked = shader_info.data ? bool checked = shader_info.data ?
(shader_info.data->parameters[i].current == (shader_info.data->parameters[i].current ==
shader_info.data->parameters[i].maximum) : false; shader_info.data->parameters[i].maximum) : false;
SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); SendMessage(control->elems.checkbox.hwnd, BM_SETCHECK, checked, 0);
} }
break; break;
case SHADER_PARAM_CTRL_TRACKBAR: case SHADER_PARAM_CTRL_TRACKBAR:
@ -167,14 +167,14 @@ static void shader_dlg_params_refresh(void)
if (shader_info.data) if (shader_info.data)
{ {
SendMessage(control->trackbar.hwnd, SendMessage(control->elems.trackbar.hwnd,
TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0);
SendMessage(control->trackbar.hwnd, SendMessage(control->elems.trackbar.hwnd,
TBM_SETRANGEMAX, (WPARAM)TRUE, TBM_SETRANGEMAX, (WPARAM)TRUE,
(LPARAM)((shader_info.data->parameters[i].maximum - (LPARAM)((shader_info.data->parameters[i].maximum -
shader_info.data->parameters[i].minimum) shader_info.data->parameters[i].minimum)
/ shader_info.data->parameters[i].step)); / shader_info.data->parameters[i].step));
SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, SendMessage(control->elems.trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE,
(LPARAM)((shader_info.data->parameters[i].current - (LPARAM)((shader_info.data->parameters[i].current -
shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].minimum) /
shader_info.data->parameters[i].step)); shader_info.data->parameters[i].step));
@ -207,13 +207,13 @@ static void shader_dlg_params_clear(void)
{ {
const ui_window_t *window = ui_companion_driver_get_window_ptr(); const ui_window_t *window = ui_companion_driver_get_window_ptr();
if (window) if (window)
window->destroy(&control->checkbox); window->destroy(&control->elems.checkbox);
} }
break; break;
case SHADER_PARAM_CTRL_TRACKBAR: case SHADER_PARAM_CTRL_TRACKBAR:
DestroyWindow(control->trackbar.label_title); DestroyWindow(control->elems.trackbar.label_title);
DestroyWindow(control->trackbar.label_val); DestroyWindow(control->elems.trackbar.label_val);
DestroyWindow(control->trackbar.hwnd); DestroyWindow(control->elems.trackbar.hwnd);
break; break;
} }
@ -260,12 +260,12 @@ void shader_dlg_params_reload(void)
} }
control->type = SHADER_PARAM_CTRL_CHECKBOX; control->type = SHADER_PARAM_CTRL_CHECKBOX;
control->checkbox.hwnd = CreateWindowEx(0, "BUTTON", control->elems.checkbox.hwnd = CreateWindowEx(0, "BUTTON",
shader_info.data->parameters[i].desc, shader_info.data->parameters[i].desc,
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y,
SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT,
g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL);
SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); SendMessage(control->elems.checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN;
} }
else else
@ -277,29 +277,29 @@ void shader_dlg_params_reload(void)
pos_x += SHADER_DLG_WIDTH; pos_x += SHADER_DLG_WIDTH;
} }
control->type = SHADER_PARAM_CTRL_TRACKBAR; control->type = SHADER_PARAM_CTRL_TRACKBAR;
control->trackbar.label_title = CreateWindowEx(0, "STATIC", control->elems.trackbar.label_title = CreateWindowEx(0, "STATIC",
shader_info.data->parameters[i].desc, shader_info.data->parameters[i].desc,
WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y,
SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd,
(HMENU)(size_t)i, NULL, NULL); (HMENU)(size_t)i, NULL, NULL);
SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); SendMessage(control->elems.trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
pos_y += SHADER_DLG_LABEL_HEIGHT; pos_y += SHADER_DLG_LABEL_HEIGHT;
control->trackbar.hwnd = CreateWindowEx(0, (LPCSTR)TRACKBAR_CLASS, "", control->elems.trackbar.hwnd = CreateWindowEx(0, (LPCSTR)TRACKBAR_CLASS, "",
WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS,
pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y,
SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT,
g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL);
control->trackbar.label_val = CreateWindowEx(0, "STATIC", "", control->elems.trackbar.label_val = CreateWindowEx(0, "STATIC", "",
WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x,
pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT,
g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL);
SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); SendMessage(control->elems.trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, SendMessage(control->elems.trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE,
(LPARAM)control->trackbar.label_val); (LPARAM)control->elems.trackbar.label_val);
pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN;
@ -402,7 +402,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message,
video_shader_ctx_t shader_info; video_shader_ctx_t shader_info;
video_shader_driver_get_current_shader(&shader_info); video_shader_driver_get_current_shader(&shader_info);
if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, if (SendMessage(g_shader_dlg.controls[i].elems.checkbox.hwnd,
BM_GETCHECK, 0, 0) == BST_CHECKED) BM_GETCHECK, 0, 0) == BST_CHECKED)
shader_info.data->parameters[i].current = shader_info.data->parameters[i].current =
shader_info.data->parameters[i].maximum; shader_info.data->parameters[i].maximum;
@ -424,7 +424,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message,
if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR)
break; break;
pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); pos = (int)SendMessage(g_shader_dlg.controls[i].elems.trackbar.hwnd, TBM_GETPOS, 0, 0);
{ {