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

wined3d: Keep track of renderbuffer capabilities.

parent c8d1a708
......@@ -3390,6 +3390,10 @@ static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_i
"TEX R0.x, fragment.texcoord[0], texture[0], RECT;\n"
"MOV result.depth.z, R0.x;\n"
"END\n",
/* WINED3D_GL_RES_TYPE_BUFFER */
NULL,
/* WINED3D_GL_RES_TYPE_RB */
NULL,
};
static const char * const blt_fprograms_masked[WINED3D_GL_RES_TYPE_COUNT] =
......@@ -3428,6 +3432,10 @@ static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_i
"TEX R0.x, fragment.texcoord[0], texture[0], RECT;\n"
"MOV result.depth.z, R0.x;\n"
"END\n",
/* WINED3D_GL_RES_TYPE_BUFFER */
NULL,
/* WINED3D_GL_RES_TYPE_RB */
NULL,
};
fprogram = masked ? blt_fprograms_masked[tex_type] : blt_fprograms_full[tex_type];
......
......@@ -4384,6 +4384,8 @@ static BOOL CheckSurfaceCapability(const struct wined3d_adapter *adapter,
/* All depth stencil formats are supported on surfaces */
if (CheckDepthStencilCapability(adapter, adapter_format, check_format, WINED3D_GL_RES_TYPE_TEX_2D))
return TRUE;
if (CheckDepthStencilCapability(adapter, adapter_format, check_format, WINED3D_GL_RES_TYPE_RB))
return TRUE;
/* If opengl can't process the format natively, the blitter may be able to convert it */
if (adapter->blitter->blit_supported(&adapter->gl_info, &adapter->d3d_info,
......@@ -4456,7 +4458,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad
allowed_usage = WINED3DUSAGE_DEPTHSTENCIL
| WINED3DUSAGE_RENDERTARGET
| WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING;
gl_type = WINED3D_GL_RES_TYPE_TEX_2D;
gl_type = WINED3D_GL_RES_TYPE_RB;
break;
case WINED3D_RTYPE_TEXTURE:
......
......@@ -6997,6 +6997,10 @@ static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum
"{\n"
" gl_FragDepth = texture2DRect(sampler, gl_TexCoord[0].xy).x;\n"
"}\n",
/* WINED3D_GL_RES_TYPE_BUFFER */
NULL,
/* WINED3D_GL_RES_TYPE_RB */
NULL,
};
static const char * const blt_pshaders_masked[WINED3D_GL_RES_TYPE_COUNT] =
......@@ -7033,6 +7037,10 @@ static GLuint create_glsl_blt_shader(const struct wined3d_gl_info *gl_info, enum
" if (all(lessThan(gl_FragCoord.xy, mask.zw))) discard;\n"
" gl_FragDepth = texture2DRect(sampler, gl_TexCoord[0].xy).x;\n"
"}\n",
/* WINED3D_GL_RES_TYPE_BUFFER */
NULL,
/* WINED3D_GL_RES_TYPE_RB */
NULL,
};
blt_pshader = masked ? blt_pshaders_masked[tex_type] : blt_pshaders_full[tex_type];
......
......@@ -80,13 +80,13 @@ HRESULT resource_init(struct wined3d_resource *resource, struct wined3d_device *
{
const struct wined3d *d3d = device->wined3d;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
static const enum wined3d_gl_resource_type gl_resource_types[][3] =
static const enum wined3d_gl_resource_type gl_resource_types[][4] =
{
/* 0 */ {WINED3D_GL_RES_TYPE_COUNT},
/* WINED3D_RTYPE_SURFACE */ {WINED3D_GL_RES_TYPE_COUNT},
/* WINED3D_RTYPE_VOLUME */ {WINED3D_GL_RES_TYPE_COUNT},
/* WINED3D_RTYPE_TEXTURE */ {WINED3D_GL_RES_TYPE_TEX_2D,
WINED3D_GL_RES_TYPE_TEX_RECT, WINED3D_GL_RES_TYPE_COUNT},
WINED3D_GL_RES_TYPE_TEX_RECT, WINED3D_GL_RES_TYPE_RB, WINED3D_GL_RES_TYPE_COUNT},
/* WINED3D_RTYPE_VOLUME_TEXTURE */ {WINED3D_GL_RES_TYPE_TEX_3D, WINED3D_GL_RES_TYPE_COUNT},
/* WINED3D_RTYPE_CUBE_TEXTURE */ {WINED3D_GL_RES_TYPE_TEX_CUBE, WINED3D_GL_RES_TYPE_COUNT},
/* WINED3D_RTYPE_BUFFER */ {WINED3D_GL_RES_TYPE_BUFFER, WINED3D_GL_RES_TYPE_COUNT},
......
......@@ -786,7 +786,8 @@ enum wined3d_gl_resource_type
WINED3D_GL_RES_TYPE_TEX_CUBE = 3,
WINED3D_GL_RES_TYPE_TEX_RECT = 4,
WINED3D_GL_RES_TYPE_BUFFER = 5,
WINED3D_GL_RES_TYPE_COUNT = 6,
WINED3D_GL_RES_TYPE_RB = 6,
WINED3D_GL_RES_TYPE_COUNT = 7,
};
enum vertexprocessing_mode {
......
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