Commit 9f85ec50 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Get wined3d creation flags from d3d_info.

parent a6911a13
......@@ -1160,7 +1160,7 @@ static void shader_glsl_ffp_vertex_normalmatrix_uniform(const struct wined3d_con
return;
get_modelview_matrix(context, state, 0, &mv);
if (context->device->wined3d->flags & WINED3D_LEGACY_FFP_LIGHTING)
if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_FFP_LIGHTING)
invert_matrix_3d(&mv, &mv);
else
invert_matrix(&mv, &mv);
......@@ -2203,7 +2203,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
{
if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
{
if (shader->device->wined3d->flags & WINED3D_PIXEL_CENTER_INTEGER)
if (context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
shader_addline(buffer, "layout(%spixel_center_integer) in vec4 gl_FragCoord;\n",
ps_args->render_offscreen ? "" : "origin_upper_left, ");
else if (!ps_args->render_offscreen)
......@@ -5948,7 +5948,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context
{
if (gl_info->supported[ARB_FRAGMENT_COORD_CONVENTIONS])
shader_addline(buffer, "vpos = gl_FragCoord;\n");
else if (shader->device->wined3d->flags & WINED3D_PIXEL_CENTER_INTEGER)
else if (context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
shader_addline(buffer,
"vpos = floor(vec4(0, ycorrection[0], 0, 0) + gl_FragCoord * vec4(1, ycorrection[1], 1, 1));\n");
else
......
......@@ -1712,7 +1712,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
gl_info->gl_ops.gl.p_glEnable(GL_POLYGON_OFFSET_FILL);
checkGLcall("glEnable(GL_POLYGON_OFFSET_FILL)");
if (context->device->wined3d->flags & WINED3D_LEGACY_DEPTH_BIAS)
if (context->d3d_info->wined3d_creation_flags & WINED3D_LEGACY_DEPTH_BIAS)
{
float bias = -(float)const_bias.d;
gl_info->gl_ops.gl.p_glPolygonOffset(bias, bias);
......@@ -4655,7 +4655,7 @@ static void viewport_miscpart_cc(struct wined3d_context *context,
const struct wined3d_rendertarget_view *target = state->fb->render_targets[0];
/* See get_projection_matrix() in utils.c for a discussion about those
* values. */
float pixel_center_offset = context->device->wined3d->flags
float pixel_center_offset = context->d3d_info->wined3d_creation_flags
& WINED3D_PIXEL_CENTER_INTEGER ? 63.0f / 128.0f : -1.0f / 128.0f;
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
......
......@@ -4513,7 +4513,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
* driver, but small enough to prevent it from interfering with any
* anti-aliasing. */
if (!clip_control && context->device->wined3d->flags & WINED3D_PIXEL_CENTER_INTEGER)
if (!clip_control && context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
center_offset = 63.0f / 64.0f;
else
center_offset = -1.0f / 64.0f;
......
......@@ -3524,7 +3524,7 @@ static inline void shader_get_position_fixup(const struct wined3d_context *conte
{
float center_offset;
if (context->device->wined3d->flags & WINED3D_PIXEL_CENTER_INTEGER)
if (context->d3d_info->wined3d_creation_flags & WINED3D_PIXEL_CENTER_INTEGER)
center_offset = 63.0f / 64.0f;
else
center_offset = -1.0f / 64.0f;
......
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