Author: khornicek
Date: Fri Sep 4 11:38:44 2009
New Revision: 42991
URL:
http://svn.reactos.org/svn/reactos?rev=42991&view=rev
Log:
- update wined3d to Wine 1.1.29
- reapply our hack for releasing fake GL context, fixes bug 4836
See issue #4836 for more details.
Modified:
trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c
trunk/reactos/dll/directx/wine/wined3d/directx.c
Modified: trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/a…
==============================================================================
--- trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/wined3d/arb_program_shader.c [iso-8859-1] Fri Sep 4
11:38:44 2009
@@ -2994,6 +2994,8 @@
static GLuint create_arb_blt_vertex_program(const struct wined3d_gl_info *gl_info)
{
GLuint program_id = 0;
+ GLint pos;
+
const char *blt_vprogram =
"!!ARBvp1.0\n"
"PARAM c[1] = { { 1, 0.5 } };\n"
@@ -3004,14 +3006,24 @@
GL_EXTCALL(glGenProgramsARB(1, &program_id));
GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, program_id));
- GL_EXTCALL(glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
strlen(blt_vprogram), blt_vprogram));
-
- if (glGetError() == GL_INVALID_OPERATION) {
- GLint pos;
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ GL_EXTCALL(glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(blt_vprogram), blt_vprogram));
+ checkGLcall("glProgramStringARB()");
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ if (pos != -1)
+ {
FIXME("Vertex program error at position %d: %s\n", pos,
debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
}
+ else
+ {
+ GLint native;
+
+ GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native));
+ checkGLcall("glGetProgramivARB()");
+ if (!native) WARN("Program exceeds native resource limits.\n");
+ }
return program_id;
}
@@ -3020,6 +3032,8 @@
static GLuint create_arb_blt_fragment_program(const struct wined3d_gl_info *gl_info, enum
tex_types tex_type)
{
GLuint program_id = 0;
+ GLint pos;
+
static const char * const blt_fprograms[tex_type_count] =
{
/* tex_1d */
@@ -3054,13 +3068,23 @@
GL_EXTCALL(glGenProgramsARB(1, &program_id));
GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, program_id));
- GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
strlen(blt_fprograms[tex_type]), blt_fprograms[tex_type]));
-
- if (glGetError() == GL_INVALID_OPERATION) {
- GLint pos;
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(blt_fprograms[tex_type]), blt_fprograms[tex_type]));
+ checkGLcall("glProgramStringARB()");
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ if (pos != -1)
+ {
FIXME("Fragment program error at position %d: %s\n", pos,
debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
+ }
+ else
+ {
+ GLint native;
+
+ GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native));
+ checkGLcall("glGetProgramivARB()");
+ if (!native) WARN("Program exceeds native resource limits.\n");
}
return program_id;
@@ -3214,6 +3238,7 @@
BOOL dcl_tmp = args->super.srgb_correction, dcl_td = FALSE;
BOOL want_nv_prog = FALSE;
struct arb_pshader_private *shader_priv = This->backend_priv;
+ GLint errPos;
DWORD map;
char srgbtmp[4][4];
@@ -3497,13 +3522,22 @@
/* Create the program and check for errors */
GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
buffer->bsize, buffer->buffer));
-
- if (glGetError() == GL_INVALID_OPERATION) {
- GLint errPos;
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
+ checkGLcall("glProgramStringARB()");
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
+ if (errPos != -1)
+ {
FIXME("HW PixelShader Error at position %d: %s\n",
errPos, debugstr_a((const char
*)glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
retval = 0;
+ }
+ else
+ {
+ GLint native;
+
+ GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native));
+ checkGLcall("glGetProgramivARB()");
+ if (!native) WARN("Program exceeds native resource limits.\n");
}
/* Load immediate constants */
@@ -3781,6 +3815,7 @@
DWORD next_local, *lconst_map = local_const_mapping((IWineD3DBaseShaderImpl *)
This);
struct shader_arb_ctx_priv priv_ctx;
unsigned int i;
+ GLint errPos;
memset(&priv_ctx, 0, sizeof(priv_ctx));
priv_ctx.cur_vs_args = args;
@@ -3890,14 +3925,23 @@
/* Create the program and check for errors */
GL_EXTCALL(glProgramStringARB(GL_VERTEX_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
buffer->bsize, buffer->buffer));
-
- if (glGetError() == GL_INVALID_OPERATION) {
- GLint errPos;
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
+ checkGLcall("glProgramStringARB()");
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errPos);
+ if (errPos != -1)
+ {
FIXME("HW VertexShader Error at position %d: %s\n",
errPos, debugstr_a((const char
*)glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
ret = -1;
- } else {
+ }
+ else
+ {
+ GLint native;
+
+ GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native));
+ checkGLcall("glGetProgramivARB()");
+ if (!native) WARN("Program exceeds native resource limits.\n");
+
/* Load immediate constants */
if(lconst_map) {
LIST_FOR_EACH_ENTRY(lconst, &This->baseShader.constantsF,
local_constant, entry) {
@@ -5486,6 +5530,7 @@
BOOL tempreg_used = FALSE, tfactor_used = FALSE;
BOOL op_equal;
const char *final_combiner_src = "ret";
+ GLint pos;
/* Find out which textures are read */
for(stage = 0; stage < MAX_TEXTURES; stage++) {
@@ -5719,14 +5764,25 @@
/* Generate the shader */
GL_EXTCALL(glGenProgramsARB(1, &ret));
GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, ret));
- GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
strlen(buffer.buffer), buffer.buffer));
-
- if (glGetError() == GL_INVALID_OPERATION) {
- GLint pos;
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(buffer.buffer), buffer.buffer));
+ checkGLcall("glProgramStringARB()");
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ if (pos != -1)
+ {
FIXME("Fragment program error at position %d: %s\n", pos,
debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
}
+ else
+ {
+ GLint native;
+
+ GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native));
+ checkGLcall("glGetProgramivARB()");
+ if (!native) WARN("Program exceeds native resource limits.\n");
+ }
+
shader_buffer_free(&buffer);
return ret;
}
@@ -6305,6 +6361,7 @@
struct wined3d_shader_buffer buffer;
char luminance_component;
struct arbfp_blit_priv *priv = device->blit_priv;
+ GLint pos;
/* Shader header */
if (!shader_buffer_init(&buffer))
@@ -6407,14 +6464,25 @@
shader_addline(&buffer, "END\n");
ENTER_GL();
- GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
strlen(buffer.buffer), buffer.buffer));
-
- if (glGetError() == GL_INVALID_OPERATION) {
- GLint pos;
- glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ GL_EXTCALL(glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB,
+ strlen(buffer.buffer), buffer.buffer));
+ checkGLcall("glProgramStringARB()");
+
+ glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
+ if (pos != -1)
+ {
FIXME("Fragment program error at position %d: %s\n", pos,
debugstr_a((const char *)glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
}
+ else
+ {
+ GLint native;
+
+ GL_EXTCALL(glGetProgramivARB(GL_FRAGMENT_PROGRAM_ARB,
GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB, &native));
+ checkGLcall("glGetProgramivARB()");
+ if (!native) WARN("Program exceeds native resource limits.\n");
+ }
+
shader_buffer_free(&buffer);
LEAVE_GL();
Modified: trunk/reactos/dll/directx/wine/wined3d/directx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/wine/wined3d/d…
==============================================================================
--- trunk/reactos/dll/directx/wine/wined3d/directx.c [iso-8859-1] (original)
+++ trunk/reactos/dll/directx/wine/wined3d/directx.c [iso-8859-1] Fri Sep 4 11:38:44
2009
@@ -235,13 +235,13 @@
{
ERR_(d3d_caps)("Failed to disable fake GL context.\n");
}
-
+#if 0
if (!pwglDeleteContext(ctx->gl_ctx))
{
DWORD err = GetLastError();
ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx->gl_ctx,
err);
}
-
+#endif
ReleaseDC(ctx->wnd, ctx->dc);
DestroyWindow(ctx->wnd);
}
@@ -1481,6 +1481,7 @@
TRACE_(d3d_caps)("GL_RENDERER: %s.\n", debugstr_a(gl_string));
if (!gl_string)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_RENDERER.\n");
return FALSE;
}
@@ -1489,6 +1490,7 @@
gl_renderer = HeapAlloc(GetProcessHeap(), 0, len);
if (!gl_renderer)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Failed to allocate gl_renderer memory.\n");
return FALSE;
}
@@ -1498,6 +1500,7 @@
TRACE_(d3d_caps)("GL_VENDOR: %s.\n", debugstr_a(gl_string));
if (!gl_string)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_VENDOR.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE;
@@ -1510,6 +1513,7 @@
TRACE_(d3d_caps)("GL_VERSION: %s.\n", debugstr_a(gl_string));
if (!gl_string)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_VERSION.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE;
@@ -1560,10 +1564,13 @@
GL_Extensions = (const char *)glGetString(GL_EXTENSIONS);
if (!GL_Extensions)
{
+ LEAVE_GL();
ERR_(d3d_caps)("Received a NULL GL_EXTENSIONS.\n");
HeapFree(GetProcessHeap(), 0, gl_renderer);
return FALSE;
}
+
+ LEAVE_GL();
TRACE_(d3d_caps)("GL_Extensions reported:\n");
@@ -1595,8 +1602,6 @@
}
}
}
-
- LEAVE_GL();
/* Now work out what GL support this card really has */
#define USE_GL_FUNC(type, pfn, ext, replace) \