Commit 4fbaab20 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Shadow format flags in wined3d_rendertarget_view.

parent a457b5e0
......@@ -2344,8 +2344,8 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE])
{
const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
if (rt_format->flags & WINED3DFMT_FLAG_SRGB_WRITE)
unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
if (rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE)
{
static unsigned int warned = 0;
......
......@@ -368,6 +368,7 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo
static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
const struct wined3d_gl_info *gl_info = context->gl_info;
GLenum srcBlend, dstBlend;
enum wined3d_blend d3d_blend;
......@@ -381,7 +382,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st
/* Disable blending in all cases even without pixelshaders.
* With blending on we could face a big performance penalty.
* The d3d9 visual test confirms the behavior. */
if (context->render_offscreen && !(rt_format->flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING))
if (context->render_offscreen && !(rt_fmt_flags & WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING))
{
gl_info->gl_ops.gl.p_glDisable(GL_BLEND);
checkGLcall("glDisable GL_BLEND");
......@@ -4899,13 +4900,12 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
const struct wined3d_gl_info *gl_info = context->gl_info;
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
if (state->render_states[WINED3D_RS_SRGBWRITEENABLE]
&& rt_format->flags & WINED3DFMT_FLAG_SRGB_WRITE)
if (state->render_states[WINED3D_RS_SRGBWRITEENABLE] && rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE)
gl_info->gl_ops.gl.p_glEnable(GL_FRAMEBUFFER_SRGB);
else
gl_info->gl_ops.gl.p_glDisable(GL_FRAMEBUFFER_SRGB);
......
......@@ -3686,7 +3686,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
unsigned int i;
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
......@@ -3902,7 +3902,7 @@ void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d
}
if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB]
&& state->render_states[WINED3D_RS_SRGBWRITEENABLE]
&& rt_format->flags & WINED3DFMT_FLAG_SRGB_WRITE)
&& rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE)
{
settings->sRGB_write = 1;
} else {
......
......@@ -101,6 +101,7 @@ static void wined3d_rendertarget_view_init(struct wined3d_rendertarget_view *vie
view->parent_ops = parent_ops;
view->format = wined3d_get_format(gl_info, desc->format_id);
view->format_flags = view->format->flags;
if (resource->type == WINED3D_RTYPE_BUFFER)
{
view->sub_resource_idx = 0;
......
......@@ -2692,6 +2692,7 @@ struct wined3d_rendertarget_view
const struct wined3d_parent_ops *parent_ops;
const struct wined3d_format *format;
unsigned int format_flags;
unsigned int sub_resource_idx;
unsigned int buffer_offset;
......
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