Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/buffer.c | 7 +++++-- dlls/wined3d/utils.c | 21 +++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index e20d66cc88..e7b05157cc 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1445,8 +1445,11 @@ HRESULT CDECL wined3d_buffer_create(struct wined3d_device *device, const struct struct wined3d_buffer *object; HRESULT hr;
- TRACE("device %p, desc %p, data %p, parent %p, parent_ops %p, buffer %p.\n", - device, desc, data, parent, parent_ops, buffer); + TRACE("device %p, desc byte_width %u, usage %s, bind_flags %s, access %s, data %p, parent %p, " + "parent_ops %p, buffer %p.\n", + device, desc->byte_width, debug_d3dusage(desc->usage), + wined3d_debug_bind_flags(desc->bind_flags), wined3d_debug_resource_access(desc->access), + data, parent, parent_ops, buffer);
if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index e3df24ade4..d62578bf9f 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4447,6 +4447,27 @@ const char *wined3d_debug_resource_access(DWORD access) return wine_dbg_sprintf("%s", buffer.str); }
+const char *wined3d_debug_bind_flags(DWORD bind_flags) +{ + struct debug_buffer buffer; + + init_debug_buffer(&buffer, "0"); +#define BIND_FLAG_TO_STR(x) if (bind_flags & x) { debug_append(&buffer, #x, " | "); bind_flags &= ~x; } + BIND_FLAG_TO_STR(WINED3D_BIND_VERTEX_BUFFER); + BIND_FLAG_TO_STR(WINED3D_BIND_INDEX_BUFFER); + BIND_FLAG_TO_STR(WINED3D_BIND_CONSTANT_BUFFER); + BIND_FLAG_TO_STR(WINED3D_BIND_SHADER_RESOURCE); + BIND_FLAG_TO_STR(WINED3D_BIND_STREAM_OUTPUT); + BIND_FLAG_TO_STR(WINED3D_BIND_RENDER_TARGET); + BIND_FLAG_TO_STR(WINED3D_BIND_DEPTH_STENCIL); + BIND_FLAG_TO_STR(WINED3D_BIND_UNORDERED_ACCESS); +#undef BIND_FLAG_TO_STR + if (bind_flags) + FIXME("Unrecognised bind flag(s) %#x.\n", bind_flags); + + return wine_dbg_sprintf("%s", buffer.str); +} + const char *debug_d3dusage(DWORD usage) { struct debug_buffer buffer; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 19945cf30e..dbab1aaf76 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3064,6 +3064,7 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD sta }
const char *wined3d_debug_resource_access(DWORD access) DECLSPEC_HIDDEN; +const char *wined3d_debug_bind_flags(DWORD bind_flags) DECLSPEC_HIDDEN;
static inline BOOL wined3d_resource_access_is_managed(unsigned int access) {
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/utils.c | 25 +++++++++++++++++++++++++ dlls/wined3d/view.c | 12 ++++++------ dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index d62578bf9f..da01bbb0b6 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -4468,6 +4468,31 @@ const char *wined3d_debug_bind_flags(DWORD bind_flags) return wine_dbg_sprintf("%s", buffer.str); }
+const char *wined3d_debug_view_desc(const struct wined3d_view_desc *d, const struct wined3d_resource *resource) +{ + struct debug_buffer buffer; + unsigned int flags = d->flags; + + init_debug_buffer(&buffer, "0"); +#define VIEW_FLAG_TO_STR(x) if (flags & x) { debug_append(&buffer, #x, " | "); flags &= ~x; } + VIEW_FLAG_TO_STR(WINED3D_VIEW_BUFFER_RAW); + VIEW_FLAG_TO_STR(WINED3D_VIEW_BUFFER_APPEND); + VIEW_FLAG_TO_STR(WINED3D_VIEW_BUFFER_COUNTER); + VIEW_FLAG_TO_STR(WINED3D_VIEW_TEXTURE_CUBE); + VIEW_FLAG_TO_STR(WINED3D_VIEW_TEXTURE_ARRAY); +#undef VIEW_FLAG_TO_STR + if (flags) + FIXME("Unrecognised view flag(s) %#x.\n", flags); + + if (resource->type == WINED3D_RTYPE_BUFFER) + return wine_dbg_sprintf("format %s, flags %s, start_idx %u, count %u", + debug_d3dformat(d->format_id), buffer.str, d->u.buffer.start_idx, d->u.buffer.count); + else + return wine_dbg_sprintf("format %s, flags %s, level_idx %u, level_count %u, layer_idx %u, layer_count %u", + debug_d3dformat(d->format_id), buffer.str, d->u.texture.level_idx, d->u.texture.level_count, + d->u.texture.layer_idx, d->u.texture.layer_count); +} + const char *debug_d3dusage(DWORD usage) { struct debug_buffer buffer; diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index b8a3568d7e..3662250538 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -620,8 +620,8 @@ HRESULT CDECL wined3d_rendertarget_view_create(const struct wined3d_view_desc *d struct wined3d_rendertarget_view *object; HRESULT hr;
- TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n", - desc, resource, parent, parent_ops, view); + TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n", + wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY; @@ -799,8 +799,8 @@ HRESULT CDECL wined3d_shader_resource_view_create(const struct wined3d_view_desc struct wined3d_shader_resource_view *object; HRESULT hr;
- TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n", - desc, resource, parent, parent_ops, view); + TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n", + wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY; @@ -1167,8 +1167,8 @@ HRESULT CDECL wined3d_unordered_access_view_create(const struct wined3d_view_des struct wined3d_unordered_access_view *object; HRESULT hr;
- TRACE("desc %p, resource %p, parent %p, parent_ops %p, view %p.\n", - desc, resource, parent, parent_ops, view); + TRACE("desc %s, resource %p, parent %p, parent_ops %p, view %p.\n", + wined3d_debug_view_desc(desc, resource), resource, parent, parent_ops, view);
if (!(object = heap_alloc_zero(sizeof(*object)))) return E_OUTOFMEMORY; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index dbab1aaf76..c3761860b0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3065,6 +3065,8 @@ static inline BOOL isStateDirty(const struct wined3d_context *context, DWORD sta
const char *wined3d_debug_resource_access(DWORD access) DECLSPEC_HIDDEN; const char *wined3d_debug_bind_flags(DWORD bind_flags) DECLSPEC_HIDDEN; +const char *wined3d_debug_view_desc(const struct wined3d_view_desc *d, + const struct wined3d_resource *resource) DECLSPEC_HIDDEN;
static inline BOOL wined3d_resource_access_is_managed(unsigned int access) {
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/view.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c index 3662250538..7bb8b81c0d 100644 --- a/dlls/wined3d/view.c +++ b/dlls/wined3d/view.c @@ -234,6 +234,9 @@ static void create_texture_view(struct wined3d_gl_view *view, GLenum view_target wined3d_gl_texture_swizzle_from_color_fixup(swizzle, view_format->color_fixup); gl_info->gl_ops.gl.p_glTexParameteriv(view->target, GL_TEXTURE_SWIZZLE_RGBA, swizzle); checkGLcall("set format swizzle"); + + context_invalidate_compute_state(context, STATE_COMPUTE_SHADER_RESOURCE_BINDING); + context_invalidate_state(context, STATE_GRAPHICS_SHADER_RESOURCE_BINDING); }
context_release(context);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/wined3d/adapter_gl.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 16a26b88ba..cedfe239bc 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -184,6 +184,7 @@ static const struct wined3d_extension_map gl_extension_map[] = {"GL_EXT_packed_depth_stencil", EXT_PACKED_DEPTH_STENCIL }, {"GL_EXT_packed_float", EXT_PACKED_FLOAT }, {"GL_EXT_point_parameters", EXT_POINT_PARAMETERS }, + {"GL_EXT_polygon_offset_clamp", ARB_POLYGON_OFFSET_CLAMP }, {"GL_EXT_provoking_vertex", EXT_PROVOKING_VERTEX }, {"GL_EXT_secondary_color", EXT_SECONDARY_COLOR }, {"GL_EXT_stencil_two_side", EXT_STENCIL_TWO_SIDE }, @@ -2481,6 +2482,8 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) /* GL_EXT_point_parameters */ USE_GL_FUNC(glPointParameterfEXT) USE_GL_FUNC(glPointParameterfvEXT) + /* GL_EXT_polgyon_offset_clamp */ + USE_GL_FUNC(glPolygonOffsetClampEXT) /* GL_EXT_provoking_vertex */ USE_GL_FUNC(glProvokingVertexEXT) /* GL_EXT_secondary_color */ @@ -2774,6 +2777,7 @@ static void load_gl_funcs(struct wined3d_gl_info *gl_info) MAP_GL_FUNCTION(glLinkProgram, glLinkProgramARB); MAP_GL_FUNCTION(glMapBuffer, glMapBufferARB); MAP_GL_FUNCTION(glMinSampleShading, glMinSampleShadingARB); + MAP_GL_FUNCTION(glPolygonOffsetClamp, glPolygonOffsetClampEXT); MAP_GL_FUNCTION_CAST(glShaderSource, glShaderSourceARB); MAP_GL_FUNCTION(glTexBuffer, glTexBufferARB); MAP_GL_FUNCTION_CAST(glTexImage3D, glTexImage3DEXT);
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- It's deprecated in core profile and removed in forward-compatible contexts, although the spec suggests that it has a use still: "Additionally, when linking a program containing only a vertex and fragment shader, there is a limit on the total number of components used as vertex shader outputs or fragment shader inputs. This limit is given by the value of the implementation-dependent constant MAX_VARYING_COMPONENTS."
Nvidia binary drivers on a GTX 970 report 128 for all the GL_MAX_*_{INPUT|OUTPUT}_COMPONENTS but only 124 for GL_MAX_VARYING_FLOATS_ARB. Actually that is correct since GL_MAX_VARYING_FLOATS_ARB DOESN'T include gl_Position (see the same area of the spec as above).
Mesa (r600g at least) does return 128 for GL_MAX_VARYING_FLOATS_ARB, which means glsl_varyings will go down by 1 there. It shouldn't make any practical difference for us though.
dlls/wined3d/adapter_gl.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index cedfe239bc..99df19cc31 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -3079,9 +3079,18 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max); gl_info->limits.glsl_ps_float_constants = gl_max / 4; TRACE("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants); - gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max); - gl_info->limits.glsl_varyings = gl_max; - TRACE("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_max, gl_max / 4); + if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]) + { + gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max); + gl_info->limits.glsl_varyings = gl_max; + } + else + { + gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &gl_max); + gl_info->limits.glsl_varyings = gl_max - 4; + } + TRACE("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_info->limits.glsl_varyings, + gl_info->limits.glsl_varyings / 4);
if (gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT]) {
Signed-off-by: Henri Verbeet hverbeet@codeweavers.com