Commit ef2ad5ef authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

wined3d: Store the "wined3d_caps" field of struct fragment_caps as separate bool flags.

parent efb0d67a
......@@ -5211,7 +5211,7 @@ static void wined3d_adapter_gl_init_d3d_info(struct wined3d_adapter_gl *adapter_
d3d_info->ffp_generic_attributes = vertex_caps.ffp_generic_attributes;
d3d_info->ffp_alpha_test = !!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT];
d3d_info->vs_clipping = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING;
d3d_info->shader_color_key = !!(fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY);
d3d_info->shader_color_key = fragment_caps.color_key;
d3d_info->shader_double_precision = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION);
d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION);
d3d_info->frag_coord_correction = !!gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS];
......
......@@ -2341,7 +2341,7 @@ static void wined3d_adapter_vk_init_d3d_info(struct wined3d_adapter_vk *adapter_
d3d_info->ffp_generic_attributes = vertex_caps.ffp_generic_attributes;
d3d_info->ffp_alpha_test = false;
d3d_info->vs_clipping = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_VS_CLIPPING);
d3d_info->shader_color_key = !!(fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_COLOR_KEY);
d3d_info->shader_color_key = fragment_caps.color_key;
d3d_info->shader_double_precision = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION);
d3d_info->shader_output_interpolation = !!(shader_caps.wined3d_caps & WINED3D_SHADER_CAP_OUTPUT_INTERPOLATION);
d3d_info->viewport_array_index_any_shader = false; /* VK_EXT_shader_viewport_index_layer */
......
......@@ -4824,7 +4824,7 @@ static HRESULT shader_arb_alloc(struct wined3d_device *device, const struct wine
priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
priv->ffp_proj_control = fragment_caps.proj_control;
device->vertex_priv = vertex_priv;
device->fragment_priv = fragment_priv;
......@@ -5763,9 +5763,10 @@ static void arbfp_get_caps(const struct wined3d_adapter *adapter, struct fragmen
{
const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL
| WINED3D_FRAGMENT_CAP_SRGB_WRITE
| WINED3D_FRAGMENT_CAP_COLOR_KEY;
memset(caps, 0, sizeof(*caps));
caps->proj_control = true;
caps->srgb_write = true;
caps->color_key = true;
caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE |
WINED3DTEXOPCAPS_SELECTARG1 |
......
......@@ -1269,7 +1269,8 @@ static void atifs_enable(const struct wined3d_context *context, BOOL enable)
static void atifs_get_caps(const struct wined3d_adapter *adapter, struct fragment_caps *caps)
{
caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
memset(caps, 0, sizeof(*caps));
caps->proj_control = true;
caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP |
WINED3DPMISCCAPS_PERSTAGECONSTANT;
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE |
......
......@@ -11102,7 +11102,7 @@ static HRESULT shader_glsl_alloc(struct wined3d_device *device, const struct win
priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
priv->ffp_proj_control = fragment_caps.proj_control;
priv->legacy_lighting = device->wined3d->flags & WINED3D_LEGACY_FFP_LIGHTING;
device->vertex_priv = vertex_priv;
......@@ -12050,9 +12050,10 @@ static void glsl_fragment_pipe_get_caps(const struct wined3d_adapter *adapter, s
{
const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
caps->wined3d_caps = WINED3D_FRAGMENT_CAP_PROJ_CONTROL
| WINED3D_FRAGMENT_CAP_SRGB_WRITE
| WINED3D_FRAGMENT_CAP_COLOR_KEY;
memset(caps, 0, sizeof(*caps));
caps->proj_control = true;
caps->srgb_write = true;
caps->color_key = true;
caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP
| WINED3DPMISCCAPS_PERSTAGECONSTANT;
caps->TextureOpCaps = WINED3DTEXOPCAPS_DISABLE
......
......@@ -697,7 +697,8 @@ static void nvrc_fragment_get_caps(const struct wined3d_adapter *adapter, struct
{
const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
caps->wined3d_caps = 0;
memset(caps, 0, sizeof(*caps));
caps->PrimitiveMiscCaps = WINED3DPMISCCAPS_TSSARGTEMP;
/* The caps below can be supported but aren't handled yet in utils.c
......
......@@ -1990,7 +1990,7 @@ static HRESULT shader_none_alloc(struct wined3d_device *device, const struct win
priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
priv->ffp_proj_control = fragment_caps.proj_control;
device->vertex_priv = vertex_priv;
device->fragment_priv = fragment_priv;
......
......@@ -993,7 +993,7 @@ static HRESULT shader_spirv_alloc(struct wined3d_device *device,
priv->vertex_pipe = vertex_pipe;
priv->fragment_pipe = fragment_pipe;
fragment_pipe->get_caps(device->adapter, &fragment_caps);
priv->ffp_proj_control = fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_PROJ_CONTROL;
priv->ffp_proj_control = fragment_caps.proj_control;
memset(&priv->bindings, 0, sizeof(priv->bindings));
device->vertex_priv = vertex_priv;
......
......@@ -5150,7 +5150,7 @@ static void ffp_fragment_get_caps(const struct wined3d_adapter *adapter, struct
{
const struct wined3d_gl_info *gl_info = &wined3d_adapter_gl_const(adapter)->gl_info;
caps->wined3d_caps = 0;
memset(caps, 0, sizeof(*caps));
caps->PrimitiveMiscCaps = 0;
caps->TextureOpCaps = WINED3DTEXOPCAPS_ADD
| WINED3DTEXOPCAPS_ADDSIGNED
......
......@@ -3193,8 +3193,7 @@ static BOOL init_format_texture_info(struct wined3d_adapter *adapter, struct win
adapter->fragment_pipe->get_caps(adapter, &fragment_caps);
adapter->shader_backend->shader_get_caps(adapter, &shader_caps);
srgb_write = (fragment_caps.wined3d_caps & WINED3D_FRAGMENT_CAP_SRGB_WRITE)
&& (shader_caps.wined3d_caps & WINED3D_SHADER_CAP_SRGB_WRITE);
srgb_write = fragment_caps.srgb_write && (shader_caps.wined3d_caps & WINED3D_SHADER_CAP_SRGB_WRITE);
for (i = 0; i < ARRAY_SIZE(format_texture_info); ++i)
{
......
......@@ -1988,17 +1988,15 @@ struct wined3d_state_entry_template
unsigned int extension;
};
#define WINED3D_FRAGMENT_CAP_PROJ_CONTROL 0x00000001
#define WINED3D_FRAGMENT_CAP_SRGB_WRITE 0x00000002
#define WINED3D_FRAGMENT_CAP_COLOR_KEY 0x00000004
struct fragment_caps
{
DWORD wined3d_caps;
DWORD PrimitiveMiscCaps;
DWORD TextureOpCaps;
unsigned int max_blend_stages;
unsigned int max_textures;
bool proj_control;
bool srgb_write;
bool color_key;
};
#define GL_EXT_EMUL_ARB_MULTITEXTURE 0x00000001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment