Commit d6408372 authored by Rob Clark's avatar Rob Clark

gallium: add GREMEDY_string_marker

Since the GREMEDY extensions are normally only exposed by the gremedy
debugger (and could possibly trigger debug paths in the app), we don't
expose the extension by default, but instead only with
ST_DEBUG=gremedy.
Signed-off-by: default avatarRob Clark <robclark@freedesktop.org>
Reviewed-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
parent a6a99fbf
......@@ -305,6 +305,7 @@ The integer capabilities:
for buffers is supported.
* ``PIPE_CAP_GENERATE_MIPMAP``: Indicates whether pipe_context::generate_mipmap
is supported.
* ``PIPE_CAP_STRING_MARKER``: Whether pipe->emit_string_marker() is supported.
.. _pipe_capf:
......
......@@ -164,6 +164,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_TEXTURE_BARRIER:
case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
case PIPE_CAP_COMPUTE:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_SM3:
......
......@@ -261,6 +261,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
......
......@@ -485,6 +485,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_VENDOR_ID:
......
......@@ -310,6 +310,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
}
/* should only get here on unhandled cases */
......
......@@ -183,6 +183,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_VENDOR_ID:
......
......@@ -226,6 +226,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_VENDOR_ID:
......
......@@ -215,6 +215,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_VENDOR_ID:
......
......@@ -209,6 +209,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
/* SWTCL-only features. */
......
......@@ -363,6 +363,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_TGSI_FS_FACE_IS_INTEGER_SYSVAL:
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
......
......@@ -349,6 +349,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
case PIPE_CAP_MULTI_DRAW_INDIRECT_PARAMS:
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
......
......@@ -260,6 +260,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
}
/* should only get here on unhandled cases */
......
......@@ -357,6 +357,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_TGSI_PACK_HALF_FLOAT:
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_STRING_MARKER:
return 0;
case PIPE_CAP_MIN_MAP_BUFFER_ALIGNMENT:
return 64;
......
......@@ -198,6 +198,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
case PIPE_CAP_INVALIDATE_BUFFER:
case PIPE_CAP_GENERATE_MIPMAP:
case PIPE_CAP_STRING_MARKER:
return 0;
/* Stream output. */
......
......@@ -678,6 +678,13 @@ struct pipe_context {
void (*dump_debug_state)(struct pipe_context *ctx, FILE *stream,
unsigned flags);
/**
* Emit string marker in cmdstream
*/
void (*emit_string_marker)(struct pipe_context *ctx,
const char *string,
int len);
/**
* Generate mipmap.
* \return TRUE if mipmap generation succeeds, FALSE otherwise
......
......@@ -644,6 +644,7 @@ enum pipe_cap
PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT,
PIPE_CAP_INVALIDATE_BUFFER,
PIPE_CAP_GENERATE_MIPMAP,
PIPE_CAP_STRING_MARKER,
};
#define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
......
......@@ -438,6 +438,12 @@ void st_destroy_context( struct st_context *st )
free(ctx);
}
static void
st_emit_string_marker(struct gl_context *ctx, const GLchar *string, GLsizei len)
{
struct st_context *st = ctx->st;
st->pipe->emit_string_marker(st->pipe, string, len);
}
void st_init_driver_functions(struct pipe_screen *screen,
struct dd_function_table *functions)
......@@ -476,6 +482,9 @@ void st_init_driver_functions(struct pipe_screen *screen,
st_init_vdpau_functions(functions);
if (screen->get_param(screen, PIPE_CAP_STRING_MARKER))
functions->EmitStringMarker = st_emit_string_marker;
functions->Enable = st_Enable;
functions->UpdateState = st_invalidate_state;
}
......@@ -57,6 +57,7 @@ static const struct debug_named_value st_debug_flags[] = {
{ "buffer", DEBUG_BUFFER, NULL },
{ "wf", DEBUG_WIREFRAME, NULL },
{ "precompile", DEBUG_PRECOMPILE, NULL },
{ "gremedy", DEBUG_GREMEDY, "Enable GREMEDY debug extensions" },
DEBUG_NAMED_VALUE_END
};
......
......@@ -50,6 +50,7 @@ st_print_current(void);
#define DEBUG_BUFFER 0x200
#define DEBUG_WIREFRAME 0x400
#define DEBUG_PRECOMPILE 0x800
#define DEBUG_GREMEDY 0x1000
#ifdef DEBUG
extern int ST_DEBUG;
......
......@@ -37,6 +37,7 @@
#include "util/u_math.h"
#include "st_context.h"
#include "st_debug.h"
#include "st_extensions.h"
#include "st_format.h"
......@@ -973,4 +974,8 @@ void st_init_extensions(struct pipe_screen *screen,
extensions->ARB_gpu_shader_fp64 = GL_TRUE;
extensions->ARB_vertex_attrib_64bit = GL_TRUE;
}
if ((ST_DEBUG & DEBUG_GREMEDY) &&
screen->get_param(screen, PIPE_CAP_STRING_MARKER))
extensions->GREMEDY_string_marker = GL_TRUE;
}
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