mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-10 19:00:13 +01:00
meta: Set some object labels on our meta shaders.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
6152ba0894
commit
0e2c7e2f6e
2 changed files with 14 additions and 0 deletions
|
|
@ -52,6 +52,7 @@
|
|||
#include "main/matrix.h"
|
||||
#include "main/mipmap.h"
|
||||
#include "main/multisample.h"
|
||||
#include "main/objectlabel.h"
|
||||
#include "main/pixel.h"
|
||||
#include "main/pbo.h"
|
||||
#include "main/polygon.h"
|
||||
|
|
@ -178,6 +179,7 @@ _mesa_meta_setup_blit_shader(struct gl_context *ctx,
|
|||
GLuint vs, fs;
|
||||
void *const mem_ctx = ralloc_context(NULL);
|
||||
struct blit_shader *shader = choose_blit_shader(target, table);
|
||||
char *name;
|
||||
|
||||
assert(shader != NULL);
|
||||
|
||||
|
|
@ -253,6 +255,8 @@ _mesa_meta_setup_blit_shader(struct gl_context *ctx,
|
|||
_mesa_BindAttribLocation(shader->shader_prog, 0, "position");
|
||||
_mesa_BindAttribLocation(shader->shader_prog, 1, "texcoords");
|
||||
_mesa_meta_link_program_with_debug(ctx, shader->shader_prog);
|
||||
name = ralloc_asprintf(mem_ctx, "%s blit", shader->type);
|
||||
_mesa_ObjectLabel(GL_PROGRAM, shader->shader_prog, -1, name);
|
||||
ralloc_free(mem_ctx);
|
||||
|
||||
_mesa_UseProgram(shader->shader_prog);
|
||||
|
|
@ -1605,6 +1609,8 @@ meta_glsl_clear_init(struct gl_context *ctx, struct clear_state *clear)
|
|||
* BindFragDataLocation to 0.
|
||||
*/
|
||||
|
||||
_mesa_ObjectLabel(GL_PROGRAM, clear->IntegerShaderProg, -1,
|
||||
"integer clear");
|
||||
_mesa_meta_link_program_with_debug(ctx, clear->IntegerShaderProg);
|
||||
|
||||
clear->IntegerColorLocation =
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "main/macros.h"
|
||||
#include "main/matrix.h"
|
||||
#include "main/multisample.h"
|
||||
#include "main/objectlabel.h"
|
||||
#include "main/readpix.h"
|
||||
#include "main/shaderapi.h"
|
||||
#include "main/texobj.h"
|
||||
|
|
@ -96,6 +97,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
|
|||
bool dst_is_msaa = false;
|
||||
GLenum src_datatype;
|
||||
const char *vec4_prefix;
|
||||
char *name;
|
||||
|
||||
if (src_rb) {
|
||||
src_datatype = _mesa_get_format_datatype(src_rb->Format);
|
||||
|
|
@ -172,6 +174,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
|
|||
if (dst_is_msaa) {
|
||||
arb_sample_shading_extension_string = "#extension GL_ARB_sample_shading : enable";
|
||||
sample_index = "gl_SampleID";
|
||||
name = "depth MSAA copy";
|
||||
} else {
|
||||
/* Don't need that extension, since we're drawing to a single-sampled
|
||||
* destination.
|
||||
|
|
@ -188,6 +191,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
|
|||
* We're slacking and instead of choosing centermost, we've got 0.
|
||||
*/
|
||||
sample_index = "0";
|
||||
name = "depth MSAA resolve";
|
||||
}
|
||||
|
||||
vs_source = ralloc_asprintf(mem_ctx,
|
||||
|
|
@ -222,6 +226,9 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
|
|||
char *sample_resolve;
|
||||
const char *arb_sample_shading_extension_string;
|
||||
const char *merge_function;
|
||||
name = ralloc_asprintf(mem_ctx, "%svec4 MSAA %s",
|
||||
vec4_prefix,
|
||||
dst_is_msaa ? "copy" : "resolve");
|
||||
|
||||
samples = MAX2(src_rb->NumSamples, 1);
|
||||
|
||||
|
|
@ -329,6 +336,7 @@ setup_glsl_msaa_blit_shader(struct gl_context *ctx,
|
|||
_mesa_BindAttribLocation(blit->msaa_shaders[shader_index], 0, "position");
|
||||
_mesa_BindAttribLocation(blit->msaa_shaders[shader_index], 1, "texcoords");
|
||||
_mesa_meta_link_program_with_debug(ctx, blit->msaa_shaders[shader_index]);
|
||||
_mesa_ObjectLabel(GL_PROGRAM, blit->msaa_shaders[shader_index], -1, name);
|
||||
ralloc_free(mem_ctx);
|
||||
|
||||
_mesa_UseProgram(blit->msaa_shaders[shader_index]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue