Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Commit

Permalink
Added patch to recognize GTX 560M card with NVIDIA driver.
Browse files Browse the repository at this point in the history
  • Loading branch information
slackner committed Oct 16, 2016
1 parent 15a0c75 commit 36d0a71
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 21 deletions.
16 changes: 16 additions & 0 deletions patches/patchinstall.sh
Expand Up @@ -369,6 +369,7 @@ patch_enable_all ()
enable_wined3d_CSMT_Helper="$1"
enable_wined3d_CSMT_Main="$1"
enable_wined3d_DXTn="$1"
enable_wined3d_GTX_560M="$1"
enable_wined3d_Limit_Vram="$1"
enable_wined3d_QUERY_Stubs="$1"
enable_wined3d_Revert_Pixel_Center_Offset="$1"
Expand Down Expand Up @@ -1288,6 +1289,9 @@ patch_enable ()
wined3d-DXTn)
enable_wined3d_DXTn="$2"
;;
wined3d-GTX_560M)
enable_wined3d_GTX_560M="$2"
;;
wined3d-Limit_Vram)
enable_wined3d_Limit_Vram="$2"
;;
Expand Down Expand Up @@ -7528,6 +7532,18 @@ if test "$enable_wined3d_CSMT_Helper" -eq 1; then
) >> "$patchlist"
fi

# Patchset wined3d-GTX_560M
# |
# | Modified files:
# | * dlls/wined3d/directx.c, dlls/wined3d/wined3d_private.h
# |
if test "$enable_wined3d_GTX_560M" -eq 1; then
patch_apply wined3d-GTX_560M/0001-wined3d-Recognize-GTX-560M-card-with-NVIDIA-driver.patch
(
echo '+ { "Christian Costa", "wined3d: Recognize GTX 560M card with NVIDIA driver.", 1 },';
) >> "$patchlist"
fi

# Patchset wined3d-Limit_Vram
# |
# | Modified files:
Expand Down
42 changes: 21 additions & 21 deletions patches/wined3d-CSMT_Main/9999-IfDefined.patch
Expand Up @@ -8186,7 +8186,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
UINT rt_count, const struct wined3d_fb_state *fb) DECLSPEC_HIDDEN;
BOOL context_apply_draw_state(struct wined3d_context *context,
const struct wined3d_device *device, const struct wined3d_state *state) DECLSPEC_HIDDEN;
@@ -2380,7 +2438,11 @@ struct wined3d_stream_state
@@ -2381,7 +2439,11 @@ struct wined3d_stream_state
struct wined3d_state
{
DWORD flags;
Expand All @@ -8198,7 +8198,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h

struct wined3d_vertex_declaration *vertex_declaration;
struct wined3d_stream_output stream_output[MAX_STREAM_OUT];
@@ -2427,6 +2489,16 @@ struct wined3d_state
@@ -2428,6 +2490,16 @@ struct wined3d_state
struct wined3d_rasterizer_state *rasterizer_state;
};

Expand All @@ -8215,7 +8215,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
#define WINED3D_UNMAPPED_STAGE ~0U

/* Multithreaded flag. Removed from the public header to signal that
@@ -2479,16 +2551,21 @@ struct wined3d_device
@@ -2480,16 +2552,21 @@ struct wined3d_device
struct wined3d_rendertarget_view *back_buffer_view;
struct wined3d_swapchain **swapchains;
UINT swapchain_count;
Expand All @@ -8237,7 +8237,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/* For rendering to a texture using glCopyTexImage */
GLuint depth_blt_texture;

@@ -2540,9 +2617,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
@@ -2541,9 +2618,23 @@ LRESULT device_process_message(struct wined3d_device *device, HWND window, BOOL
UINT message, WPARAM wparam, LPARAM lparam, WNDPROC proc) DECLSPEC_HIDDEN;
void device_resource_add(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
void device_resource_released(struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
Expand All @@ -8261,7 +8261,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h

static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD state)
{
@@ -2587,7 +2678,11 @@ struct wined3d_resource
@@ -2588,7 +2679,11 @@ struct wined3d_resource
UINT depth;
UINT size;
DWORD priority;
Expand All @@ -8273,7 +8273,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct list resource_list_entry;
LONG access_count;

@@ -2634,6 +2729,9 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI
@@ -2635,6 +2730,9 @@ void wined3d_resource_free_sysmem(struct wined3d_resource *resource) DECLSPEC_HI
GLbitfield wined3d_resource_gl_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
GLenum wined3d_resource_gl_legacy_map_flags(DWORD d3d_flags) DECLSPEC_HIDDEN;
BOOL wined3d_resource_is_offscreen(struct wined3d_resource *resource) DECLSPEC_HIDDEN;
Expand All @@ -8283,7 +8283,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_resource_update_draw_binding(struct wined3d_resource *resource) DECLSPEC_HIDDEN;

/* Tests show that the start address of resources is 32 byte aligned */
@@ -2695,6 +2793,9 @@ struct wined3d_texture
@@ -2696,6 +2794,9 @@ struct wined3d_texture
DWORD flags;
GLenum target;
DWORD update_map_binding;
Expand All @@ -8293,7 +8293,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h

GLuint rb_multisample;
GLuint rb_resolved;
@@ -2731,7 +2832,12 @@ struct wined3d_texture
@@ -2732,7 +2833,12 @@ struct wined3d_texture

unsigned int map_count;
DWORD locations;
Expand All @@ -8306,7 +8306,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
} sub_resources[1];
};

@@ -2782,11 +2888,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
@@ -2783,11 +2889,23 @@ void wined3d_texture_bind(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
void wined3d_texture_bind_and_dirtify(struct wined3d_texture *texture,
struct wined3d_context *context, BOOL srgb) DECLSPEC_HIDDEN;
Expand All @@ -8330,7 +8330,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_texture_sub_resource *wined3d_texture_get_sub_resource(struct wined3d_texture *texture,
unsigned int sub_resource_idx) DECLSPEC_HIDDEN;
void wined3d_texture_invalidate_location(struct wined3d_texture *texture,
@@ -2799,13 +2917,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size
@@ -2800,13 +2918,26 @@ void *wined3d_texture_map_bo_address(const struct wined3d_bo_address *data, size
const struct wined3d_gl_info *gl_info, GLenum binding, DWORD flags) DECLSPEC_HIDDEN;
BOOL wined3d_texture_prepare_location(struct wined3d_texture *texture, unsigned int sub_resource_idx,
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
Expand All @@ -8357,7 +8357,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int sub_resource_idx,
const struct wined3d_context *context, const struct wined3d_const_bo_address *data,
unsigned int row_pitch, unsigned int slice_pitch) DECLSPEC_HIDDEN;
@@ -2914,7 +3045,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru
@@ -2915,7 +3046,11 @@ void surface_get_drawable_size(const struct wined3d_surface *surface, const stru
unsigned int *width, unsigned int *height) DECLSPEC_HIDDEN;
void surface_load_fb_texture(struct wined3d_surface *surface, BOOL srgb,
struct wined3d_context *context) DECLSPEC_HIDDEN;
Expand All @@ -8369,7 +8369,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_context *context, DWORD location) DECLSPEC_HIDDEN;
void surface_modify_ds_location(struct wined3d_surface *surface, DWORD location, UINT w, UINT h) DECLSPEC_HIDDEN;
void surface_set_compatible_renderbuffer(struct wined3d_surface *surface,
@@ -2925,6 +3060,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
@@ -2926,6 +3061,11 @@ HRESULT surface_upload_from_surface(struct wined3d_surface *dst_surface, const P
void wined3d_surface_upload_data(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info,
const struct wined3d_format *format, const RECT *src_rect, UINT src_pitch, const POINT *dst_point,
BOOL srgb, const struct wined3d_const_bo_address *data) DECLSPEC_HIDDEN;
Expand All @@ -8381,7 +8381,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h

void draw_textured_quad(const struct wined3d_surface *src_surface, struct wined3d_context *context,
const RECT *src_rect, const RECT *dst_rect, enum wined3d_texture_filter_type filter) DECLSPEC_HIDDEN;
@@ -2939,6 +3079,12 @@ struct wined3d_sampler
@@ -2940,6 +3080,12 @@ struct wined3d_sampler
GLuint name;
};

Expand All @@ -8394,15 +8394,15 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_vertex_declaration_element
{
const struct wined3d_format *format;
@@ -3034,6 +3180,7 @@ struct wined3d_stateblock
@@ -3035,6 +3181,7 @@ struct wined3d_stateblock
void stateblock_init_contained_states(struct wined3d_stateblock *stateblock) DECLSPEC_HIDDEN;

void state_cleanup(struct wined3d_state *state) DECLSPEC_HIDDEN;
+#if !defined(STAGING_CSMT)
void state_init(struct wined3d_state *state, struct wined3d_fb_state *fb,
const struct wined3d_gl_info *gl_info, const struct wined3d_d3d_info *d3d_info,
DWORD flags) DECLSPEC_HIDDEN;
@@ -3047,54 +3194,150 @@ enum wined3d_push_constants
@@ -3048,54 +3195,150 @@ enum wined3d_push_constants
WINED3D_PUSH_CONSTANTS_PS_I,
WINED3D_PUSH_CONSTANTS_VS_B,
WINED3D_PUSH_CONSTANTS_PS_B,
Expand Down Expand Up @@ -8553,15 +8553,15 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void wined3d_cs_emit_set_rasterizer_state(struct wined3d_cs *cs,
struct wined3d_rasterizer_state *rasterizer_state) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_render_state(struct wined3d_cs *cs,
@@ -3124,6 +3367,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
@@ -3125,6 +3368,7 @@ void wined3d_cs_emit_set_transform(struct wined3d_cs *cs, enum wined3d_transform
void wined3d_cs_emit_set_vertex_declaration(struct wined3d_cs *cs,
struct wined3d_vertex_declaration *declaration) DECLSPEC_HIDDEN;
void wined3d_cs_emit_set_viewport(struct wined3d_cs *cs, const struct wined3d_viewport *viewport) DECLSPEC_HIDDEN;
+#if !defined(STAGING_CSMT)
void wined3d_cs_emit_unload_resource(struct wined3d_cs *cs, struct wined3d_resource *resource) DECLSPEC_HIDDEN;
HRESULT wined3d_cs_map(struct wined3d_cs *cs, struct wined3d_resource *resource, unsigned int sub_resource_idx,
struct wined3d_map_desc *map_desc, const struct wined3d_box *box, unsigned int flags) DECLSPEC_HIDDEN;
@@ -3135,6 +3379,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d
@@ -3136,6 +3380,24 @@ static inline void wined3d_cs_push_constants(struct wined3d_cs *cs, enum wined3d
{
cs->ops->push_constants(cs, p, start_idx, count, constants);
}
Expand All @@ -8586,7 +8586,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h

/* TODO: Add tests and support for FLOAT16_4 POSITIONT, D3DCOLOR position, other
* fixed function semantics as D3DCOLOR or FLOAT16 */
@@ -3161,6 +3423,9 @@ struct wined3d_buffer
@@ -3162,6 +3424,9 @@ struct wined3d_buffer
GLenum buffer_object_usage;
GLenum buffer_type_hint;
DWORD flags;
Expand All @@ -8596,7 +8596,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void *map_ptr;

struct wined3d_map_range *maps;
@@ -3185,11 +3450,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
@@ -3186,11 +3451,19 @@ void buffer_get_memory(struct wined3d_buffer *buffer, struct wined3d_context *co
BYTE *buffer_get_sysmem(struct wined3d_buffer *buffer, struct wined3d_context *context) DECLSPEC_HIDDEN;
void buffer_internal_preload(struct wined3d_buffer *buffer, struct wined3d_context *context,
const struct wined3d_state *state) DECLSPEC_HIDDEN;
Expand All @@ -8616,7 +8616,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h

struct wined3d_rendertarget_view
{
@@ -3251,7 +3524,12 @@ struct wined3d_unordered_access_view
@@ -3252,7 +3525,12 @@ struct wined3d_unordered_access_view
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain,
Expand All @@ -8629,7 +8629,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
void (*swapchain_frontbuffer_updated)(struct wined3d_swapchain *swapchain);
};

@@ -3288,6 +3566,10 @@ struct wined3d_swapchain
@@ -3289,6 +3567,10 @@ struct wined3d_swapchain

void wined3d_swapchain_activate(struct wined3d_swapchain *swapchain, BOOL activate) DECLSPEC_HIDDEN;
struct wined3d_context *swapchain_get_context(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
Expand Down
@@ -0,0 +1,45 @@
From 9d6e5bd47a0186732803f1f6500ef52b8d13e11c Mon Sep 17 00:00:00 2001
From: Christian Costa <titan.costa@gmail.com>
Date: Sun, 16 Oct 2016 14:01:56 +0200
Subject: wined3d: Recognize GTX 560M card with NVIDIA driver.

---
dlls/wined3d/directx.c | 2 ++
dlls/wined3d/wined3d_private.h | 1 +
2 files changed, 3 insertions(+)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index a8c8c9f..9edeb5b 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1270,6 +1270,7 @@ static const struct gpu_description gpu_description_table[] =
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX550, "NVIDIA GeForce GTX 550 Ti", DRIVER_NVIDIA_GEFORCE8, 1024},
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT555M, "NVIDIA GeForce GT 555M", DRIVER_NVIDIA_GEFORCE8, 1024},
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560TI, "NVIDIA GeForce GTX 560 Ti", DRIVER_NVIDIA_GEFORCE8, 1024},
+ {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560M, "NVIDIA GeForce GTX 560M", DRIVER_NVIDIA_GEFORCE8, 3072},
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560, "NVIDIA GeForce GTX 560", DRIVER_NVIDIA_GEFORCE8, 1024},
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX570, "NVIDIA GeForce GTX 570", DRIVER_NVIDIA_GEFORCE8, 1280},
{HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX580, "NVIDIA GeForce GTX 580", DRIVER_NVIDIA_GEFORCE8, 1536},
@@ -1848,6 +1849,7 @@ cards_nvidia_binary[] =
{"GTX 580", CARD_NVIDIA_GEFORCE_GTX580}, /* Geforce 500 - highend */
{"GTX 570", CARD_NVIDIA_GEFORCE_GTX570}, /* Geforce 500 - midend high */
{"GTX 560 Ti", CARD_NVIDIA_GEFORCE_GTX560TI}, /* Geforce 500 - midend */
+ {"GTX 560M", CARD_NVIDIA_GEFORCE_GTX560M}, /* Geforce 500 - midend mobile */
{"GTX 560", CARD_NVIDIA_GEFORCE_GTX560}, /* Geforce 500 - midend */
{"GT 555M", CARD_NVIDIA_GEFORCE_GT555M}, /* Geforce 500 - midend mobile */
{"GTX 550 Ti", CARD_NVIDIA_GEFORCE_GTX550}, /* Geforce 500 - midend */
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 4326bee..f089d05 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1908,6 +1908,7 @@ enum wined3d_pci_device
CARD_NVIDIA_GEFORCE_GTX550 = 0x1244,
CARD_NVIDIA_GEFORCE_GT555M = 0x04b8,
CARD_NVIDIA_GEFORCE_GTX560TI = 0x1200,
+ CARD_NVIDIA_GEFORCE_GTX560M = 0x1251,
CARD_NVIDIA_GEFORCE_GTX560 = 0x1201,
CARD_NVIDIA_GEFORCE_GTX570 = 0x1081,
CARD_NVIDIA_GEFORCE_GTX580 = 0x1080,
--
2.9.0

1 change: 1 addition & 0 deletions patches/wined3d-GTX_560M/definition
@@ -0,0 +1 @@
Fixes: Recognize GTX 560M card with NVIDIA driver

0 comments on commit 36d0a71

Please sign in to comment.