From 9d49802b7a3a1e292965098da41c459fabf84cc4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Feb 2009 08:25:57 -0700 Subject: glsl: silence some uninit var warnings --- src/mesa/shader/slang/slang_codegen.c | 2 +- src/mesa/shader/slang/slang_compile.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 11340d26e2..cfdb868d6c 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3662,7 +3662,7 @@ _slang_gen_assignment(slang_assemble_ctx * A, slang_operation *oper) if (lhs && rhs) { /* convert lhs swizzle into writemask */ const GLuint swizzle = root_swizzle(lhs->Store); - GLuint writemask, newSwizzle; + GLuint writemask, newSwizzle = 0x0; if (!swizzle_to_writemask(A, swizzle, &writemask, &newSwizzle)) { /* Non-simple writemask, need to swizzle right hand side in * order to put components into the right place. diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index cfed977905..ab848579b7 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -1450,7 +1450,7 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O, case OP_CALL: { GLboolean array_constructor = GL_FALSE; - GLint array_constructor_size; + GLint array_constructor_size = 0; op->type = SLANG_OPER_CALL; op->a_id = parse_identifier(C); -- cgit v1.2.3 From c5c383596ddb26cd75e4b355918ad16915283b59 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Feb 2009 11:50:05 -0700 Subject: mesa: remove old comments Note: the default value for EmitCondCodes is FALSE. This means the GLSL compiler will emit code like this: SEQ TEMP[0].x, A, B; IF TEMP[0].x; ... ENDIF But if EmitCondCodes is TRUE, condition codes will be used instead: SEQ.C TEMP[0].x, A, B; IF (NE.xxxx); ... ENDIF --- src/mesa/shader/shader_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 013e912e5d..38f4cd03c4 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -406,7 +406,7 @@ _mesa_init_shader_state(GLcontext * ctx) * are generated by the GLSL compiler. */ ctx->Shader.EmitHighLevelInstructions = GL_TRUE; - ctx->Shader.EmitCondCodes = GL_FALSE;/*GL_TRUE;*/ /* XXX probably want GL_FALSE... */ + ctx->Shader.EmitCondCodes = GL_FALSE; ctx->Shader.EmitComments = GL_FALSE; ctx->Shader.Flags = get_shader_flags(); } -- cgit v1.2.3 From f88a9015985f1e308496803630221f284a94f397 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Feb 2009 15:57:00 -0700 Subject: mesa: when printing/dumping instruction, include relative addressing info Not all cases were handled before. --- src/mesa/shader/prog_print.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index ce48767a87..516ea73301 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -212,15 +212,13 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, GLboolean relAddr, const struct gl_program *prog) { static char str[100]; + const char *addr = relAddr ? "ADDR+" : ""; str[0] = 0; switch (mode) { case PROG_PRINT_DEBUG: - if (relAddr) - _mesa_sprintf(str, "%s[ADDR+%d]", file_string(f, mode), index); - else - _mesa_sprintf(str, "%s[%d]", file_string(f, mode), index); + _mesa_sprintf(str, "%s[%s%d]", file_string(f, mode), addr, index); break; case PROG_PRINT_ARB: @@ -235,19 +233,19 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, _mesa_sprintf(str, "temp%d", index); break; case PROGRAM_ENV_PARAM: - _mesa_sprintf(str, "program.env[%d]", index); + _mesa_sprintf(str, "program.env[%s%d]", addr, index); break; case PROGRAM_LOCAL_PARAM: - _mesa_sprintf(str, "program.local[%d]", index); + _mesa_sprintf(str, "program.local[%s%d]", addr, index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%d]", index); + _mesa_sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%d]", index); + _mesa_sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%d]", index); + _mesa_sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: { @@ -284,16 +282,16 @@ reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, _mesa_sprintf(str, "c[%d]", index); break; case PROGRAM_VARYING: /* extension */ - _mesa_sprintf(str, "varying[%d]", index); + _mesa_sprintf(str, "varying[%s%d]", addr, index); break; case PROGRAM_UNIFORM: /* extension */ - _mesa_sprintf(str, "uniform[%d]", index); + _mesa_sprintf(str, "uniform[%s%d]", addr, index); break; case PROGRAM_CONSTANT: /* extension */ - _mesa_sprintf(str, "constant[%d]", index); + _mesa_sprintf(str, "constant[%s%d]", addr, index); break; case PROGRAM_STATE_VAR: /* extension */ - _mesa_sprintf(str, "state[%d]", index); + _mesa_sprintf(str, "state[%s%d]", addr, index); break; default: _mesa_problem(NULL, "bad file in reg_string()"); -- cgit v1.2.3 From 6eabfc27f19a10dfc2663e99f9560966ba1ff697 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Feb 2009 16:10:32 -0700 Subject: glsl: fix an array indexing bug This fixes a bug found with swizzled array indexes such as in "array[index.z]" where "index" is an ivec4. --- src/mesa/shader/slang/slang_emit.c | 53 +++++++++++++++++++++++++++++++------- 1 file changed, 43 insertions(+), 10 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 2dd122c9a5..8eed1e3e9c 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -451,7 +451,7 @@ emit_arl_load(slang_emit_info *emitInfo, struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL); inst->SrcReg[0].File = file; inst->SrcReg[0].Index = index; - inst->SrcReg[0].Swizzle = swizzle; + inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); inst->DstReg.File = PROGRAM_ADDRESS; inst->DstReg.Index = 0; inst->DstReg.WriteMask = WRITEMASK_X; @@ -873,6 +873,7 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) if (n->Children[0]->Store->Size != n->Children[1]->Store->Size) { slang_info_log_error(emitInfo->log, "invalid operands to == or !="); + n->Store = NULL; return NULL; } @@ -902,6 +903,7 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) slang_ir_storage tempStore; if (!alloc_local_temp(emitInfo, &tempStore, 4)) { + n->Store = NULL; return NULL; /* out of temps */ } @@ -1813,6 +1815,25 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) } +/** + * Return the size of a swizzle mask given that some swizzle components + * may be NIL/undefined. For example: + * swizzle_size(".zzxx") = 4 + * swizzle_size(".xy??") = 2 + * swizzle_size(".xyz?") = 1 + */ +static GLuint +swizzle_size(GLuint swizzle) +{ + GLuint i; + for (i = 0; i < 4; i++) { + if (GET_SWZ(swizzle, i) == SWIZZLE_NIL) + return i; + } + return 4; +} + + static struct prog_instruction * emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n) { @@ -1820,14 +1841,24 @@ emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n) inst = emit(emitInfo, n->Children[0]); -#if 0 - assert(n->Store->Parent); - /* Apply this node's swizzle to parent's storage */ - GLuint swizzle = n->Store->Swizzle; - _slang_copy_ir_storage(n->Store, n->Store->Parent); - n->Store->Swizzle = _slang_swizzle_swizzle(n->Store->Swizzle, swizzle); - assert(!n->Store->Parent); -#endif + if (n->Children[0]->Opcode == IR_VAR || + n->Children[0]->Opcode == IR_SWIZZLE || + n->Children[0]->Opcode == IR_ELEMENT) { + /* We can resolve the swizzle now. Other swizzles will be resolved + * in storage_to_src_reg(). + */ + const GLuint swizzle = n->Store->Swizzle; + assert(n->Store->Parent); + /* new storage is parent storage with updated Swizzle + Size fields */ + _slang_copy_ir_storage(n->Store, n->Store->Parent); + /* Apply this node's swizzle to parent's storage */ + n->Store->Swizzle = _slang_swizzle_swizzle(n->Store->Swizzle, swizzle); + /* Update size */ + n->Store->Size = swizzle_size(n->Store->Swizzle); + assert(!n->Store->Parent); + assert(n->Store->Index >= 0); + } + return inst; } @@ -2428,7 +2459,9 @@ _slang_emit_code(slang_ir_node *n, slang_var_table *vt, maxUniforms = ctx->Const.VertexProgram.MaxUniformComponents / 4; } if (prog->Parameters->NumParameters > maxUniforms) { - slang_info_log_error(log, "Constant/uniform register limit exceeded"); + slang_info_log_error(log, "Constant/uniform register limit exceeded " + "(max=%u vec4)", maxUniforms); + return GL_FALSE; } -- cgit v1.2.3 From be8dd0167884b3e135369d0c1b554c3965aedd9d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Feb 2009 16:31:59 -0700 Subject: glsl: fix mistake in a comment --- src/mesa/shader/slang/slang_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 8eed1e3e9c..ac01462bd5 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1820,7 +1820,7 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) * may be NIL/undefined. For example: * swizzle_size(".zzxx") = 4 * swizzle_size(".xy??") = 2 - * swizzle_size(".xyz?") = 1 + * swizzle_size(".w???") = 1 */ static GLuint swizzle_size(GLuint swizzle) -- cgit v1.2.3 From 212f41b80fe00a8d44d79f2c8e4018836adb8b86 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Feb 2009 11:06:57 -0700 Subject: glsl: fix a swizzle-related regression This new issue was exposed by commit 6eabfc27f19a10dfc2663e99f9560966ba1ff697 --- src/mesa/shader/slang/slang_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index ac01462bd5..feff1b7474 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -164,7 +164,7 @@ _slang_var_swizzle(GLint size, GLint comp) { switch (size) { case 1: - return MAKE_SWIZZLE4(comp, comp, comp, comp); + return MAKE_SWIZZLE4(comp, SWIZZLE_NIL, SWIZZLE_NIL, SWIZZLE_NIL); case 2: return MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_NIL, SWIZZLE_NIL); case 3: -- cgit v1.2.3 From 5b2f8dc01300058d43d8043aa897722f39657e93 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Feb 2009 11:47:40 -0700 Subject: mesa: increase MAX_UNIFORMS to 1024 (of vec4 type) Old limit was 256. Note that no arrays are declared to this size. The only place we have to be careful about raising this limit is the prog_src/dst_register Index bitfields. These have been bumped up too. Added assertions to check we don't exceed the bitfield in the future too. --- src/mesa/shader/prog_instruction.h | 16 ++++++++++++---- src/mesa/shader/program.c | 9 +++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index c649b3db5e..48e7b04c98 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -239,13 +239,22 @@ typedef enum prog_opcode { } gl_inst_opcode; +/** + * Number of bits for the src/dst register Index field. + * This limits the size of temp/uniform register files. + */ +#define INST_INDEX_BITS 10 + + /** * Instruction source register. */ struct prog_src_register { GLuint File:4; /**< One of the PROGRAM_* register file values. */ - GLint Index:9; /**< May be negative for relative addressing. */ + GLint Index:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit. + * May be negative for relative addressing. + */ GLuint Swizzle:12; GLuint RelAddr:1; @@ -289,7 +298,7 @@ struct prog_src_register struct prog_dst_register { GLuint File:4; /**< One of the PROGRAM_* register file values */ - GLuint Index:8; + GLuint Index:INST_INDEX_BITS; /**< Unsigned, never negative */ GLuint WriteMask:4; GLuint RelAddr:1; @@ -322,8 +331,7 @@ struct prog_dst_register */ GLuint CondSrc:1; /*@}*/ - - GLuint pad:30; + GLuint pad:28; }; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 7a3b827352..00655f0288 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -53,6 +53,15 @@ _mesa_init_program(GLcontext *ctx) { GLuint i; + /* + * If this assertion fails, we need to increase the field + * size for register indexes. + */ + ASSERT(ctx->Const.VertexProgram.MaxUniformComponents / 4 + <= (1 << INST_INDEX_BITS)); + ASSERT(ctx->Const.FragmentProgram.MaxUniformComponents / 4 + <= (1 << INST_INDEX_BITS)); + ctx->Program.ErrorPos = -1; ctx->Program.ErrorString = _mesa_strdup(""); -- cgit v1.2.3 From 621c999d823eed077aee9ac0779077ba2f0c5e5a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Feb 2009 13:28:12 -0700 Subject: mesa: improved error msg --- src/mesa/shader/shader_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 38f4cd03c4..828d3f062a 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1469,7 +1469,8 @@ _mesa_use_program(GLcontext *ctx, GLuint program) return; } if (!shProg->LinkStatus) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgram"); + _mesa_error(ctx, GL_INVALID_OPERATION, + "glUseProgram(program %u not linked)", program); return; } } -- cgit v1.2.3 From dac19f17f360b730a0e6d651ef2e5b03c59b9b53 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Feb 2009 14:24:14 -0700 Subject: glsl: fix link failure for variable-indexed varying output arrays If the vertex shader writes to a varying array with a variable index, mark all the elements of that array as being written. For example, if the vertex shader does: for (i = 0; i < 4; i++) gl_TexCoord[i] = expr; Mark all texcoord outputs as being written, not just the first. Linking will fail if a fragment shader tries to read an input that's not written by the vertex shader. Before this fix, this linker test could fail. --- src/mesa/shader/slang/slang_link.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 99f2cbdcc0..152e97a668 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -495,8 +495,33 @@ _slang_update_inputs_outputs(struct gl_program *prog) maxAddrReg = MAX2(maxAddrReg, (GLuint) (inst->SrcReg[j].Index + 1)); } } + if (inst->DstReg.File == PROGRAM_OUTPUT) { prog->OutputsWritten |= 1 << inst->DstReg.Index; + if (inst->DstReg.RelAddr) { + /* If the output attribute is indexed with relative addressing + * we know that it must be a varying or texcoord such as + * gl_TexCoord[i] = v; In this case, mark all the texcoords + * or varying outputs as being written. It's not an error if + * a vertex shader writes varying vars that aren't used by the + * fragment shader. But it is an error for a fragment shader + * to use varyings that are not written by the vertex shader. + */ + if (prog->Target == GL_VERTEX_PROGRAM_ARB) { + if (inst->DstReg.Index == VERT_RESULT_TEX0) { + /* mark all texcoord outputs as written */ + const GLbitfield mask = + ((1 << MAX_TEXTURE_COORD_UNITS) - 1) << VERT_RESULT_TEX0; + prog->OutputsWritten |= mask; + } + else if (inst->DstReg.Index == VERT_RESULT_VAR0) { + /* mark all generic varying outputs as written */ + const GLbitfield mask = + ((1 << MAX_VARYING) - 1) << VERT_RESULT_VAR0; + prog->OutputsWritten |= mask; + } + } + } } else if (inst->DstReg.File == PROGRAM_ADDRESS) { maxAddrReg = MAX2(maxAddrReg, inst->DstReg.Index + 1); -- cgit v1.2.3 From b9d8f717d299c388c0dd238d6315e5becd120406 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Feb 2009 17:40:44 -0700 Subject: glsl: fix inequality in set_program_uniform() We were off by one when checking for too many uniform values. --- src/mesa/shader/shader_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 828d3f062a..afd2c2af7d 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1660,7 +1660,7 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, for (k = 0; k < count; k++) { GLfloat *uniformVal; - if (offset + k > slots) { + if (offset + k >= slots) { /* Extra array data is ignored */ break; } -- cgit v1.2.3 From c4ffbf009e76289fec53c82ce12da8de89d8b7af Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Feb 2009 17:46:00 -0700 Subject: glsl: asst improvements, clean-ups in set_program_uniform() Move the is_boolean/integer_type() calls out of the loops. Move the is_sampler_type() function near the bool/int functions. Add a bunch of comments. --- src/mesa/shader/shader_api.c | 63 +++++++++++++++++++++++++------------------- 1 file changed, 36 insertions(+), 27 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index afd2c2af7d..b8b34bb2b4 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.2 + * Version: 7.5 * * Copyright (C) 2004-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -827,6 +828,27 @@ is_integer_type(GLenum type) } +static GLboolean +is_sampler_type(GLenum type) +{ + switch (type) { + case GL_SAMPLER_1D: + case GL_SAMPLER_2D: + case GL_SAMPLER_3D: + case GL_SAMPLER_CUBE: + case GL_SAMPLER_1D_SHADOW: + case GL_SAMPLER_2D_SHADOW: + case GL_SAMPLER_2D_RECT_ARB: + case GL_SAMPLER_2D_RECT_SHADOW_ARB: + case GL_SAMPLER_1D_ARRAY_EXT: + case GL_SAMPLER_2D_ARRAY_EXT: + return GL_TRUE; + default: + return GL_FALSE; + } +} + + static void _mesa_get_active_attrib(GLcontext *ctx, GLuint program, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, @@ -1516,27 +1538,6 @@ _mesa_update_shader_textures_used(struct gl_program *prog) } -static GLboolean -is_sampler_type(GLenum type) -{ - switch (type) { - case GL_SAMPLER_1D: - case GL_SAMPLER_2D: - case GL_SAMPLER_3D: - case GL_SAMPLER_CUBE: - case GL_SAMPLER_1D_SHADOW: - case GL_SAMPLER_2D_SHADOW: - case GL_SAMPLER_2D_RECT_ARB: - case GL_SAMPLER_2D_RECT_SHADOW_ARB: - case GL_SAMPLER_1D_ARRAY_EXT: - case GL_SAMPLER_2D_ARRAY_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - /** * Check if the type given by userType is allowed to set a uniform of the * target type. Generally, equivalence is required, but setting Boolean @@ -1575,10 +1576,10 @@ compatible_types(GLenum userType, GLenum targetType) * \param program the program whose uniform to update * \param index the index of the program parameter for the uniform * \param offset additional parameter slot offset (for arrays) - * \param type the datatype of the uniform + * \param type the incoming datatype of 'values' * \param count the number of uniforms to set - * \param elems number of elements per uniform - * \param values the new values + * \param elems number of elements per uniform (1, 2, 3 or 4) + * \param values the new values, of datatype 'type' */ static void set_program_uniform(GLcontext *ctx, struct gl_program *program, @@ -1588,8 +1589,12 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, { struct gl_program_parameter *param = &program->Parameters->Parameters[index]; + const GLboolean isUniformBool = is_boolean_type(param->DataType); + const GLboolean areIntValues = is_integer_type(type); assert(offset >= 0); + assert(elems >= 1); + assert(elems <= 4); if (!compatible_types(type, param->DataType)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(type mismatch)"); @@ -1657,6 +1662,7 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, } } + /* loop over number of array elements */ for (k = 0; k < count; k++) { GLfloat *uniformVal; @@ -1665,8 +1671,11 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, break; } + /* uniformVal (the destination) is always float[4] */ uniformVal = program->Parameters->ParameterValues[index + offset + k]; - if (is_integer_type(type)) { + + if (areIntValues) { + /* convert user's ints to floats */ const GLint *iValues = ((const GLint *) values) + k * elems; for (i = 0; i < elems; i++) { uniformVal[i] = (GLfloat) iValues[i]; @@ -1680,7 +1689,7 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, } /* if the uniform is bool-valued, convert to 1.0 or 0.0 */ - if (is_boolean_type(param->DataType)) { + if (isUniformBool) { for (i = 0; i < elems; i++) { uniformVal[i] = uniformVal[i] ? 1.0f : 0.0f; } -- cgit v1.2.3 From ad2cfa41992d0676881440596c43ab6021c1b025 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Feb 2009 11:42:28 -0700 Subject: glsl: fix vec4_texp_rect IR code (need projective version) --- src/mesa/shader/slang/slang_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index cfdb868d6c..ac706325b8 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -527,7 +527,7 @@ static slang_asm_info AsmInfo[] = { { "vec4_texp3d", IR_TEXP, 1, 2 }, /* 3d w/ projection */ { "vec4_texcube", IR_TEX, 1, 2 }, /* cubemap */ { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ - { "vec4_texp_rect", IR_TEX, 1, 2 },/* rectangle w/ projection */ + { "vec4_texp_rect", IR_TEXP, 1, 2 },/* rectangle w/ projection */ /* unary op */ { "ivec4_to_vec4", IR_I_TO_F, 1, 1 }, /* int[4] to float[4] */ -- cgit v1.2.3 From c0b59420eec5ffdf22a5919d38851c3620b97c09 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Feb 2009 11:44:17 -0700 Subject: glsl: rename GLSL texture assembly instructions to be more legible --- .../shader/slang/library/slang_common_builtin.gc | 32 +-- .../shader/slang/library/slang_common_builtin_gc.h | 234 +++++++++++---------- .../shader/slang/library/slang_fragment_builtin.gc | 26 +-- .../slang/library/slang_fragment_builtin_gc.h | 172 +++++++-------- .../shader/slang/library/slang_vertex_builtin.gc | 28 +-- .../shader/slang/library/slang_vertex_builtin_gc.h | 132 ++++++------ src/mesa/shader/slang/slang_codegen.c | 24 +-- 7 files changed, 327 insertions(+), 321 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 230c57cea8..0643731daa 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1659,76 +1659,76 @@ bvec4 not (const bvec4 v) vec4 texture1D(const sampler1D sampler, const float coord) { - __asm vec4_tex1d __retVal, sampler, coord; + __asm vec4_tex_1d __retVal, sampler, coord; } vec4 texture1DProj(const sampler1D sampler, const vec2 coord) { // need to swizzle .y into .w - __asm vec4_texp1d __retVal, sampler, coord.xyyy; + __asm vec4_tex_1d_proj __retVal, sampler, coord.xyyy; } vec4 texture1DProj(const sampler1D sampler, const vec4 coord) { - __asm vec4_texp1d __retVal, sampler, coord; + __asm vec4_tex1d_proj __retVal, sampler, coord; } vec4 texture2D(const sampler2D sampler, const vec2 coord) { - __asm vec4_tex2d __retVal, sampler, coord; + __asm vec4_tex_2d __retVal, sampler, coord; } vec4 texture2DProj(const sampler2D sampler, const vec3 coord) { // need to swizzle 'z' into 'w'. - __asm vec4_texp2d __retVal, sampler, coord.xyzz; + __asm vec4_tex_2d_proj __retVal, sampler, coord.xyzz; } vec4 texture2DProj(const sampler2D sampler, const vec4 coord) { - __asm vec4_texp2d __retVal, sampler, coord; + __asm vec4_tex_2d_proj __retVal, sampler, coord; } vec4 texture3D(const sampler3D sampler, const vec3 coord) { - __asm vec4_tex3d __retVal, sampler, coord; + __asm vec4_tex_3d __retVal, sampler, coord; } vec4 texture3DProj(const sampler3D sampler, const vec4 coord) { - __asm vec4_texp3d __retVal, sampler, coord; + __asm vec4_tex_3d_proj __retVal, sampler, coord; } vec4 textureCube(const samplerCube sampler, const vec3 coord) { - __asm vec4_texcube __retVal, sampler, coord; + __asm vec4_tex_cube __retVal, sampler, coord; } vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord) { - __asm vec4_tex1d __retVal, sampler, coord; + __asm vec4_tex_1d __retVal, sampler, coord; } vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord) { // .s and .p will be divided by .q - __asm vec4_texp1d __retVal, sampler, coord; + __asm vec4_tex_1d_proj __retVal, sampler, coord; } vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord) { - __asm vec4_tex2d __retVal, sampler, coord; + __asm vec4_tex_2d __retVal, sampler, coord; } vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord) { // .s, .t and .p will be divided by .q - __asm vec4_texp2d __retVal, sampler, coord; + __asm vec4_tex_2d_proj __retVal, sampler, coord; } @@ -1741,12 +1741,12 @@ vec4 texture2DRect(const sampler2DRect sampler, const vec2 coord) vec4 texture2DRectProj(const sampler2DRect sampler, const vec3 coord) { // need to swizzle .y into .w - __asm vec4_texp_rect __retVal, sampler, coord.xyzz; + __asm vec4_tex_rect_proj __retVal, sampler, coord.xyzz; } vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) { - __asm vec4_texp_rect __retVal, sampler, ccoord; + __asm vec4_tex_rect_proj __retVal, sampler, ccoord; } vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) @@ -1756,7 +1756,7 @@ vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) { - __asm vec4_texp_rect __retVal, sampler, coord; + __asm vec4_tex_rect_proj __retVal, sampler, coord; } diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 759bf247d8..89e3ad2078 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -744,125 +744,127 @@ 120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,0,1,1,0,0,4,0,118,0, 0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0, 0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18,95,95, +114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,0,18,95,95, 114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, 0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121, -121,121,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,112,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100, -0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0, -0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50, -100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, -59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1, -1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52, -95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,112,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101, -120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,49,100,0,18, +114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112, +114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, +114,100,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114, +111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4, +118,101,99,52,95,116,101,120,49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, +114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0, +1,4,118,101,99,52,95,116,101,120,95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, +108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68, +80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0, +1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0, +18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0, +12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114, +0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114, +111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109,112,108, +101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100,0,18, 95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, -90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,49,100,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90, -95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,50,100,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104, -97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,50,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120, -116,117,114,101,50,68,82,101,99,116,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99, -116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, -59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80, -114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1, -4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111, -119,50,68,82,101,99,116,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100, -111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,112,95,114,101,99,116,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, -101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101, -49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101, -116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0,120,0,0,0, -1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0, -0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97,116,95,110, -111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,110,111, -105,115,101,50,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111, -105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101, -50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101, -49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0, -18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,90,95,0, -0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0, -0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,12,0, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46, -0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0, -0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, -101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0, -0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86, +90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112, +108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100, +95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, +111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19, +0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, +101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, +99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115, +97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,0, +1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99, +52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101, +99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0, +0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22, +0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, +101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50, +68,82,101,99,116,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0, +0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119, +50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99, +111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,0,18, +95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, +90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111, +105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105, +115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95, +114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0, +120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18, +120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97, +116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0, +0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, +111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105, +115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105, +115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115, +101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0, +0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86, 97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, 0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17, -55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0, -0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, -101,99,52,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0, -0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95, +55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1, +1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, +0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55, +55,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0, +52,55,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49, +57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, +110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0, +0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95, 114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55, -0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0, -17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99, -50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55, -0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49, -0,0,18,120,0,58,118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1, -90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55, -0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17, -49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, -101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0, -57,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17, -49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0, -17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,52,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0, -0,0,0,46,0,0,20,0,0,0 +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17, +49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101, +51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101, +49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0, +18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50, +0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49, +0,0,18,120,0,58,118,101,99,52,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0, +0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0, +120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0, +51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18, +120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, +101,49,0,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0, +1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, +0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55, +0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111, +105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0, +46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51, +52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55, +0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58, +110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0, +0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12, +0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, +101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0, +46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58, +118,101,99,52,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49, +57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0, +18,120,0,58,118,101,99,52,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0, +17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/mesa/shader/slang/library/slang_fragment_builtin.gc index 416c6ff313..31bc467e09 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin.gc +++ b/src/mesa/shader/slang/library/slang_fragment_builtin.gc @@ -46,7 +46,7 @@ vec4 texture1D(const sampler1D sampler, const float coord, const float bias) vec4 coord4; coord4.x = coord; coord4.w = bias; - __asm vec4_texb1d __retVal, sampler, coord4; + __asm vec4_tex_1d_bias __retVal, sampler, coord4; } vec4 texture1DProj(const sampler1D sampler, const vec2 coord, const float bias) @@ -55,7 +55,7 @@ vec4 texture1DProj(const sampler1D sampler, const vec2 coord, const float bias) vec4 pcoord; pcoord.x = coord.x / coord.y; pcoord.w = bias; - __asm vec4_texb1d __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias __retVal, sampler, pcoord; } vec4 texture1DProj(const sampler1D sampler, const vec4 coord, const float bias) @@ -64,7 +64,7 @@ vec4 texture1DProj(const sampler1D sampler, const vec4 coord, const float bias) vec4 pcoord; pcoord.x = coord.x / coord.z; pcoord.w = bias; - __asm vec4_texb1d __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias __retVal, sampler, pcoord; } @@ -75,7 +75,7 @@ vec4 texture2D(const sampler2D sampler, const vec2 coord, const float bias) vec4 coord4; coord4.xy = coord.xy; coord4.w = bias; - __asm vec4_texb2d __retVal, sampler, coord4; + __asm vec4_tex_2d_bias __retVal, sampler, coord4; } vec4 texture2DProj(const sampler2D sampler, const vec3 coord, const float bias) @@ -84,7 +84,7 @@ vec4 texture2DProj(const sampler2D sampler, const vec3 coord, const float bias) vec4 pcoord; pcoord.xy = coord.xy / coord.z; pcoord.w = bias; - __asm vec4_texb2d __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias __retVal, sampler, pcoord; } vec4 texture2DProj(const sampler2D sampler, const vec4 coord, const float bias) @@ -93,7 +93,7 @@ vec4 texture2DProj(const sampler2D sampler, const vec4 coord, const float bias) vec4 pcoord; pcoord.xy = coord.xy / coord.w; pcoord.w = bias; - __asm vec4_texb2d __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias __retVal, sampler, pcoord; } @@ -104,7 +104,7 @@ vec4 texture3D(const sampler3D sampler, const vec3 coord, const float bias) vec4 coord4; coord4.xyz = coord.xyz; coord4.w = bias; - __asm vec4_texb3d __retVal, sampler, coord4; + __asm vec4_tex_3d_bias __retVal, sampler, coord4; } vec4 texture3DProj(const sampler3D sampler, const vec4 coord, const float bias) @@ -113,7 +113,7 @@ vec4 texture3DProj(const sampler3D sampler, const vec4 coord, const float bias) vec4 pcoord; pcoord.xyz = coord.xyz / coord.w; pcoord.w = bias; - __asm vec4_texb3d __retVal, sampler, pcoord; + __asm vec4_tex_3d_bias __retVal, sampler, pcoord; } @@ -124,7 +124,7 @@ vec4 textureCube(const samplerCube sampler, const vec3 coord, const float bias) vec4 coord4; coord4.xyz = coord; coord4.w = bias; - __asm vec4_texcube __retVal, sampler, coord4; + __asm vec4_tex_cube __retVal, sampler, coord4; } @@ -138,7 +138,7 @@ vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord, const float bias) vec4 coord4; coord4.xyz = coord; coord4.w = bias; - __asm vec4_texb1d __retVal, sampler, coord4; + __asm vec4_tex_1d_bias __retVal, sampler, coord4; } vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float bias) @@ -147,7 +147,7 @@ vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float b pcoord.x = coord.x / coord.w; pcoord.z = coord.z; pcoord.w = bias; - __asm vec4_texb1d __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias __retVal, sampler, pcoord; } vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) @@ -155,7 +155,7 @@ vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) vec4 coord4; coord4.xyz = coord; coord4.w = bias; - __asm vec4_texb2d __retVal, sampler, coord4; + __asm vec4_tex_2d_bias __retVal, sampler, coord4; } vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float bias) @@ -164,7 +164,7 @@ vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float b pcoord.xy = coord.xy / coord.w; pcoord.z = coord.z; pcoord.w = bias; - __asm vec4_texb2d __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias __retVal, sampler, pcoord; } diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h index 738a0f9295..afe0ab8623 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h @@ -14,94 +14,96 @@ 108,101,114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0, 12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0, 20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120, -98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0, -1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99, -111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116, -86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1, -1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99, -111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18, -99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20, -0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9, -0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100, -52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0, -18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108, -0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101, -120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11, -0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114, -100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99, -111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0, -4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100, -0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, -99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95, -116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, +95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111, +106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0, +98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114, +100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112, +99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95, +98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111, +111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0, +16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115, +0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0, +18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114, +100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0, +18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0, +0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114, +0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99, +111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120, +121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116, +101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80, +114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1, +0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111, +111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0, +49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101, +120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, +0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114, +111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0, +9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111, +114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20, +0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95, +50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, 112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0, 115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0, 1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0, 18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97, -115,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, -109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, -114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111, -114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9, -18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,18,99,111, -111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4, -118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67, -117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0, -0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114, -100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98, -105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0, -0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, -100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0, -0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111, -111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119, -0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115, -104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0, -99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114, -100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111, -114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0, -20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120, -98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111, -114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12, -0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114, -100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116, -101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21, -0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0, -0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0, -18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, +115,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116, +101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0, +12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111, +114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121, +122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97, +115,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116, +101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0, +99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100, +52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111, +111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,99,117,98,101, +0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0, +0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0, +0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99, +111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20, +0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95, +49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, +99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1, +0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97, +115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120, +0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, 114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, -98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100, -120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,120,0,1,1,0,0,10,0,112,0, -0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59, -120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99, -52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122, -122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100, -100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100,121,0,1,1, -0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0,0,10,0,112,0,0,0,1,4, -118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59,120,121, -121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99,52,95, -100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122,122,0,0, -0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0, -18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119,105,100,116,104,0,1,1, -0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58, -100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105,100,116,104,0,1,1,0,0,10, +98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0, +12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99, +111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0, +0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114, +100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97, +115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100, +52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2, +90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111, +111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0, +59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97, +115,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,100, +70,100,120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97, +108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,120,0,1,1,0,0, +10,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,112,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11,0,112,0,0,0,1,4, +118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120, +121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52, +95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100, +121,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59, +120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0,0,10,0,112,0, +0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59, +120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99, +52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122, +122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100, +100,121,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119,105,100,116, +104,0,1,1,0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98, +115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105,100,116,104,0, +1,1,0,0,10,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0, +0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100,116,104,0,1,1,0, +0,11,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58, +100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116,104,0,1,1,0,0,12, 0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70, -100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100,116,104,0,1,1,0,0,11,0,112, -0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,100, -121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116,104,0,1,1,0,0,12,0,112,0,0, -0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70,100,121,0, -0,18,112,0,0,0,0,0,46,0,0,0 +100,121,0,0,18,112,0,0,0,0,0,46,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin.gc b/src/mesa/shader/slang/library/slang_vertex_builtin.gc index 17e86d9a0e..28d99a77b3 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin.gc +++ b/src/mesa/shader/slang/library/slang_vertex_builtin.gc @@ -78,7 +78,7 @@ vec4 texture1DLod(const sampler1D sampler, const float coord, const float lod) vec4 coord4; coord4.x = coord; coord4.w = lod; - __asm vec4_texb1d __retVal, sampler, coord4; + __asm vec4_tex_1d_bias __retVal, sampler, coord4; } vec4 texture1DProjLod(const sampler1D sampler, const vec2 coord, const float lod) @@ -86,7 +86,7 @@ vec4 texture1DProjLod(const sampler1D sampler, const vec2 coord, const float lod vec4 pcoord; pcoord.x = coord.x / coord.y; pcoord.w = lod; - __asm vec4_texb1d __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias __retVal, sampler, pcoord; } vec4 texture1DProjLod(const sampler1D sampler, const vec4 coord, const float lod) @@ -94,7 +94,7 @@ vec4 texture1DProjLod(const sampler1D sampler, const vec4 coord, const float lod vec4 pcoord; pcoord.x = coord.x / coord.z; pcoord.w = lod; - __asm vec4_texb1d __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias __retVal, sampler, pcoord; } @@ -104,7 +104,7 @@ vec4 texture2DLod(const sampler2D sampler, const vec2 coord, const float lod) vec4 coord4; coord4.xy = coord.xy; coord4.w = lod; - __asm vec4_texb2d __retVal, sampler, coord4; + __asm vec4_tex_2d_bias __retVal, sampler, coord4; } vec4 texture2DProjLod(const sampler2D sampler, const vec3 coord, const float lod) @@ -112,7 +112,7 @@ vec4 texture2DProjLod(const sampler2D sampler, const vec3 coord, const float lod vec4 pcoord; pcoord.xy = coord.xy / coord.z; pcoord.w = lod; - __asm vec4_texb2d __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias __retVal, sampler, pcoord; } vec4 texture2DProjLod(const sampler2D sampler, const vec4 coord, const float lod) @@ -120,7 +120,7 @@ vec4 texture2DProjLod(const sampler2D sampler, const vec4 coord, const float lod vec4 pcoord; pcoord.xy = coord.xy / coord.z; pcoord.w = lod; - __asm vec4_texb2d __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias __retVal, sampler, pcoord; } @@ -129,16 +129,16 @@ vec4 texture3DLod(const sampler3D sampler, const vec3 coord, const float lod) vec4 coord4; coord4.xyz = coord.xyz; coord4.w = lod; - __asm vec4_texb3d __retVal, sampler, coord4; + __asm vec4_tex_3d_bias __retVal, sampler, coord4; } vec4 texture3DProjLod(const sampler3D sampler, const vec4 coord, const float lod) { - // do projection here (there's no vec4_texbp3d instruction) + // do projection here (there's no vec4_tex_3d_bias_proj instruction) vec4 pcoord; pcoord.xyz = coord.xyz / coord.w; pcoord.w = lod; - __asm vec4_texb3d __retVal, sampler, pcoord; + __asm vec4_tex_3d_bias __retVal, sampler, pcoord; } @@ -147,7 +147,7 @@ vec4 textureCubeLod(const samplerCube sampler, const vec3 coord, const float lod vec4 coord4; coord4.xyz = coord; coord4.w = lod; - __asm vec4_texcube __retVal, sampler, coord4; + __asm vec4_tex_cube __retVal, sampler, coord4; } @@ -156,7 +156,7 @@ vec4 shadow1DLod(const sampler1DShadow sampler, const vec3 coord, const float lo vec4 coord4; coord4.xyz = coord; coord4.w = lod; - __asm vec4_texb1d __retVal, sampler, coord4; + __asm vec4_tex_1d_bias __retVal, sampler, coord4; } vec4 shadow1DProjLod(const sampler1DShadow sampler, const vec4 coord, @@ -166,7 +166,7 @@ vec4 shadow1DProjLod(const sampler1DShadow sampler, const vec4 coord, pcoord.x = coord.x / coord.w; pcoord.z = coord.z; pcoord.w = lod; - __asm vec4_texb1d __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias __retVal, sampler, pcoord; } @@ -175,7 +175,7 @@ vec4 shadow2DLod(const sampler2DShadow sampler, const vec3 coord, const float lo vec4 coord4; coord4.xyz = coord; coord4.w = lod; - __asm vec4_texb2d __retVal, sampler, coord4; + __asm vec4_tex_2d_bias __retVal, sampler, coord4; } vec4 shadow2DProjLod(const sampler2DShadow sampler, const vec4 coord, @@ -185,6 +185,6 @@ vec4 shadow2DProjLod(const sampler2DShadow sampler, const vec4 coord, pcoord.xy = coord.xy / coord.w; pcoord.z = coord.z; pcoord.w = lod; - __asm vec4_texb2d __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias __retVal, sampler, pcoord; } diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h index 2cb91bf268..c7c7ce4fad 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h @@ -33,74 +33,76 @@ 0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0, 0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114, 100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90, -95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111, -114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0, -18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0, -0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101, -120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0, -1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99, -111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18, -99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0, -4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0, -1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111, -114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9,18,99,111,111,114,100,52,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0, -116,101,120,116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1, -112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108, -111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120, -116,117,114,101,50,68,80,114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1, -0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111, -111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0, -18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0, -20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114, -101,51,68,76,111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100, -0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111, -111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97, +114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97, +115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100, +52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0, +0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100, +0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0, +18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114, +100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0, +18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0, +0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0, +115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1, +3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111, +111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59, +119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90, +95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101, +114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1, +99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59, +120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, +101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80, +114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, +100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, +99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, +122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, +101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80, +114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114, +100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, +99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, +122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, +101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,76, +111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0, +9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100, +52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0, +59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95, +95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1, +90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97, 109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90, 95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99, 111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,51,100,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0, -1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100, -0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120, -99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,0,115, +114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115, +0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0, +0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115, 97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2, 90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99, 111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52, -95,116,101,120,98,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,76, -111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0, -9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114, -100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112, -99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,49,100,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0, -115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0, -99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52, -0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0, -12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114, -100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0, -18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0, -4,118,101,99,52,95,116,101,120,98,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 +95,116,101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, +0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0, +1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108, +111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59, +120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0, +20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0, +0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, +100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0, +12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111, +114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111, +111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59, +122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101, +120,95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, +0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,76,111,100,0, +1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108, +111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59, +120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0, +20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0, +0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, +100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0, +12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111, +114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18, +99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100, +0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95, +116,101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ac706325b8..d7e54250bd 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -516,18 +516,18 @@ static slang_asm_info AsmInfo[] = { /* float binary op */ { "float_power", IR_POW, 1, 2 }, /* texture / sampler */ - { "vec4_tex1d", IR_TEX, 1, 2 }, - { "vec4_texb1d", IR_TEXB, 1, 2 }, /* 1d w/ bias */ - { "vec4_texp1d", IR_TEXP, 1, 2 }, /* 1d w/ projection */ - { "vec4_tex2d", IR_TEX, 1, 2 }, - { "vec4_texb2d", IR_TEXB, 1, 2 }, /* 2d w/ bias */ - { "vec4_texp2d", IR_TEXP, 1, 2 }, /* 2d w/ projection */ - { "vec4_tex3d", IR_TEX, 1, 2 }, - { "vec4_texb3d", IR_TEXB, 1, 2 }, /* 3d w/ bias */ - { "vec4_texp3d", IR_TEXP, 1, 2 }, /* 3d w/ projection */ - { "vec4_texcube", IR_TEX, 1, 2 }, /* cubemap */ - { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ - { "vec4_texp_rect", IR_TEXP, 1, 2 },/* rectangle w/ projection */ + { "vec4_tex_1d", IR_TEX, 1, 2 }, + { "vec4_tex_1d_bias", IR_TEXB, 1, 2 }, /* 1d w/ bias */ + { "vec4_tex_1d_proj", IR_TEXP, 1, 2 }, /* 1d w/ projection */ + { "vec4_tex_2d", IR_TEX, 1, 2 }, + { "vec4_tex_2d_bias", IR_TEXB, 1, 2 }, /* 2d w/ bias */ + { "vec4_tex_2d_proj", IR_TEXP, 1, 2 }, /* 2d w/ projection */ + { "vec4_tex_3d", IR_TEX, 1, 2 }, + { "vec4_tex_3d_bias", IR_TEXB, 1, 2 }, /* 3d w/ bias */ + { "vec4_tex_3d_proj", IR_TEXP, 1, 2 }, /* 3d w/ projection */ + { "vec4_tex_cube", IR_TEX, 1, 2 }, /* cubemap */ + { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ + { "vec4_tex_rect_bias", IR_TEX, 1, 2 }, /* rectangle w/ projection */ /* unary op */ { "ivec4_to_vec4", IR_I_TO_F, 1, 1 }, /* int[4] to float[4] */ -- cgit v1.2.3 From e3cc8e8244388f767430bf310f933944664f8e51 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Feb 2009 11:24:15 -0700 Subject: mesa: freshen-up comments, move some fields in prog_instruction --- src/mesa/shader/prog_instruction.h | 40 ++++++++++++++------------------------ 1 file changed, 15 insertions(+), 25 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index 48e7b04c98..84dd98b498 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -341,14 +341,6 @@ struct prog_dst_register struct prog_instruction { gl_inst_opcode Opcode; -#if FEATURE_MESA_program_debug - GLshort StringPos; -#endif - /** - * Arbitrary data. Used for the PRINT, CAL, and BRA instructions. - */ - void *Data; - struct prog_src_register SrcReg[3]; struct prog_dst_register DstReg; @@ -388,7 +380,7 @@ struct prog_instruction GLuint SaturateMode:2; /** - * Per-instruction selectable precision. + * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12. * * \since * NV_fragment_program, NV_fragment_program_option. @@ -396,24 +388,13 @@ struct prog_instruction GLuint Precision:3; /** - * \name Texture source controls. - * - * The texture source controls are only used with the \c TEX, \c TXD, - * \c TXL, and \c TXP instructions. - * - * \since - * ARB_fragment_program, NV_fragment_program, NV_vertex_program3. + * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. */ /*@{*/ - /** - * Source texture unit. OpenGL supports a maximum of 32 texture - * units. - */ + /** Source texture unit. */ GLuint TexSrcUnit:5; - /** - * Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX. - */ + /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */ GLuint TexSrcTarget:3; /*@}*/ @@ -421,8 +402,8 @@ struct prog_instruction * For BRA and CAL instructions, the location to jump to. * For BGNLOOP, points to ENDLOOP (and vice-versa). * For BRK, points to BGNLOOP (which points to ENDLOOP). - * For IF, points to else or endif. - * For ELSE, points to endif. + * For IF, points to ELSE or ENDIF. + * For ELSE, points to ENDIF. */ GLint BranchTarget; @@ -434,7 +415,16 @@ struct prog_instruction GLint Sampler; #endif + /** for debugging purposes */ const char *Comment; + + /** Arbitrary data. Used for OPCODE_PRINT and some drivers */ + void *Data; + + /* XXX obsolete - remove someday */ +#if FEATURE_MESA_program_debug + GLshort StringPos; +#endif }; -- cgit v1.2.3 From 44e018c09e7aeba9fd9f4c380da224bd6622c470 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Feb 2009 13:42:08 -0700 Subject: mesa: add TexShadow field to prog_instruction If the instruction is TEX/TXP/TXL/etc the TexShadow field will be true if the instruction is a texture fetch with shadow compare. --- src/mesa/shader/arbprogparse.c | 3 +++ src/mesa/shader/prog_instruction.h | 3 +++ src/mesa/shader/prog_print.c | 2 ++ 3 files changed, 8 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 2e0fc3694a..62edb7f595 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -3104,6 +3104,9 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, break; } + if (shadow_tex) + fp->TexShadow = 1; + /* Don't test the first time a particular sampler is seen. Each time * after that, make sure the shadow state is the same. */ diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index 84dd98b498..e3bb7ac01d 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -396,6 +396,9 @@ struct prog_instruction /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */ GLuint TexSrcTarget:3; + + /** True if tex instruction should do shadow comparison */ + GLuint TexShadow:1; /*@}*/ /** diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 516ea73301..80be51c3c5 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -592,6 +592,8 @@ _mesa_fprint_instruction_opt(FILE *f, default: ; } + if (inst->TexShadow) + _mesa_fprintf(f, " SHADOW"); fprint_comment(f, inst); break; -- cgit v1.2.3 From 0ea95ae7420b4217b5c10c7593eb2e08e971bf72 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 20 Feb 2009 13:44:43 -0700 Subject: glsl: use new IR opcodes for TEX instructions with shadow comparison Such TEX instructions will have the TexShadow flag set. The gl_program::ShadowSamplers field is now set in the linker. We missed that before. --- .../shader/slang/library/slang_common_builtin.gc | 12 +- .../shader/slang/library/slang_common_builtin_gc.h | 170 +++++++++++---------- .../shader/slang/library/slang_fragment_builtin.gc | 12 +- .../slang/library/slang_fragment_builtin_gc.h | 85 ++++++----- .../shader/slang/library/slang_vertex_builtin.gc | 8 +- .../shader/slang/library/slang_vertex_builtin_gc.h | 43 +++--- src/mesa/shader/slang/slang_codegen.c | 10 ++ src/mesa/shader/slang/slang_emit.c | 34 ++++- src/mesa/shader/slang/slang_ir.c | 3 + src/mesa/shader/slang/slang_ir.h | 4 + src/mesa/shader/slang/slang_link.c | 3 + 11 files changed, 213 insertions(+), 171 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 0643731daa..71d937d81a 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1711,24 +1711,24 @@ vec4 textureCube(const samplerCube sampler, const vec3 coord) vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord) { - __asm vec4_tex_1d __retVal, sampler, coord; + __asm vec4_tex_1d_shadow __retVal, sampler, coord; } vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord) { // .s and .p will be divided by .q - __asm vec4_tex_1d_proj __retVal, sampler, coord; + __asm vec4_tex_1d_proj_shadow __retVal, sampler, coord; } vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord) { - __asm vec4_tex_2d __retVal, sampler, coord; + __asm vec4_tex_2d_shadow __retVal, sampler, coord; } vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord) { // .s, .t and .p will be divided by .q - __asm vec4_tex_2d_proj __retVal, sampler, coord; + __asm vec4_tex_2d_proj_shadow __retVal, sampler, coord; } @@ -1751,12 +1751,12 @@ vec4 texture2DRectProj(const sampler2DRect sampler, const vec4 coord) vec4 shadow2DRect(const sampler2DRectShadow sampler, const vec3 coord) { - __asm vec4_tex_rect __retVal, sampler, coord; + __asm vec4_tex_rect_shadow __retVal, sampler, coord; } vec4 shadow2DRectProj(const sampler2DRectShadow sampler, const vec4 coord) { - __asm vec4_tex_rect_proj __retVal, sampler, coord; + __asm vec4_tex_rect_proj_shadow __retVal, sampler, coord; } diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 89e3ad2078..f537c00266 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -773,18 +773,19 @@ 101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, 99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97, 109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,0, -1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99, +49,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111, +106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118, +101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, +0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,115,104,97,100,111,119,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, +0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0, +0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111, +106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, +0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116, +0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99, 52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, 114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101, 99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, @@ -795,76 +796,77 @@ 101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, 112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50, 68,82,101,99,116,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0, -0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119, -50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99, -111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,0,18, -95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, -90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111, -105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105, -115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,50,0,18,95,95, -114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0, -120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86,97,108,0,0,18, -120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97, -116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0, -0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105, -115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105, -115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115, -101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0, -0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17, -55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1, -1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, -18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, -0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55, -55,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0, -52,55,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49, -57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0, -0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17, -49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101, -51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101, -49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0, -18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50, -0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49, -0,0,18,120,0,58,118,101,99,52,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0, -0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0, -120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0, -51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18, -120,0,17,53,0,52,55,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115, -101,49,0,0,18,120,0,17,50,51,0,53,52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0, -1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, -18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, -0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55, -0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0, -46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114, +0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,115,104,97,100,111,119,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, +0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101, +114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116, +95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0, +0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108, +0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108, +111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0, +0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, +101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101, +49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101, +116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0, +46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114, 101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51, -52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55, -0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58, -110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0, -0,0,17,51,49,0,57,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12, -0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, -101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58, -118,101,99,52,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49, -57,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0, -18,120,0,58,118,101,99,52,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0, -17,51,55,0,52,56,0,0,0,0,46,0,0,20,0,0,0 +116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51, +52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0, +11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120, +0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58, +118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1, +90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55, +0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111, +105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111, +105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, +115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, +0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110, +111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, +105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, +101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110, +111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, +105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51, +0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49, +0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0, +0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,53, +0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0, +1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,17,50,51,0,53, +52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57, +0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, +111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0, +46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58, +118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0, +110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, +111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17, +51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, +49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0, +0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120, +0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0, +0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0, +0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,53,0,52,55,0,0, +0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,50, +51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20, +0,0,0 diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin.gc b/src/mesa/shader/slang/library/slang_fragment_builtin.gc index 31bc467e09..2e063e6416 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin.gc +++ b/src/mesa/shader/slang/library/slang_fragment_builtin.gc @@ -129,16 +129,12 @@ vec4 textureCube(const samplerCube sampler, const vec3 coord, const float bias) - -// For shadow textures, we use the regular tex instructions since they should -// do the depth comparison step. - vec4 shadow1D(const sampler1DShadow sampler, const vec3 coord, const float bias) { vec4 coord4; coord4.xyz = coord; coord4.w = bias; - __asm vec4_tex_1d_bias __retVal, sampler, coord4; + __asm vec4_tex_1d_bias_shadow __retVal, sampler, coord4; } vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float bias) @@ -147,7 +143,7 @@ vec4 shadow1DProj(const sampler1DShadow sampler, const vec4 coord, const float b pcoord.x = coord.x / coord.w; pcoord.z = coord.z; pcoord.w = bias; - __asm vec4_tex_1d_bias __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias_shadow __retVal, sampler, pcoord; } vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) @@ -155,7 +151,7 @@ vec4 shadow2D(const sampler2DShadow sampler, const vec3 coord, const float bias) vec4 coord4; coord4.xyz = coord; coord4.w = bias; - __asm vec4_tex_2d_bias __retVal, sampler, coord4; + __asm vec4_tex_2d_bias_shadow __retVal, sampler, coord4; } vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float bias) @@ -164,7 +160,7 @@ vec4 shadow2DProj(const sampler2DShadow sampler, const vec4 coord, const float b pcoord.xy = coord.xy / coord.w; pcoord.z = coord.z; pcoord.w = bias; - __asm vec4_tex_2d_bias __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias_shadow __retVal, sampler, pcoord; } diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h index afe0ab8623..c5a1cce2a4 100644 --- a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h @@ -65,45 +65,46 @@ 0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99, 111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20, 0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95, -49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1, -0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97, -115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120, -0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, -98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0, -12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99, -111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0, -0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114, -100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97, -115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100, -52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2, -90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111, -111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0, -59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97, -115,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,100, -70,100,120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,120,0,1,1,0,0, -10,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,112,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11,0,112,0,0,0,1,4, -118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120, -121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52, -95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,100,70,100, -121,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0,0,10,0,112,0, -0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,59, -120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1,4,118,101,99, -52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59,120,121,122, -122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99,52,95,100, -100,121,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119,105,100,116, -104,0,1,1,0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98, -115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105,100,116,104,0, -1,1,0,0,10,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0, -0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100,116,104,0,1,1,0, -0,11,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58, -100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116,104,0,1,1,0,0,12, -0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98,115,0,0,58,100,70, -100,121,0,0,18,112,0,0,0,0,0,46,0,0,0 +49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, +109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119, +49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100, +0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, +99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49, +20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111, +111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105, +97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0, +0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97, +115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120, +121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20, +0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, +95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101, +114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1, +112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, +120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99, +111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4, +118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95, +0,0,9,0,0,100,70,100,120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114, +101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100, +120,0,1,1,0,0,10,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11, +0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, +18,112,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4, +118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0, +100,70,100,121,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86, +97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0, +0,10,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, +0,18,112,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1, +4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59, +120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99, +52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119, +105,100,116,104,0,1,1,0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0, +0,58,97,98,115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105, +100,116,104,0,1,1,0,0,10,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0, +58,97,98,115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100, +116,104,0,1,1,0,0,11,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97, +98,115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116, +104,0,1,1,0,0,12,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98, +115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin.gc b/src/mesa/shader/slang/library/slang_vertex_builtin.gc index 28d99a77b3..9ad5f35425 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin.gc +++ b/src/mesa/shader/slang/library/slang_vertex_builtin.gc @@ -156,7 +156,7 @@ vec4 shadow1DLod(const sampler1DShadow sampler, const vec3 coord, const float lo vec4 coord4; coord4.xyz = coord; coord4.w = lod; - __asm vec4_tex_1d_bias __retVal, sampler, coord4; + __asm vec4_tex_1d_bias_shadow __retVal, sampler, coord4; } vec4 shadow1DProjLod(const sampler1DShadow sampler, const vec4 coord, @@ -166,7 +166,7 @@ vec4 shadow1DProjLod(const sampler1DShadow sampler, const vec4 coord, pcoord.x = coord.x / coord.w; pcoord.z = coord.z; pcoord.w = lod; - __asm vec4_tex_1d_bias __retVal, sampler, pcoord; + __asm vec4_tex_1d_bias_shadow __retVal, sampler, pcoord; } @@ -175,7 +175,7 @@ vec4 shadow2DLod(const sampler2DShadow sampler, const vec3 coord, const float lo vec4 coord4; coord4.xyz = coord; coord4.w = lod; - __asm vec4_tex_2d_bias __retVal, sampler, coord4; + __asm vec4_tex_2d_bias_shadow __retVal, sampler, coord4; } vec4 shadow2DProjLod(const sampler2DShadow sampler, const vec4 coord, @@ -185,6 +185,6 @@ vec4 shadow2DProjLod(const sampler2DShadow sampler, const vec4 coord, pcoord.xy = coord.xy / coord.w; pcoord.z = coord.z; pcoord.w = lod; - __asm vec4_tex_2d_bias __retVal, sampler, pcoord; + __asm vec4_tex_2d_bias_shadow __retVal, sampler, pcoord; } diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h index c7c7ce4fad..e5a252b019 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h @@ -85,24 +85,25 @@ 1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108, 111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59, 120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0, -20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0, -0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, -100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111, -114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111, -111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59, -122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101, -120,95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, -0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,76,111,100,0, -1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108, -111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59, -120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0, -20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0, -0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, -100,111,119,50,68,80,114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111, -114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18, -99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100, -0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95, -116,101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 +20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95, +95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1, +90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,0,115,97,109, +112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95, +0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114, +100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18, +99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4, +118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114, +101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95, +0,0,12,0,0,115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1, +1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111, +114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18, +99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95, +98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, +101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80, +114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114, +100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, +99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, +119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18, +112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, +95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, +108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index d7e54250bd..5e2ce0ce3a 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -529,6 +529,16 @@ static slang_asm_info AsmInfo[] = { { "vec4_tex_rect", IR_TEX, 1, 2 }, /* rectangle */ { "vec4_tex_rect_bias", IR_TEX, 1, 2 }, /* rectangle w/ projection */ + /* texture / sampler but with shadow comparison */ + { "vec4_tex_1d_shadow", IR_TEX_SH, 1, 2 }, + { "vec4_tex_1d_bias_shadow", IR_TEXB_SH, 1, 2 }, + { "vec4_tex_1d_proj_shadow", IR_TEXP_SH, 1, 2 }, + { "vec4_tex_2d_shadow", IR_TEX_SH, 1, 2 }, + { "vec4_tex_2d_bias_shadow", IR_TEXB_SH, 1, 2 }, + { "vec4_tex_2d_proj_shadow", IR_TEXP_SH, 1, 2 }, + { "vec4_tex_rect_shadow", IR_TEX_SH, 1, 2 }, + { "vec4_tex_rect_proj_shadow", IR_TEXP_SH, 1, 2 }, + /* unary op */ { "ivec4_to_vec4", IR_I_TO_F, 1, 1 }, /* int[4] to float[4] */ { "vec4_to_ivec4", IR_F_TO_I, 1, 1 }, /* float[4] to int[4] */ diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index feff1b7474..c9d008c0af 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1261,16 +1261,33 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) { struct prog_instruction *inst; gl_inst_opcode opcode; + GLboolean shadow = GL_FALSE; - if (n->Opcode == IR_TEX) { + switch (n->Opcode) { + case IR_TEX: opcode = OPCODE_TEX; - } - else if (n->Opcode == IR_TEXB) { + break; + case IR_TEX_SH: + opcode = OPCODE_TEX; + shadow = GL_TRUE; + break; + case IR_TEXB: opcode = OPCODE_TXB; - } - else { - assert(n->Opcode == IR_TEXP); + break; + case IR_TEXB_SH: + opcode = OPCODE_TXB; + shadow = GL_TRUE; + break; + case IR_TEXP: + opcode = OPCODE_TXP; + break; + case IR_TEXP_SH: opcode = OPCODE_TXP; + shadow = GL_TRUE; + break; + default: + _mesa_problem(NULL, "Bad IR TEX code"); + return NULL; } if (n->Children[0]->Opcode == IR_ELEMENT) { @@ -1302,6 +1319,8 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) NULL, NULL); + inst->TexShadow = shadow; + /* Store->Index is the uniform/sampler index */ assert(n->Children[0]->Store->Index >= 0); inst->TexSrcUnit = n->Children[0]->Store->Index; @@ -2270,6 +2289,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) case IR_TEX: case IR_TEXB: case IR_TEXP: + case IR_TEX_SH: + case IR_TEXB_SH: + case IR_TEXP_SH: return emit_tex(emitInfo, n); case IR_NEG: return emit_negation(emitInfo, n); diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index e4c6e0ea51..dc4086d888 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -94,6 +94,9 @@ static const slang_ir_info IrInfo[] = { { IR_TEX, "IR_TEX", OPCODE_TEX, 4, 1 }, { IR_TEXB, "IR_TEXB", OPCODE_TXB, 4, 1 }, { IR_TEXP, "IR_TEXP", OPCODE_TXP, 4, 1 }, + { IR_TEX_SH, "IR_TEX_SH", OPCODE_TEX, 4, 1 }, + { IR_TEXB_SH, "IR_TEXB_SH", OPCODE_TXB, 4, 1 }, + { IR_TEXP_SH, "IR_TEXP_SH", OPCODE_TXP, 4, 1 }, { IR_FLOAT, "IR_FLOAT", OPCODE_NOP, 0, 0 }, /* float literal */ { IR_FIELD, "IR_FIELD", OPCODE_NOP, 0, 0 }, { IR_ELEMENT, "IR_ELEMENT", OPCODE_NOP, 0, 0 }, diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index 644269d491..d77feeadba 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -131,6 +131,10 @@ typedef enum IR_TEXB, /* texture lookup with LOD bias */ IR_TEXP, /* texture lookup with projection */ + IR_TEX_SH, /* texture lookup, shadow compare */ + IR_TEXB_SH, /* texture lookup with LOD bias, shadow compare */ + IR_TEXP_SH, /* texture lookup with projection, shadow compare */ + IR_FLOAT, IR_I_TO_F, /* int[4] to float[4] conversion */ IR_F_TO_I, /* float[4] to int[4] conversion */ diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 152e97a668..bcabe71bfa 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -295,6 +295,9 @@ link_uniform_vars(GLcontext *ctx, inst->TexSrcUnit = newSampNum; prog->SamplerTargets[newSampNum] = inst->TexSrcTarget; prog->SamplersUsed |= (1 << newSampNum); + if (inst->TexShadow) { + prog->ShadowSamplers |= (1 << newSampNum); + } } } } -- cgit v1.2.3 From 9705cff2033f1771a39ac3bb78eb5fcea522218a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 21 Feb 2009 13:23:04 -0700 Subject: mesa: re-org texgen state New gl_texgen struct allows quite a bit of code reduction. --- src/mesa/shader/prog_statevars.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index e1db30b78f..1f7d87ccc9 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -206,28 +206,28 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], /* state[2] is the texgen attribute */ switch (state[2]) { case STATE_TEXGEN_EYE_S: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneS); + COPY_4V(value, ctx->Texture.Unit[unit].GenS.EyePlane); return; case STATE_TEXGEN_EYE_T: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneT); + COPY_4V(value, ctx->Texture.Unit[unit].GenT.EyePlane); return; case STATE_TEXGEN_EYE_R: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneR); + COPY_4V(value, ctx->Texture.Unit[unit].GenR.EyePlane); return; case STATE_TEXGEN_EYE_Q: - COPY_4V(value, ctx->Texture.Unit[unit].EyePlaneQ); + COPY_4V(value, ctx->Texture.Unit[unit].GenQ.EyePlane); return; case STATE_TEXGEN_OBJECT_S: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneS); + COPY_4V(value, ctx->Texture.Unit[unit].GenS.ObjectPlane); return; case STATE_TEXGEN_OBJECT_T: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneT); + COPY_4V(value, ctx->Texture.Unit[unit].GenT.ObjectPlane); return; case STATE_TEXGEN_OBJECT_R: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneR); + COPY_4V(value, ctx->Texture.Unit[unit].GenR.ObjectPlane); return; case STATE_TEXGEN_OBJECT_Q: - COPY_4V(value, ctx->Texture.Unit[unit].ObjectPlaneQ); + COPY_4V(value, ctx->Texture.Unit[unit].GenQ.ObjectPlane); return; default: _mesa_problem(ctx, "Invalid texgen state in fetch_state"); -- cgit v1.2.3 From d9881356a64b848dbae5fffd77fd93d0eb4247a3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 23 Feb 2009 13:10:55 -0700 Subject: glsl: fix another swizzle-related bug This fixes the case of "infinitely" nested swizzles such as EXPR.wzyx.yxwz.xxyz This doesn't appear in typical shaders but with function inlining and the compiler's internal use of swizzles it can happen. New glean glsl1 test case added for this. --- src/mesa/shader/slang/slang_emit.c | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index c9d008c0af..adb3bde9c4 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1379,6 +1379,7 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) #if PEEPHOLE_OPTIMIZATIONS if (inst && + (n->Children[1]->Opcode != IR_SWIZZLE) && _slang_is_temp(emitInfo->vt, n->Children[1]->Store) && (inst->DstReg.File == n->Children[1]->Store->File) && (inst->DstReg.Index == n->Children[1]->Store->Index) && @@ -1395,13 +1396,9 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) * becomes: * MUL a, x, y; */ - if (n->Children[1]->Opcode != IR_SWIZZLE) - _slang_free_temp(emitInfo->vt, n->Children[1]->Store); - *n->Children[1]->Store = *n->Children[0]->Store; /* fixup the previous instruction (which stored the RHS result) */ assert(n->Children[0]->Store->Index >= 0); - storage_to_dst_reg(&inst->DstReg, n->Children[0]->Store); return inst; } @@ -1860,24 +1857,22 @@ emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n) inst = emit(emitInfo, n->Children[0]); - if (n->Children[0]->Opcode == IR_VAR || - n->Children[0]->Opcode == IR_SWIZZLE || - n->Children[0]->Opcode == IR_ELEMENT) { - /* We can resolve the swizzle now. Other swizzles will be resolved - * in storage_to_src_reg(). - */ + assert(n->Children[0]->Store == n->Store->Parent); + assert(n->Store->Parent); + + { const GLuint swizzle = n->Store->Swizzle; - assert(n->Store->Parent); /* new storage is parent storage with updated Swizzle + Size fields */ _slang_copy_ir_storage(n->Store, n->Store->Parent); /* Apply this node's swizzle to parent's storage */ n->Store->Swizzle = _slang_swizzle_swizzle(n->Store->Swizzle, swizzle); /* Update size */ n->Store->Size = swizzle_size(n->Store->Swizzle); - assert(!n->Store->Parent); - assert(n->Store->Index >= 0); } + assert(!n->Store->Parent); + assert(n->Store->Index >= 0); + return inst; } -- cgit v1.2.3 From 00f0b05d5f14256213f744c3b8e4ce82611e0ba1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 23 Feb 2009 17:43:43 -0700 Subject: glsl: yet another swizzled expression fix This fixes swizzled conditional expressions such "(b ? p : q).x" --- src/mesa/shader/slang/slang_emit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index adb3bde9c4..6a47585c7a 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1857,8 +1857,11 @@ emit_swizzle(slang_emit_info *emitInfo, slang_ir_node *n) inst = emit(emitInfo, n->Children[0]); - assert(n->Children[0]->Store == n->Store->Parent); - assert(n->Store->Parent); + if (!n->Store->Parent) { + /* this covers a case such as "(b ? p : q).x" */ + n->Store->Parent = n->Children[0]->Store; + assert(n->Store->Parent); + } { const GLuint swizzle = n->Store->Swizzle; -- cgit v1.2.3 From 18d2745765715b03f9fda9a4c31d3678dc0bc457 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 24 Feb 2009 14:59:54 -0700 Subject: glsl: silence warning --- src/mesa/shader/slang/slang_builtin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index c0f4c79e13..9858a0f7fd 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -494,7 +494,7 @@ emit_statevars(const char *name, int array_len, } else if (type->type == SLANG_SPEC_STRUCT) { const slang_variable_scope *fields = type->_struct->fields; - GLuint i, pos; + GLuint i, pos = 0; for (i = 0; i < fields->num_variables; i++) { const slang_variable *var = fields->variables[i]; GLint p = emit_statevars(var->a_name, 0, &var->type.specifier, -- cgit v1.2.3 From 8ae7e7749b708fc5a46180d3de2503ba7e2ab1f3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 23 Feb 2009 17:50:55 -0700 Subject: mesa: replace old prog_instruction::Sampler field with Aux field The i965 driver needs an extra instruction field for color output information. It was using the Sampler field for this. Use the Aux field instead. This will probaby be revisited at some point... --- src/mesa/shader/prog_instruction.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index e3bb7ac01d..3808644550 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -410,20 +410,15 @@ struct prog_instruction */ GLint BranchTarget; -#if 01 /* XXX just use this for i965 driver for now! */ - /** - * For TEX instructions in shaders, the sampler to use for the - * texture lookup. - */ - GLint Sampler; -#endif - /** for debugging purposes */ const char *Comment; /** Arbitrary data. Used for OPCODE_PRINT and some drivers */ void *Data; + /** for driver use (try to remove someday) */ + GLint Aux; + /* XXX obsolete - remove someday */ #if FEATURE_MESA_program_debug GLshort StringPos; -- cgit v1.2.3 From a070937c00828ef0c0d618df7cc4845b0a21bbf3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 27 Feb 2009 13:44:42 -0700 Subject: mesa: update fragResults array in arb_output_attrib_string() Plus add some comments. --- src/mesa/shader/prog_print.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 80be51c3c5..2747480834 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -86,6 +86,9 @@ file_string(enum register_file f, gl_prog_print_mode mode) static const char * arb_input_attrib_string(GLint index, GLenum progType) { + /* + * These strings should match the VERT_ATTRIB_x and FRAG_ATTRIB_x tokens. + */ const char *vertAttribs[] = { "vertex.position", "vertex.weight", @@ -160,6 +163,9 @@ arb_input_attrib_string(GLint index, GLenum progType) static const char * arb_output_attrib_string(GLint index, GLenum progType) { + /* + * These strings should match the VERT_RESULT_x and FRAG_RESULT_x tokens. + */ const char *vertResults[] = { "result.position", "result.color.primary", @@ -184,7 +190,12 @@ arb_output_attrib_string(GLint index, GLenum progType) }; const char *fragResults[] = { "result.color", - "result.depth" + "result.color(half)", + "result.depth", + "result.color[0]", + "result.color[1]", + "result.color[2]", + "result.color[3]" }; if (progType == GL_VERTEX_PROGRAM_ARB) { -- cgit v1.2.3 From 8d475822e6e19fa79719c856a2db5b6a205db1b9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 28 Feb 2009 11:49:46 -0700 Subject: mesa: rename, reorder FRAG_RESULT_x tokens s/FRAG_RESULT_DEPR/FRAG_RESULT_DEPTH/ s/FRAG_RESULT_COLR/FRAG_RESULT/COLOR/ Remove FRAG_RESULT_COLH (NV half-precision) output since we never used it. Next, we might merge the COLOR and DATA outputs (COLOR0, COLOR1, etc). --- src/mesa/shader/arbprogparse.c | 4 ++-- src/mesa/shader/nvfragparse.c | 40 ++++++++++++----------------------- src/mesa/shader/nvfragparse.h | 5 ----- src/mesa/shader/prog_debug.c | 12 ++++------- src/mesa/shader/program.c | 6 +++--- src/mesa/shader/programopt.c | 6 +++--- src/mesa/shader/slang/slang_codegen.c | 4 ++-- src/mesa/shader/slang/slang_link.c | 2 +- 8 files changed, 28 insertions(+), 51 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 62edb7f595..ccc0318a53 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -1688,7 +1688,7 @@ parse_result_binding(GLcontext *ctx, const GLubyte **inst, */ parse_output_color_num(ctx, inst, Program, &out_color); ASSERT(out_color < MAX_DRAW_BUFFERS); - *outputReg = FRAG_RESULT_COLR; + *outputReg = FRAG_RESULT_COLOR; } else { /* for vtx programs, this is VERTEX_RESULT_POSITION */ @@ -1699,7 +1699,7 @@ parse_result_binding(GLcontext *ctx, const GLubyte **inst, case FRAGMENT_RESULT_DEPTH: if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { /* for frag programs, this is FRAGMENT_RESULT_DEPTH */ - *outputReg = FRAG_RESULT_DEPR; + *outputReg = FRAG_RESULT_DEPTH; } else { /* for vtx programs, this is VERTEX_RESULT_COLOR */ diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 20e4781372..37418ffb6e 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -384,18 +384,12 @@ static const char *InputRegisters[MAX_NV_FRAGMENT_PROGRAM_INPUTS + 1] = { "TEX0", "TEX1", "TEX2", "TEX3", "TEX4", "TEX5", "TEX6", "TEX7", NULL }; + static const char *OutputRegisters[MAX_NV_FRAGMENT_PROGRAM_OUTPUTS + 1] = { - "COLR", "COLH", - /* These are only allows for register combiners */ - /* - "TEX0", "TEX1", "TEX2", "TEX3", - */ - "DEPR", NULL + "DEPR", "COLR", "DATA0", NULL }; - - /**********************************************************************/ /** @@ -828,7 +822,6 @@ static GLboolean Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) { GLubyte token[100]; - GLint j; /* Match "o[" */ if (!Parse_String(parseState, "o[")) @@ -839,19 +832,19 @@ Parse_OutputReg(struct parse_state *parseState, GLint *outputRegNum) RETURN_ERROR; /* try to match an output register name */ - for (j = 0; OutputRegisters[j]; j++) { - if (_mesa_strcmp((const char *) token, OutputRegisters[j]) == 0) { - static GLuint bothColors = (1 << FRAG_RESULT_COLR) | (1 << FRAG_RESULT_COLH); - *outputRegNum = j; - parseState->outputsWritten |= (1 << j); - if ((parseState->outputsWritten & bothColors) == bothColors) { - RETURN_ERROR1("Illegal to write to both o[COLR] and o[COLH]"); - } - break; - } + if (_mesa_strcmp((char *) token, "COLR") == 0 || + _mesa_strcmp((char *) token, "COLH") == 0) { + /* note that we don't distinguish between COLR and COLH */ + *outputRegNum = FRAG_RESULT_COLOR; + parseState->outputsWritten |= (1 << FRAG_RESULT_COLOR); } - if (!OutputRegisters[j]) + else if (_mesa_strcmp((char *) token, "DEPR") == 0) { + *outputRegNum = FRAG_RESULT_DEPTH; + parseState->outputsWritten |= (1 << FRAG_RESULT_DEPTH); + } + else { RETURN_ERROR1("Invalid output register name"); + } /* Match ']' */ if (!Parse_String(parseState, "]")) @@ -1826,10 +1819,3 @@ _mesa_nv_fragment_input_register_name(GLuint i) return InputRegisters[i]; } - -const char * -_mesa_nv_fragment_output_register_name(GLuint i) -{ - ASSERT(i < MAX_NV_FRAGMENT_PROGRAM_OUTPUTS); - return OutputRegisters[i]; -} diff --git a/src/mesa/shader/nvfragparse.h b/src/mesa/shader/nvfragparse.h index de45cf543d..ac97921080 100644 --- a/src/mesa/shader/nvfragparse.h +++ b/src/mesa/shader/nvfragparse.h @@ -44,9 +44,4 @@ _mesa_print_nv_fragment_program(const struct gl_fragment_program *program); extern const char * _mesa_nv_fragment_input_register_name(GLuint i); - -extern const char * -_mesa_nv_fragment_output_register_name(GLuint i); - - #endif diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c index 7bcb2ef734..35ce37d5ce 100644 --- a/src/mesa/shader/prog_debug.c +++ b/src/mesa/shader/prog_debug.c @@ -222,20 +222,16 @@ _mesa_GetProgramRegisterfvMESA(GLenum target, "glGetProgramRegisterfvMESA(registerName)"); return; } - else if (_mesa_strcmp(reg, "o[COLR]") == 0) { + else if (_mesa_strcmp(reg, "o[COLR]") == 0 || + _mesa_strcmp(reg, "o[COLH]") == 0) { /* Fragment output color */ ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLR, v); - } - else if (_mesa_strcmp(reg, "o[COLH]") == 0) { - /* Fragment output color */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLH, v); + FRAG_RESULT_COLOR, v); } else if (_mesa_strcmp(reg, "o[DEPR]") == 0) { /* Fragment output depth */ ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_DEPR, v); + FRAG_RESULT_DEPTH, v); } else { /* try user-defined identifiers */ diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 00655f0288..2e5632710e 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -738,7 +738,7 @@ _mesa_combine_programs(GLcontext *ctx, /* Connect color outputs of fprogA to color inputs of fprogB, via a * new temporary register. */ - if ((progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) && + if ((progA->OutputsWritten & (1 << FRAG_RESULT_COLOR)) && (progB_inputsRead & FRAG_BIT_COL0)) { GLint tempReg = _mesa_find_free_register(newProg, PROGRAM_TEMPORARY); if (tempReg < 0) { @@ -748,7 +748,7 @@ _mesa_combine_programs(GLcontext *ctx, } /* replace writes to result.color[0] with tempReg */ replace_registers(newInst, lenA, - PROGRAM_OUTPUT, FRAG_RESULT_COLR, + PROGRAM_OUTPUT, FRAG_RESULT_COLOR, PROGRAM_TEMPORARY, tempReg); /* replace reads from the input color with tempReg */ replace_registers(newInst + lenA, lenB, @@ -758,7 +758,7 @@ _mesa_combine_programs(GLcontext *ctx, /* compute combined program's InputsRead */ inputsB = progB_inputsRead; - if (progA->OutputsWritten & (1 << FRAG_RESULT_COLR)) { + if (progA->OutputsWritten & (1 << FRAG_RESULT_COLOR)) { inputsB &= ~(1 << FRAG_ATTRIB_COL0); } newProg->InputsRead = progA->InputsRead | inputsB; diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 56f1eb832e..05d9bdf7ec 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -171,7 +171,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) if (inst->Opcode == OPCODE_END) break; if (inst->DstReg.File == PROGRAM_OUTPUT && - inst->DstReg.Index == FRAG_RESULT_COLR) { + inst->DstReg.Index == FRAG_RESULT_COLOR) { /* change the instruction to write to colorTemp w/ clamping */ inst->DstReg.File = PROGRAM_TEMPORARY; inst->DstReg.Index = colorTemp; @@ -249,7 +249,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) /* LRP result.color.xyz, fogFactorTemp.xxxx, colorTemp, fogColorRef; */ inst->Opcode = OPCODE_LRP; inst->DstReg.File = PROGRAM_OUTPUT; - inst->DstReg.Index = FRAG_RESULT_COLR; + inst->DstReg.Index = FRAG_RESULT_COLOR; inst->DstReg.WriteMask = WRITEMASK_XYZ; inst->SrcReg[0].File = PROGRAM_TEMPORARY; inst->SrcReg[0].Index = fogFactorTemp; @@ -264,7 +264,7 @@ _mesa_append_fog_code(GLcontext *ctx, struct gl_fragment_program *fprog) /* MOV result.color.w, colorTemp.x; # copy alpha */ inst->Opcode = OPCODE_MOV; inst->DstReg.File = PROGRAM_OUTPUT; - inst->DstReg.Index = FRAG_RESULT_COLR; + inst->DstReg.Index = FRAG_RESULT_COLOR; inst->DstReg.WriteMask = WRITEMASK_W; inst->SrcReg[0].File = PROGRAM_TEMPORARY; inst->SrcReg[0].Index = colorTemp; diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 5e2ce0ce3a..ee24e2e138 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -450,8 +450,8 @@ _slang_output_index(const char *name, GLenum target) { NULL, 0 } }; static const struct output_info fragOutputs[] = { - { "gl_FragColor", FRAG_RESULT_COLR }, - { "gl_FragDepth", FRAG_RESULT_DEPR }, + { "gl_FragColor", FRAG_RESULT_COLOR }, + { "gl_FragDepth", FRAG_RESULT_DEPTH }, { "gl_FragData", FRAG_RESULT_DATA0 }, { NULL, 0 } }; diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index bcabe71bfa..f98434892b 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -686,7 +686,7 @@ _slang_link(GLcontext *ctx, /* check that gl_FragColor and gl_FragData are not both written to */ if (shProg->FragmentProgram) { GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten; - if ((outputsWritten & ((1 << FRAG_RESULT_COLR))) && + if ((outputsWritten & ((1 << FRAG_RESULT_COLOR))) && (outputsWritten >= (1 << FRAG_RESULT_DATA0))) { link_error(shProg, "Fragment program cannot write both gl_FragColor" " and gl_FragData[].\n"); -- cgit v1.2.3 From 945dcbfca62b9b57340caccc1b8286b2f3e743bc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Mar 2009 07:57:40 -0700 Subject: mesa: include mfeatures.h See bug 20319. --- src/mesa/shader/prog_instruction.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index 3808644550..95dd7fda7f 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -38,6 +38,9 @@ #define PROG_INSTRUCTION_H +#include "main/mfeatures.h" + + /** * Swizzle indexes. * Do not change! -- cgit v1.2.3 From f787baff80235e8f90a72d43d4372b1ac977f161 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Mar 2009 17:14:05 -0700 Subject: mesa: when printing src regs, use |reg| for absolute value And check opcode number to avoid crashing on driver-private opcodes. --- src/mesa/shader/prog_print.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 2747480834..6988e9c052 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -458,11 +458,15 @@ fprint_src_reg(FILE *f, gl_prog_print_mode mode, const struct gl_program *prog) { - _mesa_fprintf(f, "%s%s", + const char *abs = srcReg->Abs ? "|" : ""; + + _mesa_fprintf(f, "%s%s%s%s", + abs, reg_string((enum register_file) srcReg->File, srcReg->Index, mode, srcReg->RelAddr, prog), _mesa_swizzle_string(srcReg->Swizzle, - srcReg->NegateBase, GL_FALSE)); + srcReg->NegateBase, GL_FALSE), + abs); #if 0 _mesa_fprintf(f, "%s[%d]%s", file_string((enum register_file) srcReg->File, mode), @@ -724,11 +728,16 @@ _mesa_fprint_instruction_opt(FILE *f, break; /* XXX may need other special-case instructions */ default: - /* typical alu instruction */ - fprint_alu_instruction(f, inst, - _mesa_opcode_string(inst->Opcode), - _mesa_num_inst_src_regs(inst->Opcode), - mode, prog); + if (inst->Opcode < MAX_OPCODE) { + /* typical alu instruction */ + fprint_alu_instruction(f, inst, + _mesa_opcode_string(inst->Opcode), + _mesa_num_inst_src_regs(inst->Opcode), + mode, prog); + } + else { + _mesa_fprintf(f, "Other opcode %d\n", inst->Opcode); + } break; } return indent; -- cgit v1.2.3 From be8c0b25eaf67b7deefe7844d0b8ed19abad8d86 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Mar 2009 17:14:29 -0700 Subject: mesa: added some assertions --- src/mesa/shader/prog_instruction.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_instruction.c b/src/mesa/shader/prog_instruction.c index 4a6d0d670a..6a21152c60 100644 --- a/src/mesa/shader/prog_instruction.c +++ b/src/mesa/shader/prog_instruction.c @@ -254,6 +254,7 @@ static const struct instruction_info InstInfo[MAX_OPCODE] = { GLuint _mesa_num_inst_src_regs(gl_inst_opcode opcode) { + ASSERT(opcode < MAX_OPCODE); ASSERT(opcode == InstInfo[opcode].Opcode); ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); return InstInfo[opcode].NumSrcRegs; @@ -266,6 +267,7 @@ _mesa_num_inst_src_regs(gl_inst_opcode opcode) GLuint _mesa_num_inst_dst_regs(gl_inst_opcode opcode) { + ASSERT(opcode < MAX_OPCODE); ASSERT(opcode == InstInfo[opcode].Opcode); ASSERT(OPCODE_XPD == InstInfo[OPCODE_XPD].Opcode); return InstInfo[opcode].NumDstRegs; -- cgit v1.2.3 From 82f1c0be1325130ab03d3bef629264618924b897 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Mar 2009 16:18:22 -0700 Subject: mesa: add new program optimizer code This is pretty simplistic for now, but helps with certain shaders. --- src/mesa/shader/prog_optimize.c | 427 ++++++++++++++++++++++++++++++++++++++++ src/mesa/shader/prog_optimize.h | 33 ++++ 2 files changed, 460 insertions(+) create mode 100644 src/mesa/shader/prog_optimize.c create mode 100644 src/mesa/shader/prog_optimize.h (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c new file mode 100644 index 0000000000..ec06da141d --- /dev/null +++ b/src/mesa/shader/prog_optimize.c @@ -0,0 +1,427 @@ +/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + + +#include "main/glheader.h" +#include "main/context.h" +#include "main/macros.h" +#include "program.h" +#include "prog_instruction.h" +#include "prog_optimize.h" +#include "prog_print.h" + + +static GLboolean dbg = GL_FALSE; + + +/** + * In 'prog' remove instruction[i] if removeFlags[i] == TRUE. + * \return number of instructions removed + */ +static GLuint +remove_instructions(struct gl_program *prog, const GLboolean *removeFlags) +{ + GLint i, removeEnd = 0, removeCount = 0; + GLuint totalRemoved = 0; + + /* go backward */ + for (i = prog->NumInstructions - 1; i >= 0; i--) { + if (removeFlags[i]) { + totalRemoved++; + if (removeCount == 0) { + /* begin a run of instructions to remove */ + removeEnd = i; + removeCount = 1; + } + else { + /* extend the run of instructions to remove */ + removeCount++; + } + } + else { + /* don't remove this instruction, but check if the preceeding + * instructions are to be removed. + */ + if (removeCount > 0) { + GLint removeStart = removeEnd - removeCount + 1; + _mesa_delete_instructions(prog, removeStart, removeCount); + removeStart = removeCount = 0; /* reset removal info */ + } + } + } + return totalRemoved; +} + + +/** + * Consolidate temporary registers to use low numbers. For example, if the + * shader only uses temps 4, 5, 8, replace them with 0, 1, 2. + */ +static void +_mesa_consolidate_registers(struct gl_program *prog) +{ + GLboolean tempUsed[MAX_PROGRAM_TEMPS]; + GLuint tempMap[MAX_PROGRAM_TEMPS]; + GLuint tempMax = 0, i; + + if (dbg) { + _mesa_printf("Optimize: Begin register consolidation\n"); + } + + memset(tempUsed, 0, sizeof(tempUsed)); + + /* set tempUsed[i] if temporary [i] is referenced */ + for (i = 0; i < prog->NumInstructions; i++) { + const struct prog_instruction *inst = prog->Instructions + i; + const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); + GLuint j; + for (j = 0; j < numSrc; j++) { + if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { + const GLuint index = inst->SrcReg[j].Index; + ASSERT(index < MAX_PROGRAM_TEMPS); + tempUsed[index] = GL_TRUE; + tempMax = MAX2(tempMax, index); + break; + } + } + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + const GLuint index = inst->DstReg.Index; + ASSERT(index < MAX_PROGRAM_TEMPS); + tempUsed[index] = GL_TRUE; + tempMax = MAX2(tempMax, index); + } + } + + /* allocate a new index for each temp that's used */ + { + GLuint freeTemp = 0; + for (i = 0; i <= tempMax; i++) { + if (tempUsed[i]) { + tempMap[i] = freeTemp++; + /*_mesa_printf("replace %u with %u\n", i, tempMap[i]);*/ + } + } + if (freeTemp == tempMax + 1) { + /* no consolidation possible */ + return; + } + if (dbg) { + _mesa_printf("Replace regs 0..%u with 0..%u\n", tempMax, freeTemp-1); + } + } + + /* now replace occurances of old temp indexes with new indexes */ + for (i = 0; i < prog->NumInstructions; i++) { + struct prog_instruction *inst = prog->Instructions + i; + const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); + GLuint j; + for (j = 0; j < numSrc; j++) { + if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { + GLuint index = inst->SrcReg[j].Index; + assert(index <= tempMax); + assert(tempUsed[index]); + inst->SrcReg[j].Index = tempMap[index]; + } + } + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + const GLuint index = inst->DstReg.Index; + assert(tempUsed[index]); + assert(index <= tempMax); + inst->DstReg.Index = tempMap[index]; + } + } + if (dbg) { + _mesa_printf("Optimize: End register consolidation\n"); + } +} + + +/** + * Remove dead instructions from the given program. + * This is very primitive for now. Basically look for temp registers + * that are written to but never read. Remove any instructions that + * write to such registers. Be careful with condition code setters. + */ +static void +_mesa_remove_dead_code(struct gl_program *prog) +{ + GLboolean tempWritten[MAX_PROGRAM_TEMPS], tempRead[MAX_PROGRAM_TEMPS]; + GLboolean *removeInst; /* per-instruction removal flag */ + GLuint i, rem; + + memset(tempWritten, 0, sizeof(tempWritten)); + memset(tempRead, 0, sizeof(tempRead)); + + if (dbg) { + _mesa_printf("Optimize: Begin dead code removal\n"); + /*_mesa_print_program(prog);*/ + } + + removeInst = (GLboolean *) + _mesa_calloc(prog->NumInstructions * sizeof(GLboolean)); + + /* Determine which temps are read and written */ + for (i = 0; i < prog->NumInstructions; i++) { + const struct prog_instruction *inst = prog->Instructions + i; + const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); + GLuint j; + + /* check src regs */ + for (j = 0; j < numSrc; j++) { + if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { + const GLuint index = inst->SrcReg[j].Index; + ASSERT(index < MAX_PROGRAM_TEMPS); + + if (inst->SrcReg[j].RelAddr) { + if (dbg) + _mesa_printf("abort remove dead code (indirect temp)\n"); + return; + } + + tempRead[index] = GL_TRUE; + } + } + + /* check dst reg */ + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + const GLuint index = inst->DstReg.Index; + ASSERT(index < MAX_PROGRAM_TEMPS); + + if (inst->DstReg.RelAddr) { + if (dbg) + _mesa_printf("abort remove dead code (indirect temp)\n"); + return; + } + + tempWritten[index] = GL_TRUE; + if (inst->CondUpdate) { + /* If we're writing to this register and setting condition + * codes we cannot remove the instruction. Prevent removal + * by setting the 'read' flag. + */ + tempRead[index] = GL_TRUE; + } + } + } + + if (dbg) { + for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { + if (tempWritten[i] && !tempRead[i]) + _mesa_printf("Remove writes to tmp %u\n", i); + } + } + + /* find instructions that write to dead registers, flag for removal */ + for (i = 0; i < prog->NumInstructions; i++) { + const struct prog_instruction *inst = prog->Instructions + i; + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + GLint index = inst->DstReg.Index; + removeInst[i] = (tempWritten[index] && !tempRead[index]); + if (dbg && removeInst[i]) { + _mesa_printf("Remove inst %u: ", i); + _mesa_print_instruction(inst); + } + } + } + + /* now remove the instructions which aren't needed */ + rem = remove_instructions(prog, removeInst); + + _mesa_free(removeInst); + + if (dbg) { + _mesa_printf("Optimize: End dead code removal. %u instructions removed\n", rem); + /*_mesa_print_program(prog);*/ + } +} + + +enum temp_use +{ + READ, + WRITE, + FLOW, + END +}; + +/** + * Scan forward in program from 'start' for the next occurance of TEMP[index]. + * Return READ, WRITE, FLOW or END to indicate the next usage or an indicator + * that we can't look further. + */ +static enum temp_use +find_next_temp_use(const struct gl_program *prog, GLuint start, GLuint index) +{ + GLuint i; + + for (i = start; i < prog->NumInstructions; i++) { + const struct prog_instruction *inst = prog->Instructions + i; + switch (inst->Opcode) { + case OPCODE_BGNLOOP: + case OPCODE_ENDLOOP: + case OPCODE_BGNSUB: + case OPCODE_ENDSUB: + return FLOW; + default: + { + const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); + GLuint j; + for (j = 0; j < numSrc; j++) { + if (inst->SrcReg[j].File == PROGRAM_TEMPORARY && + inst->SrcReg[j].Index == index) + return READ; + } + if (inst->DstReg.File == PROGRAM_TEMPORARY && + inst->DstReg.Index == index) + return WRITE; + } + } + } + + return END; +} + + +/** + * Try to remove extraneous MOV instructions from the given program. + */ +static void +_mesa_remove_extra_moves(struct gl_program *prog) +{ + GLboolean *removeInst; /* per-instruction removal flag */ + GLuint i, rem, loopNesting = 0, subroutineNesting = 0; + + if (dbg) { + _mesa_printf("Optimize: Begin remove extra moves\n"); + _mesa_print_program(prog); + } + + removeInst = (GLboolean *) + _mesa_calloc(prog->NumInstructions * sizeof(GLboolean)); + + /* + * Look for sequences such as this: + * FOO tmpX, arg0, arg1; + * MOV tmpY, tmpX; + * and convert into: + * FOO tmpY, arg0, arg1; + */ + + for (i = 0; i < prog->NumInstructions; i++) { + const struct prog_instruction *inst = prog->Instructions + i; + + switch (inst->Opcode) { + case OPCODE_BGNLOOP: + loopNesting++; + break; + case OPCODE_ENDLOOP: + loopNesting--; + break; + case OPCODE_BGNSUB: + subroutineNesting++; + break; + case OPCODE_ENDSUB: + subroutineNesting--; + break; + case OPCODE_MOV: + if (i > 0 && + loopNesting == 0 && + subroutineNesting == 0 && + inst->SrcReg[0].File == PROGRAM_TEMPORARY && + inst->SrcReg[0].Swizzle == SWIZZLE_XYZW) { + /* see if this MOV can be removed */ + const GLuint tempIndex = inst->SrcReg[0].Index; + struct prog_instruction *prevInst; + GLuint prevI; + + /* get pointer to previous instruction */ + prevI = i - 1; + while (removeInst[prevI] && prevI > 0) + prevI--; + prevInst = prog->Instructions + prevI; + + if (prevInst->DstReg.File == PROGRAM_TEMPORARY && + prevInst->DstReg.Index == tempIndex && + prevInst->DstReg.WriteMask == WRITEMASK_XYZW) { + + enum temp_use next_use = + find_next_temp_use(prog, i + 1, tempIndex); + + if (next_use == WRITE || next_use == END) { + /* OK, we can safely remove this MOV instruction. + * Transform: + * prevI: FOO tempIndex, x, y; + * i: MOV z, tempIndex; + * Into: + * prevI: FOO z, x, y; + */ + + /* patch up prev inst */ + prevInst->DstReg.File = inst->DstReg.File; + prevInst->DstReg.Index = inst->DstReg.Index; + + /* flag this instruction for removal */ + removeInst[i] = GL_TRUE; + + if (dbg) { + _mesa_printf("Remove MOV at %u\n", i); + _mesa_printf("new prev inst %u: ", prevI); + _mesa_print_instruction(prevInst); + } + } + } + } + break; + default: + ; /* nothing */ + } + } + + /* now remove the instructions which aren't needed */ + rem = remove_instructions(prog, removeInst); + + if (dbg) { + _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); + /*_mesa_print_program(prog);*/ + } +} + + +/** + * Apply optimizations to the given program to eliminate unnecessary + * instructions, temp regs, etc. + */ +void +_mesa_optimize_program(GLcontext *ctx, struct gl_program *program) +{ + if (1) + _mesa_remove_dead_code(program); + + if (0) /* not test much yet */ + _mesa_remove_extra_moves(program); + + if (1) + _mesa_consolidate_registers(program); +} diff --git a/src/mesa/shader/prog_optimize.h b/src/mesa/shader/prog_optimize.h new file mode 100644 index 0000000000..d102cfd9fc --- /dev/null +++ b/src/mesa/shader/prog_optimize.h @@ -0,0 +1,33 @@ +/* + * Mesa 3-D graphics library + * Version: 7.5 + * + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef PROG_OPT_H +#define PROG_OPT_H + +struct gl_program; + +extern void +_mesa_optimize_program(GLcontext *ctx, struct gl_program *program); + +#endif -- cgit v1.2.3 From 0945b78244d6a86dbe3c35f4cfcd6a9ff524930e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Mar 2009 15:45:01 -0700 Subject: glsl: call the program optimizer This still needs more testing bug glean and Mesa GLSL tests seem OK. --- src/mesa/shader/slang/slang_compile.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index ab848579b7..3f46bfd60d 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -32,6 +32,7 @@ #include "main/context.h" #include "shader/program.h" #include "shader/programopt.h" +#include "shader/prog_optimize.h" #include "shader/prog_print.h" #include "shader/prog_parameter.h" #include "shader/grammar/grammar_mesa.h" @@ -2796,6 +2797,10 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = success; + if (success) { + _mesa_optimize_program(ctx, shader->Program); + } + if (ctx->Shader.Flags & GLSL_LOG) { _mesa_write_shader_to_file(shader); } -- cgit v1.2.3 From 69e07bdeb42f2454f5052f86119adfb68f253098 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Mar 2009 11:53:18 -0700 Subject: mesa: remove GL_MESA_program_debug extension This was never fully fleshed out and hasn't been used. --- src/mesa/shader/arbprogparse.c | 9 -- src/mesa/shader/nvfragparse.c | 4 - src/mesa/shader/nvvertparse.c | 7 - src/mesa/shader/prog_debug.c | 255 ------------------------------------- src/mesa/shader/prog_debug.h | 44 ------- src/mesa/shader/prog_execute.c | 41 ------ src/mesa/shader/prog_instruction.h | 5 - 7 files changed, 365 deletions(-) delete mode 100644 src/mesa/shader/prog_debug.c delete mode 100644 src/mesa/shader/prog_debug.h (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index ccc0318a53..75398cda90 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -2752,9 +2752,6 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, _mesa_init_instructions(fp, 1); - /* Record the position in the program string for debugging */ - fp->StringPos = Program->Position; - /* OP_ALU_INST or OP_TEX_INST */ instClass = *(*inst)++; @@ -3194,8 +3191,6 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst, code = *(*inst)++; _mesa_init_instructions(vp, 1); - /* Record the position in the program string for debugging */ - vp->StringPos = Program->Position; switch (type) { /* XXX: */ @@ -3557,10 +3552,6 @@ parse_instructions(GLcontext * ctx, const GLubyte * inst, const GLuint numInst = Program->Base.NumInstructions; _mesa_init_instructions(Program->Base.Instructions + numInst, 1); Program->Base.Instructions[numInst].Opcode = OPCODE_END; - /* YYY Wrong Position in program, whatever, at least not random -> crash - Program->Position = parse_position (&inst); - */ - Program->Base.Instructions[numInst].StringPos = Program->Position; } Program->Base.NumInstructions++; diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 37418ffb6e..b935cb562a 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -1311,8 +1311,6 @@ Parse_InstructionSequence(struct parse_state *parseState, } else if (Parse_String(parseState, "END")) { inst->Opcode = OPCODE_END; - inst->StringPos = parseState->curLine - parseState->start; - assert(inst->StringPos >= 0); parseState->numInst++; if (Parse_Token(parseState, token)) { RETURN_ERROR1("Code after END opcode."); @@ -1339,8 +1337,6 @@ Parse_InstructionSequence(struct parse_state *parseState, inst->SaturateMode = (instMatch.suffixes & (_S)) ? SATURATE_ZERO_ONE : SATURATE_OFF; inst->CondUpdate = (instMatch.suffixes & (_C)) ? GL_TRUE : GL_FALSE; - inst->StringPos = parseState->curLine - parseState->start; - assert(inst->StringPos >= 0); /* * parse the input and output operands diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 08538c0ee4..268b577aec 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -799,7 +799,6 @@ Parse_UnaryOpInstruction(struct parse_state *parseState, RETURN_ERROR1("ABS illegal for vertex program 1.0"); inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; /* dest reg */ if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) @@ -832,7 +831,6 @@ Parse_BiOpInstruction(struct parse_state *parseState, RETURN_ERROR1("SUB illegal for vertex program 1.0"); inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; /* dest reg */ if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) @@ -880,7 +878,6 @@ Parse_TriOpInstruction(struct parse_state *parseState, enum prog_opcode opcode) { inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; /* dest reg */ if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) @@ -951,7 +948,6 @@ Parse_ScalarInstruction(struct parse_state *parseState, RETURN_ERROR1("RCC illegal for vertex program 1.0"); inst->Opcode = opcode; - inst->StringPos = parseState->curLine - parseState->start; /* dest reg */ if (!Parse_MaskedDstReg(parseState, &inst->DstReg)) @@ -977,7 +973,6 @@ static GLboolean Parse_AddressInstruction(struct parse_state *parseState, struct prog_instruction *inst) { inst->Opcode = OPCODE_ARL; - inst->StringPos = parseState->curLine - parseState->start; /* Make ARB_vp backends happy */ inst->DstReg.File = PROGRAM_ADDRESS; @@ -1010,7 +1005,6 @@ Parse_EndInstruction(struct parse_state *parseState, struct prog_instruction *in GLubyte token[100]; inst->Opcode = OPCODE_END; - inst->StringPos = parseState->curLine - parseState->start; /* this should fail! */ if (Parse_Token(parseState, token)) @@ -1044,7 +1038,6 @@ Parse_PrintInstruction(struct parse_state *parseState, struct prog_instruction * GLint idx; inst->Opcode = OPCODE_PRINT; - inst->StringPos = parseState->curLine - parseState->start; /* The first argument is a literal string 'just like this' */ if (!Parse_String(parseState, "'")) diff --git a/src/mesa/shader/prog_debug.c b/src/mesa/shader/prog_debug.c deleted file mode 100644 index 35ce37d5ce..0000000000 --- a/src/mesa/shader/prog_debug.c +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "nvfragparse.h" -#include "nvvertparse.h" -#include "program.h" -#include "prog_debug.h" -#include "prog_parameter.h" -#include "prog_instruction.h" - - - -/** - * Functions for the experimental GL_MESA_program_debug extension. - */ - - -/* XXX temporary */ -GLAPI void GLAPIENTRY -glProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data) -{ - _mesa_ProgramCallbackMESA(target, callback, data); -} - - -void -_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data) -{ - GET_CURRENT_CONTEXT(ctx); - - switch (target) { - case GL_FRAGMENT_PROGRAM_ARB: - if (!ctx->Extensions.ARB_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } - ctx->FragmentProgram.Callback = callback; - ctx->FragmentProgram.CallbackData = data; - break; - case GL_FRAGMENT_PROGRAM_NV: - if (!ctx->Extensions.NV_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } - ctx->FragmentProgram.Callback = callback; - ctx->FragmentProgram.CallbackData = data; - break; - case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - if (!ctx->Extensions.ARB_vertex_program && - !ctx->Extensions.NV_vertex_program) { - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } - ctx->VertexProgram.Callback = callback; - ctx->VertexProgram.CallbackData = data; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glProgramCallbackMESA(target)"); - return; - } -} - - -/* XXX temporary */ -GLAPI void GLAPIENTRY -glGetProgramRegisterfvMESA(GLenum target, - GLsizei len, const GLubyte *registerName, - GLfloat *v) -{ - _mesa_GetProgramRegisterfvMESA(target, len, registerName, v); -} - - -void -_mesa_GetProgramRegisterfvMESA(GLenum target, - GLsizei len, const GLubyte *registerName, - GLfloat *v) -{ - char reg[1000]; - GET_CURRENT_CONTEXT(ctx); - - /* We _should_ be inside glBegin/glEnd */ -#if 0 - if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glGetProgramRegisterfvMESA"); - return; - } -#endif - - /* make null-terminated copy of registerName */ - len = MIN2((unsigned int) len, sizeof(reg) - 1); - _mesa_memcpy(reg, registerName, len); - reg[len] = 0; - - switch (target) { - case GL_VERTEX_PROGRAM_ARB: /* == GL_VERTEX_PROGRAM_NV */ - if (!ctx->Extensions.ARB_vertex_program && - !ctx->Extensions.NV_vertex_program) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } - if (!ctx->VertexProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetProgramRegisterfvMESA"); - return; - } - /* GL_NV_vertex_program */ - if (reg[0] == 'R') { - /* Temp register */ - GLint i = _mesa_atoi(reg + 1); - if (i >= (GLint)ctx->Const.VertexProgram.MaxTemps) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - ctx->Driver.GetProgramRegister(ctx, PROGRAM_TEMPORARY, i, v); - } - else if (reg[0] == 'v' && reg[1] == '[') { - /* Vertex Input attribute */ - GLuint i; - for (i = 0; i < ctx->Const.VertexProgram.MaxAttribs; i++) { - const char *name = _mesa_nv_vertex_input_register_name(i); - char number[10]; - _mesa_sprintf(number, "%d", i); - if (_mesa_strncmp(reg + 2, name, 4) == 0 || - _mesa_strncmp(reg + 2, number, _mesa_strlen(number)) == 0) { - ctx->Driver.GetProgramRegister(ctx, PROGRAM_INPUT, i, v); - return; - } - } - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - else if (reg[0] == 'o' && reg[1] == '[') { - /* Vertex output attribute */ - } - /* GL_ARB_vertex_program */ - else if (_mesa_strncmp(reg, "vertex.", 7) == 0) { - - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - break; - case GL_FRAGMENT_PROGRAM_ARB: - if (!ctx->Extensions.ARB_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } - if (!ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetProgramRegisterfvMESA"); - return; - } - /* XXX to do */ - break; - case GL_FRAGMENT_PROGRAM_NV: - if (!ctx->Extensions.NV_fragment_program) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } - if (!ctx->FragmentProgram._Enabled) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetProgramRegisterfvMESA"); - return; - } - if (reg[0] == 'R') { - /* Temp register */ - GLint i = _mesa_atoi(reg + 1); - if (i >= (GLint)ctx->Const.FragmentProgram.MaxTemps) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - ctx->Driver.GetProgramRegister(ctx, PROGRAM_TEMPORARY, - i, v); - } - else if (reg[0] == 'f' && reg[1] == '[') { - /* Fragment input attribute */ - GLuint i; - for (i = 0; i < ctx->Const.FragmentProgram.MaxAttribs; i++) { - const char *name = _mesa_nv_fragment_input_register_name(i); - if (_mesa_strncmp(reg + 2, name, 4) == 0) { - ctx->Driver.GetProgramRegister(ctx, PROGRAM_INPUT, i, v); - return; - } - } - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - else if (_mesa_strcmp(reg, "o[COLR]") == 0 || - _mesa_strcmp(reg, "o[COLH]") == 0) { - /* Fragment output color */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_COLOR, v); - } - else if (_mesa_strcmp(reg, "o[DEPR]") == 0) { - /* Fragment output depth */ - ctx->Driver.GetProgramRegister(ctx, PROGRAM_OUTPUT, - FRAG_RESULT_DEPTH, v); - } - else { - /* try user-defined identifiers */ - const GLfloat *value = _mesa_lookup_parameter_value( - ctx->FragmentProgram.Current->Base.Parameters, -1, reg); - if (value) { - COPY_4V(v, value); - } - else { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetProgramRegisterfvMESA(registerName)"); - return; - } - } - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetProgramRegisterfvMESA(target)"); - return; - } -} diff --git a/src/mesa/shader/prog_debug.h b/src/mesa/shader/prog_debug.h deleted file mode 100644 index fc400e19de..0000000000 --- a/src/mesa/shader/prog_debug.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.3 - * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - -#ifndef PROG_DEBUG_H -#define PROG_DEBUG_H 1 - - -/* - * GL_MESA_program_debug - */ - -extern void -_mesa_ProgramCallbackMESA(GLenum target, GLprogramcallbackMESA callback, - GLvoid *data); - -extern void -_mesa_GetProgramRegisterfvMESA(GLenum target, GLsizei len, - const GLubyte *registerName, GLfloat *v); - - - -#endif /* PROG_DEBUG_H */ diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index a93733c085..a60cda674b 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -186,30 +186,6 @@ get_dst_register_pointer(const struct prog_dst_register *dest, -#if FEATURE_MESA_program_debug -static struct gl_program_machine *CurrentMachine = NULL; - -/** - * For GL_MESA_program_debug. - * Return current value (4*GLfloat) of a program register. - * Called via ctx->Driver.GetProgramRegister(). - */ -void -_mesa_get_program_register(GLcontext *ctx, enum register_file file, - GLuint index, GLfloat val[4]) -{ - if (CurrentMachine) { - struct prog_src_register srcReg; - const GLfloat *src; - srcReg.File = file; - srcReg.Index = index; - src = get_src_register_pointer(&srcReg, CurrentMachine); - COPY_4V(val, src); - } -} -#endif /* FEATURE_MESA_program_debug */ - - /** * Fetch a 4-element float vector from the given source register. * Apply swizzling and negating as needed. @@ -633,10 +609,6 @@ _mesa_execute_program(GLcontext * ctx, printf("execute program %u --------------------\n", program->Id); } -#if FEATURE_MESA_program_debug - CurrentMachine = machine; -#endif - if (program->Target == GL_VERTEX_PROGRAM_ARB) { machine->EnvParams = ctx->VertexProgram.Parameters; } @@ -647,15 +619,6 @@ _mesa_execute_program(GLcontext * ctx, for (pc = 0; pc < numInst; pc++) { const struct prog_instruction *inst = program->Instructions + pc; -#if FEATURE_MESA_program_debug - if (ctx->FragmentProgram.CallbackEnabled && - ctx->FragmentProgram.Callback) { - ctx->FragmentProgram.CurrentPosition = inst->StringPos; - ctx->FragmentProgram.Callback(program->Target, - ctx->FragmentProgram.CallbackData); - } -#endif - if (DEBUG_PROG) { _mesa_print_instruction(inst); } @@ -1780,9 +1743,5 @@ _mesa_execute_program(GLcontext * ctx, } /* for pc */ -#if FEATURE_MESA_program_debug - CurrentMachine = NULL; -#endif - return GL_TRUE; } diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index 95dd7fda7f..4adce11f95 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -421,11 +421,6 @@ struct prog_instruction /** for driver use (try to remove someday) */ GLint Aux; - - /* XXX obsolete - remove someday */ -#if FEATURE_MESA_program_debug - GLshort StringPos; -#endif }; -- cgit v1.2.3 From b4026d9be828bd0b6f60158456edf24994efb053 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 7 Mar 2009 12:02:52 -0700 Subject: mesa: gl_register_file enum typedef --- src/mesa/shader/arbprogparse.c | 22 +++++++++++----------- src/mesa/shader/prog_execute.h | 2 +- src/mesa/shader/prog_parameter.c | 6 +++--- src/mesa/shader/prog_parameter.h | 8 ++++---- src/mesa/shader/prog_print.c | 16 ++++++++-------- src/mesa/shader/programopt.c | 2 +- src/mesa/shader/programopt.h | 2 +- src/mesa/shader/slang/slang_codegen.c | 2 +- src/mesa/shader/slang/slang_emit.c | 2 +- src/mesa/shader/slang/slang_ir.c | 10 +++++----- src/mesa/shader/slang/slang_ir.h | 14 +++++++------- 11 files changed, 43 insertions(+), 43 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 75398cda90..cd6289deb5 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -2246,7 +2246,7 @@ parse_declaration (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc static GLuint parse_masked_dst_reg (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, struct arb_program *Program, - enum register_file *File, GLuint *Index, GLint *WriteMask) + gl_register_file *File, GLuint *Index, GLint *WriteMask) { GLuint tmp, result; struct var_cache *dst; @@ -2478,7 +2478,7 @@ static GLuint parse_src_reg (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, struct arb_program *Program, - enum register_file * File, GLint * Index, + gl_register_file * File, GLint * Index, GLboolean *IsRelOffset ) { struct var_cache *src; @@ -2527,7 +2527,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst, return 1; } - *File = (enum register_file) src->param_binding_type; + *File = (gl_register_file) src->param_binding_type; switch (*(*inst)++) { case ARRAY_INDEX_ABSOLUTE: @@ -2573,7 +2573,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst, if (parse_param_use (ctx, inst, vc_head, Program, &src)) return 1; - *File = (enum register_file) src->param_binding_type; + *File = (gl_register_file) src->param_binding_type; *Index = src->param_binding_begin; break; } @@ -2598,7 +2598,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst, /* XXX: We have to handle offsets someplace in here! -- or are those above? */ case vt_param: - *File = (enum register_file) src->param_binding_type; + *File = (gl_register_file) src->param_binding_type; *Index = src->param_binding_begin; break; @@ -2623,7 +2623,7 @@ parse_src_reg (GLcontext * ctx, const GLubyte ** inst, } if (*File == PROGRAM_STATE_VAR) { - enum register_file file; + gl_register_file file; /* If we're referencing the Program->Parameters[] array, check if the * parameter is really a constant/literal. If so, set File to CONSTANT. @@ -2652,7 +2652,7 @@ parse_vector_src_reg(GLcontext *ctx, const GLubyte **inst, struct arb_program *program, struct prog_src_register *reg) { - enum register_file file; + gl_register_file file; GLint index; GLubyte negateMask; GLubyte swizzle[4]; @@ -2686,7 +2686,7 @@ parse_scalar_src_reg(GLcontext *ctx, const GLubyte **inst, struct arb_program *program, struct prog_src_register *reg) { - enum register_file file; + gl_register_file file; GLint index; GLubyte negateMask; GLubyte swizzle[4]; @@ -2722,7 +2722,7 @@ parse_dst_reg(GLcontext * ctx, const GLubyte ** inst, { GLint mask; GLuint idx; - enum register_file file; + gl_register_file file; if (parse_masked_dst_reg (ctx, inst, vc_head, program, &file, &idx, &mask)) return 1; @@ -3013,7 +3013,7 @@ parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, { GLubyte swizzle[4]; GLubyte negateMask; - enum register_file file; + gl_register_file file; GLint index; if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, &rel)) @@ -3354,7 +3354,7 @@ parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst, GLubyte swizzle[4]; GLubyte negateMask; GLboolean relAddr; - enum register_file file; + gl_register_file file; GLint index; if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) diff --git a/src/mesa/shader/prog_execute.h b/src/mesa/shader/prog_execute.h index 8ceb7b092e..adefc5439d 100644 --- a/src/mesa/shader/prog_execute.h +++ b/src/mesa/shader/prog_execute.h @@ -73,7 +73,7 @@ struct gl_program_machine extern void -_mesa_get_program_register(GLcontext *ctx, enum register_file file, +_mesa_get_program_register(GLcontext *ctx, gl_register_file file, GLuint index, GLfloat val[4]); extern GLboolean diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 8ae961241f..60e9d07423 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -78,7 +78,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) */ GLint _mesa_add_parameter(struct gl_program_parameter_list *paramList, - enum register_file type, const char *name, + gl_register_file type, const char *name, GLuint size, GLenum datatype, const GLfloat *values, const gl_state_index state[STATE_LENGTH], GLbitfield flags) @@ -681,7 +681,7 @@ _mesa_combine_parameter_lists(const struct gl_program_parameter_list *listA, */ GLuint _mesa_longest_parameter_name(const struct gl_program_parameter_list *list, - enum register_file type) + gl_register_file type) { GLuint i, maxLen = 0; if (!list) @@ -702,7 +702,7 @@ _mesa_longest_parameter_name(const struct gl_program_parameter_list *list, */ GLuint _mesa_num_parameters_of_type(const struct gl_program_parameter_list *list, - enum register_file type) + gl_register_file type) { GLuint i, count = 0; if (list) { diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 200f2c0045..01f5a0e179 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -54,7 +54,7 @@ struct gl_program_parameter { const char *Name; /**< Null-terminated string */ - enum register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ + gl_register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ GLuint Size; /**< Number of components (1..4) */ GLboolean Used; /**< Helper flag for GLSL uniform tracking */ @@ -102,7 +102,7 @@ _mesa_num_parameters(const struct gl_program_parameter_list *list) extern GLint _mesa_add_parameter(struct gl_program_parameter_list *paramList, - enum register_file type, const char *name, + gl_register_file type, const char *name, GLuint size, GLenum datatype, const GLfloat *values, const gl_state_index state[STATE_LENGTH], GLbitfield flags); @@ -161,11 +161,11 @@ _mesa_lookup_parameter_constant(const struct gl_program_parameter_list *list, extern GLuint _mesa_longest_parameter_name(const struct gl_program_parameter_list *list, - enum register_file type); + gl_register_file type); extern GLuint _mesa_num_parameters_of_type(const struct gl_program_parameter_list *list, - enum register_file type); + gl_register_file type); #endif /* PROG_PARAMETER_H */ diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 6988e9c052..0a78a0a866 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -43,7 +43,7 @@ * Return string name for given program/register file. */ static const char * -file_string(enum register_file f, gl_prog_print_mode mode) +file_string(gl_register_file f, gl_prog_print_mode mode) { switch (f) { case PROGRAM_TEMPORARY: @@ -219,7 +219,7 @@ arb_output_attrib_string(GLint index, GLenum progType) * \param prog pointer to containing program */ static const char * -reg_string(enum register_file f, GLint index, gl_prog_print_mode mode, +reg_string(gl_register_file f, GLint index, gl_prog_print_mode mode, GLboolean relAddr, const struct gl_program *prog) { static char str[100]; @@ -432,7 +432,7 @@ fprint_dst_reg(FILE * f, const struct gl_program *prog) { _mesa_fprintf(f, "%s%s", - reg_string((enum register_file) dstReg->File, + reg_string((gl_register_file) dstReg->File, dstReg->Index, mode, dstReg->RelAddr, prog), _mesa_writemask_string(dstReg->WriteMask)); @@ -445,7 +445,7 @@ fprint_dst_reg(FILE * f, #if 0 _mesa_fprintf(f, "%s[%d]%s", - file_string((enum register_file) dstReg->File, mode), + file_string((gl_register_file) dstReg->File, mode), dstReg->Index, _mesa_writemask_string(dstReg->WriteMask)); #endif @@ -462,14 +462,14 @@ fprint_src_reg(FILE *f, _mesa_fprintf(f, "%s%s%s%s", abs, - reg_string((enum register_file) srcReg->File, + reg_string((gl_register_file) srcReg->File, srcReg->Index, mode, srcReg->RelAddr, prog), _mesa_swizzle_string(srcReg->Swizzle, srcReg->NegateBase, GL_FALSE), abs); #if 0 _mesa_fprintf(f, "%s[%d]%s", - file_string((enum register_file) srcReg->File, mode), + file_string((gl_register_file) srcReg->File, mode), srcReg->Index, _mesa_swizzle_string(srcReg->Swizzle, srcReg->NegateBase, GL_FALSE)); @@ -562,7 +562,7 @@ _mesa_fprint_instruction_opt(FILE *f, if (inst->SrcReg[0].File != PROGRAM_UNDEFINED) { _mesa_fprintf(f, ", "); _mesa_fprintf(f, "%s[%d]%s", - file_string((enum register_file) inst->SrcReg[0].File, + file_string((gl_register_file) inst->SrcReg[0].File, mode), inst->SrcReg[0].Index, _mesa_swizzle_string(inst->SrcReg[0].Swizzle, @@ -579,7 +579,7 @@ _mesa_fprint_instruction_opt(FILE *f, _mesa_fprintf(f, " "); fprint_dst_reg(f, &inst->DstReg, mode, prog); _mesa_fprintf(f, ", %s[%d], %s", - file_string((enum register_file) inst->SrcReg[0].File, + file_string((gl_register_file) inst->SrcReg[0].File, mode), inst->SrcReg[0].Index, _mesa_swizzle_string(inst->SrcReg[0].Swizzle, diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 05d9bdf7ec..e283f8933b 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -375,7 +375,7 @@ _mesa_count_texture_instructions(struct gl_program *prog) * So, rewrite the program to use a temporary register in this case. */ void -_mesa_remove_output_reads(struct gl_program *prog, enum register_file type) +_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) { GLuint i; GLint outputMap[VERT_RESULT_MAX]; diff --git a/src/mesa/shader/programopt.h b/src/mesa/shader/programopt.h index 11572e64f5..96acaf9566 100644 --- a/src/mesa/shader/programopt.h +++ b/src/mesa/shader/programopt.h @@ -40,6 +40,6 @@ extern void _mesa_count_texture_instructions(struct gl_program *prog); extern void -_mesa_remove_output_reads(struct gl_program *prog, enum register_file type); +_mesa_remove_output_reads(struct gl_program *prog, gl_register_file type); #endif /* PROGRAMOPT_H */ diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index ee24e2e138..d8246ae75f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2998,7 +2998,7 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var, slang_ir_node *varDecl, *n; slang_ir_storage *store; GLint arrayLen, size, totalSize; /* if array then totalSize > size */ - enum register_file file; + gl_register_file file; /*assert(!var->declared);*/ var->declared = GL_TRUE; diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 6a47585c7a..94d0c084aa 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -446,7 +446,7 @@ new_instruction(slang_emit_info *emitInfo, gl_inst_opcode opcode) static struct prog_instruction * emit_arl_load(slang_emit_info *emitInfo, - enum register_file file, GLint index, GLuint swizzle) + gl_register_file file, GLint index, GLuint swizzle) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL); inst->SrcReg[0].File = file; diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index dc4086d888..1c7f7474e7 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -121,7 +121,7 @@ _slang_ir_info(slang_ir_opcode opcode) void _slang_init_ir_storage(slang_ir_storage *st, - enum register_file file, GLint index, GLint size, + gl_register_file file, GLint index, GLint size, GLuint swizzle) { st->File = file; @@ -137,7 +137,7 @@ _slang_init_ir_storage(slang_ir_storage *st, * Return a new slang_ir_storage object. */ slang_ir_storage * -_slang_new_ir_storage(enum register_file file, GLint index, GLint size) +_slang_new_ir_storage(gl_register_file file, GLint index, GLint size) { slang_ir_storage *st; st = (slang_ir_storage *) _slang_alloc(sizeof(slang_ir_storage)); @@ -157,7 +157,7 @@ _slang_new_ir_storage(enum register_file file, GLint index, GLint size) * Return a new slang_ir_storage object. */ slang_ir_storage * -_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size, +_slang_new_ir_storage_swz(gl_register_file file, GLint index, GLint size, GLuint swizzle) { slang_ir_storage *st; @@ -196,10 +196,10 @@ _slang_new_ir_storage_relative(GLint index, GLint size, slang_ir_storage * -_slang_new_ir_storage_indirect(enum register_file file, +_slang_new_ir_storage_indirect(gl_register_file file, GLint index, GLint size, - enum register_file indirectFile, + gl_register_file indirectFile, GLint indirectIndex, GLuint indirectSwizzle) { diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index d77feeadba..0ec38b10a5 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -171,7 +171,7 @@ typedef enum */ struct slang_ir_storage_ { - enum register_file File; /**< PROGRAM_TEMPORARY, PROGRAM_INPUT, etc */ + gl_register_file File; /**< PROGRAM_TEMPORARY, PROGRAM_INPUT, etc */ GLint Index; /**< -1 means unallocated */ GLint Size; /**< number of floats or ints */ GLuint Swizzle; /**< Swizzle AND writemask info */ @@ -180,7 +180,7 @@ struct slang_ir_storage_ GLboolean RelAddr; /* we'll remove this eventually */ GLboolean IsIndirect; - enum register_file IndirectFile; + gl_register_file IndirectFile; GLint IndirectIndex; GLuint IndirectSwizzle; GLuint TexTarget; /**< If File==PROGRAM_SAMPLER, one of TEXTURE_x_INDEX */ @@ -235,15 +235,15 @@ _slang_ir_info(slang_ir_opcode opcode); extern void _slang_init_ir_storage(slang_ir_storage *st, - enum register_file file, GLint index, GLint size, + gl_register_file file, GLint index, GLint size, GLuint swizzle); extern slang_ir_storage * -_slang_new_ir_storage(enum register_file file, GLint index, GLint size); +_slang_new_ir_storage(gl_register_file file, GLint index, GLint size); extern slang_ir_storage * -_slang_new_ir_storage_swz(enum register_file file, GLint index, GLint size, +_slang_new_ir_storage_swz(gl_register_file file, GLint index, GLint size, GLuint swizzle); extern slang_ir_storage * @@ -252,10 +252,10 @@ _slang_new_ir_storage_relative(GLint index, GLint size, extern slang_ir_storage * -_slang_new_ir_storage_indirect(enum register_file file, +_slang_new_ir_storage_indirect(gl_register_file file, GLint index, GLint size, - enum register_file indirectFile, + gl_register_file indirectFile, GLint indirectIndex, GLuint indirectSwizzle); -- cgit v1.2.3 From 8dff9f349fb55118d74a0b6597722f67a5c930d4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 09:04:28 -0600 Subject: glsl: fix typo: s/vec4_tex1d_proj/vec4_tex_1d_proj/ This regression came from commit c0b59420eec5ffdf22a5919d38851c3620b97c09. --- .../shader/slang/library/slang_common_builtin.gc | 2 +- .../shader/slang/library/slang_common_builtin_gc.h | 46 +++++++++++----------- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 71d937d81a..9764fc25b0 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -1670,7 +1670,7 @@ vec4 texture1DProj(const sampler1D sampler, const vec2 coord) vec4 texture1DProj(const sampler1D sampler, const vec4 coord) { - __asm vec4_tex1d_proj __retVal, sampler, coord; + __asm vec4_tex_1d_proj __retVal, sampler, coord; } diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index f537c00266..78a7b83ec1 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -751,29 +751,29 @@ 114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, 114,100,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114, 111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, -114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0, -1,4,118,101,99,52,95,116,101,120,95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68, -80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0, -1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0, -12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114, -0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114, -111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100,0,18, -95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1, -90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100, -95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19, -0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, -101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -49,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +118,101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18, +115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116, +117,114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0, +0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, +112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, +50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100, +0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90, +95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108, +101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95, +112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, +111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109, +112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51, +100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, +0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +51,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, +18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0, +0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95, +116,101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, +0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115, +97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +95,49,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, 114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111, 106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118, 101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101, -- cgit v1.2.3 From 3c1ce2d64919e0fb9b28f0697addb87708f4f6ed Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 10:16:37 -0600 Subject: mesa: fix dumb sizeof() vs. strlen() mix-up --- src/mesa/shader/prog_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 0a78a0a866..3e006a4927 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -918,7 +918,7 @@ _mesa_write_shader_to_file(const struct gl_shader *shader) else type = "vert"; - _mesa_snprintf(filename, strlen(filename), "shader_%u.%s", shader->Name, type); + _mesa_snprintf(filename, sizeof(filename), "shader_%u.%s", shader->Name, type); f = fopen(filename, "w"); if (!f) { fprintf(stderr, "Unable to open %s for writing\n", filename); -- cgit v1.2.3 From 0522624c834fc6d4a8803cc469af9dc6f3d4ee14 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 17:09:52 -0600 Subject: glsl: remove stray/unneeded totalSize assignment --- src/mesa/shader/slang/slang_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index d8246ae75f..8663054a9d 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -3014,7 +3014,7 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var, file = PROGRAM_TEMPORARY; } - totalSize = size = _slang_sizeof_type_specifier(&var->type.specifier); + size = _slang_sizeof_type_specifier(&var->type.specifier); if (size <= 0) { slang_info_log_error(A->log, "invalid declaration for '%s'", varName); return NULL; -- cgit v1.2.3 From b78463cbad0b1f4191b3b235b70625651eeefb05 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 17:23:36 -0600 Subject: glsl: some clean-ups, remove old assertions, add new assertions --- src/mesa/shader/slang/slang_codegen.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 8663054a9d..80bbf2a5e5 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -315,10 +315,10 @@ _slang_attach_storage(slang_ir_node *n, slang_variable *var) n->Var = var; if (!n->Store) { - /* need to setup storage */ - if (n->Var && n->Var->store) { - /* node storage info = var storage info */ - n->Store = n->Var->store; + /* need to setup node's storage */ + if (var->store) { + /* node's storage = var's storage */ + n->Store = var->store; } else { /* alloc new storage info */ @@ -328,9 +328,7 @@ _slang_attach_storage(slang_ir_node *n, slang_variable *var) (char*) var->a_name, (void*) n->Store, n->Store->Size); #endif - if (n->Var) - n->Var->store = n->Store; - assert(n->Var->store); + var->store = n->Store; } } } @@ -745,6 +743,7 @@ new_var(slang_assemble_ctx *A, slang_variable *var) { slang_ir_node *n = new_node0(IR_VAR); if (n) { + ASSERT(var->store); _slang_attach_storage(n, var); } return n; -- cgit v1.2.3 From d861d589a8f2fea4fbaa36b1533b4873c51c9f89 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 10 Mar 2009 18:15:05 -0600 Subject: glsl: remove _slang_attach_storage() function This was used to handle both variable declarations and references to variables. Instead, just do storage allocation and assignment for declarations and references, respectively. This is a step toward better var/uniform allocation (only allocate storage for vars/uniforms that are actually referenced by the code). --- src/mesa/shader/slang/slang_codegen.c | 73 ++++++++++------------------------- 1 file changed, 21 insertions(+), 52 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 80bbf2a5e5..753e5c45c4 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -296,44 +296,6 @@ _slang_array_size(GLint elemSize, GLint arrayLen) } - -/** - * Establish the binding between a slang_ir_node and a slang_variable. - * Then, allocate/attach a slang_ir_storage object to the IR node if needed. - * The IR node must be a IR_VAR or IR_VAR_DECL node. - * \param n the IR node - * \param var the variable to associate with the IR node - */ -static void -_slang_attach_storage(slang_ir_node *n, slang_variable *var) -{ - assert(n); - assert(var); - assert(n->Opcode == IR_VAR || n->Opcode == IR_VAR_DECL); - assert(!n->Var || n->Var == var); - - n->Var = var; - - if (!n->Store) { - /* need to setup node's storage */ - if (var->store) { - /* node's storage = var's storage */ - n->Store = var->store; - } - else { - /* alloc new storage info */ - n->Store = _slang_new_ir_storage(PROGRAM_UNDEFINED, -7, -5); -#if 0 - printf("%s var=%s Store=%p Size=%d\n", __FUNCTION__, - (char*) var->a_name, - (void*) n->Store, n->Store->Size); -#endif - var->store = n->Store; - } - } -} - - /** * Return the TEXTURE_*_INDEX value that corresponds to a sampler type, * or -1 if the type is not a sampler. @@ -743,8 +705,14 @@ new_var(slang_assemble_ctx *A, slang_variable *var) { slang_ir_node *n = new_node0(IR_VAR); if (n) { + ASSERT(var); ASSERT(var->store); - _slang_attach_storage(n, var); + ASSERT(!n->Store); + ASSERT(!n->Var); + + /* Set IR node's Var and Store pointers */ + n->Var = var; + n->Store = var->store; } return n; } @@ -3027,22 +2995,23 @@ _slang_gen_var_decl(slang_assemble_ctx *A, slang_variable *var, if (!varDecl) return NULL; - _slang_attach_storage(varDecl, var); /* undefined storage at first */ - assert(var->store); - assert(varDecl->Store == var->store); - assert(varDecl->Store); - assert(varDecl->Store->Index < 0); - store = var->store; + /* Allocate slang_ir_storage for this variable if needed. + * Note that we may not actually allocate a constant or temporary register + * until later. + */ + if (!var->store) { + GLint index = -7; /* TBD / unknown */ + var->store = _slang_new_ir_storage(file, index, totalSize); + if (!var->store) + return NULL; /* out of memory */ + } - assert(store == varDecl->Store); + /* set the IR node's Var and Store pointers */ + varDecl->Var = var; + varDecl->Store = var->store; - /* Fill in storage fields which we now know. store->Index/Swizzle may be - * set for some cases below. Otherwise, store->Index/Swizzle will be set - * during code emit. - */ - store->File = file; - store->Size = totalSize; + store = var->store; /* if there's an initializer, generate IR for the expression */ if (initializer) { -- cgit v1.2.3 From 548be3846db59ad43934a159c051b359db6e56db Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Mar 2009 20:08:37 -0600 Subject: mesa: remove some last remnants of GL_MESA_program_debug --- src/mesa/shader/arbprogram.c | 9 +++------ src/mesa/shader/nvprogram.c | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 7831e0faf9..329c0ea0b0 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -597,8 +597,7 @@ _mesa_GetProgramEnvParameterfvARB(GLenum target, GLuint index, FLUSH_VERTICES(ctx, _NEW_PROGRAM); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { @@ -818,8 +817,7 @@ _mesa_GetProgramivARB(GLenum target, GLenum pname, GLint *params) struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); if (target == GL_VERTEX_PROGRAM_ARB && ctx->Extensions.ARB_vertex_program) { @@ -1000,8 +998,7 @@ _mesa_GetProgramStringARB(GLenum target, GLenum pname, GLvoid *string) char *dst = (char *) string; GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); if (target == GL_VERTEX_PROGRAM_ARB) { prog = &(ctx->VertexProgram.Current->Base); diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 16116c4339..50358cf107 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -246,8 +246,7 @@ _mesa_GetProgramivNV(GLuint id, GLenum pname, GLint *params) struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); prog = _mesa_lookup_program(ctx, id); if (!prog) { @@ -283,8 +282,7 @@ _mesa_GetProgramStringNV(GLuint id, GLenum pname, GLubyte *program) struct gl_program *prog; GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); if (pname != GL_PROGRAM_STRING_NV) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetProgramStringNV(pname)"); @@ -773,8 +771,7 @@ _mesa_GetProgramNamedParameterfvNV(GLuint id, GLsizei len, const GLubyte *name, GET_CURRENT_CONTEXT(ctx); - if (!ctx->_CurrentProgram) - ASSERT_OUTSIDE_BEGIN_END(ctx); + ASSERT_OUTSIDE_BEGIN_END(ctx); prog = _mesa_lookup_program(ctx, id); if (!prog || prog->Target != GL_FRAGMENT_PROGRAM_NV) { -- cgit v1.2.3 From 114152e068ec919feb0a57a1259c2ada970b9f02 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 12 Mar 2009 15:01:16 +0100 Subject: mesa: add support for ATI_envmap_bumpmap add new entrypoints, new texture format, etc translate in texenvprogram.c for drivers using the mesa-generated tex env fragment program also handled in swrast, but not tested (cannot work due to negative texel results not handled correctly) --- src/mesa/shader/prog_statevars.c | 28 ++++++++++++++++++++++++++++ src/mesa/shader/prog_statevars.h | 2 ++ 2 files changed, 30 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_statevars.c b/src/mesa/shader/prog_statevars.c index 1f7d87ccc9..f51d9e2651 100644 --- a/src/mesa/shader/prog_statevars.c +++ b/src/mesa/shader/prog_statevars.c @@ -506,6 +506,26 @@ _mesa_fetch_state(GLcontext *ctx, const gl_state_index state[], } } return; + case STATE_ROT_MATRIX_0: + { + const int unit = (int) state[2]; + GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix; + value[0] = rotMat22[0]; + value[1] = rotMat22[2]; + value[2] = 0.0; + value[3] = 0.0; + } + break; + case STATE_ROT_MATRIX_1: + { + const int unit = (int) state[2]; + GLfloat *rotMat22 = ctx->Texture.Unit[unit].RotMatrix; + value[0] = rotMat22[1]; + value[1] = rotMat22[3]; + value[2] = 0.0; + value[3] = 0.0; + } + break; /* XXX: make sure new tokens added here are also handled in the * _mesa_program_state_flags() switch, below. @@ -591,6 +611,8 @@ _mesa_program_state_flags(const gl_state_index state[STATE_LENGTH]) case STATE_TEXRECT_SCALE: case STATE_SHADOW_AMBIENT: + case STATE_ROT_MATRIX_0: + case STATE_ROT_MATRIX_1: return _NEW_TEXTURE; case STATE_FOG_PARAMS_OPTIMIZED: return _NEW_FOG; @@ -806,6 +828,12 @@ append_token(char *dst, gl_state_index k) case STATE_SHADOW_AMBIENT: append(dst, "CompareFailValue"); break; + case STATE_ROT_MATRIX_0: + append(dst, "rotMatrixRow0"); + break; + case STATE_ROT_MATRIX_1: + append(dst, "rotMatrixRow1"); + break; default: /* probably STATE_INTERNAL_DRIVER+i (driver private state) */ append(dst, "driverState"); diff --git a/src/mesa/shader/prog_statevars.h b/src/mesa/shader/prog_statevars.h index d5358a1d04..d563080db1 100644 --- a/src/mesa/shader/prog_statevars.h +++ b/src/mesa/shader/prog_statevars.h @@ -117,6 +117,8 @@ typedef enum gl_state_index_ { STATE_PCM_SCALE, /**< Post color matrix RGBA scale */ STATE_PCM_BIAS, /**< Post color matrix RGBA bias */ STATE_SHADOW_AMBIENT, /**< ARB_shadow_ambient fail value; token[2] is texture unit index */ + STATE_ROT_MATRIX_0, /**< ATI_envmap_bumpmap, rot matrix row 0 */ + STATE_ROT_MATRIX_1, /**< ATI_envmap_bumpmap, rot matrix row 1 */ STATE_INTERNAL_DRIVER /* first available state index for drivers (must be last) */ } gl_state_index; -- cgit v1.2.3 From 4eda17d19231ce4b65e9c8c267c55d718cbcfb4c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 13 Mar 2009 09:11:42 -0600 Subject: mesa: glUseProgram() debug code (disabled) --- src/mesa/shader/shader_api.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index b8b34bb2b4..9900acc75b 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1495,6 +1495,17 @@ _mesa_use_program(GLcontext *ctx, GLuint program) "glUseProgram(program %u not linked)", program); return; } + + /* debug code */ + if (0) { + GLuint i; + _mesa_printf("Use Shader %u\n", shProg->Name); + for (i = 0; i < shProg->NumShaders; i++) { + _mesa_printf(" shader %u, type 0x%x\n", + shProg->Shaders[i]->Name, + shProg->Shaders[i]->Type); + } + } } else { shProg = NULL; -- cgit v1.2.3 From 9ba52e12688d6f677c2241729776e6bf10737d4b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 16 Mar 2009 09:12:21 +0100 Subject: mesa: Silence compiler warnings. --- src/mesa/shader/arbprogparse.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index cd6289deb5..a4d0fc3efc 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -969,6 +969,7 @@ parse_output_color_num (GLcontext * ctx, const GLubyte ** inst, GLint i = parse_integer (inst, Program); if ((i < 0) || (i >= (int)ctx->Const.MaxDrawBuffers)) { + *color = 0; program_error(ctx, Program->Position, "Invalid draw buffer index"); return 1; } -- cgit v1.2.3 From 1eee1bac1f6d911e6124daafc9b9291666d91cef Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Mar 2009 09:34:30 -0600 Subject: mesa: update/fix doxygen comments --- src/mesa/shader/prog_parameter.c | 2 +- src/mesa/shader/prog_print.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 60e9d07423..66edae9001 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -517,7 +517,7 @@ _mesa_lookup_parameter_index(const struct gl_program_parameter_list *paramList, * swizzling to find a match. * \param list the parameter list to search * \param v the float vector to search for - * \param size number of element in v + * \param vSize number of element in v * \param posOut returns the position of the constant, if found * \param swizzleOut returns a swizzle mask describing location of the * vector elements if found. diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index 3e006a4927..b832ddb477 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -213,7 +213,7 @@ arb_output_attrib_string(GLint index, GLenum progType) * Return string representation of the given register. * Note that some types of registers (like PROGRAM_UNIFORM) aren't defined * by the ARB/NV program languages so we've taken some liberties here. - * \param file the register file (PROGRAM_INPUT, PROGRAM_TEMPORARY, etc) + * \param f the register file (PROGRAM_INPUT, PROGRAM_TEMPORARY, etc) * \param index number of the register in the register file * \param mode the output format/mode/style * \param prog pointer to containing program -- cgit v1.2.3 From 752296b8f311c5e3844f3ce89d17ba57224ce5ba Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 18 Mar 2009 21:16:35 +0000 Subject: slang: if we detect an if/break or if/continue within a loop and we're trying to unroll, bail, and fallback to doing the real loop. --- src/mesa/shader/slang/slang_codegen.c | 45 ++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 753e5c45c4..d5d0c2d45f 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -718,6 +718,23 @@ new_var(slang_assemble_ctx *A, slang_variable *var) } +/** + * Determine if the given operation is of a specific type. + */ +static GLboolean +is_operation_type(const slang_operation *oper, slang_operation_type type) +{ + if (oper->type == type) + return GL_TRUE; + else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE || + oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) && + oper->num_children == 1) + return is_operation_type(&oper->children[0], type); + else + return GL_FALSE; +} + + /** * Check if the given function is really just a wrapper for a * basic assembly instruction. @@ -2619,6 +2636,17 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) if (!slang_operation_copy(body, &oper->children[3])) return NULL; + /* + * If we detect an if/break or if/continue lets do the real loop + * and forget unrolling. + */ + if (body->children[1].type == SLANG_OPER_IF) { + if (is_operation_type(&body->children[1].children[1], SLANG_OPER_BREAK)) + return NULL; + if (is_operation_type(&body->children[1].children[1], SLANG_OPER_CONTINUE)) + return NULL; + } + /* in body, replace instances of 'varId' with literal 'iter' */ { slang_variable *oldVar; @@ -2718,23 +2746,6 @@ _slang_gen_continue(slang_assemble_ctx * A, const slang_operation *oper) } -/** - * Determine if the given operation is of a specific type. - */ -static GLboolean -is_operation_type(const slang_operation *oper, slang_operation_type type) -{ - if (oper->type == type) - return GL_TRUE; - else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE || - oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) && - oper->num_children == 1) - return is_operation_type(&oper->children[0], type); - else - return GL_FALSE; -} - - /** * Generate IR tree for an if/then/else conditional using high-level * IR_IF instruction. -- cgit v1.2.3 From 192b7bc706f0d014ecea1843230a4b1adbe2a45b Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 18 Mar 2009 21:40:03 +0000 Subject: Revert "slang: if we detect an if/break or if/continue within a loop and we're" This reverts commit 752296b8f311c5e3844f3ce89d17ba57224ce5ba. --- src/mesa/shader/slang/slang_codegen.c | 45 +++++++++++++---------------------- 1 file changed, 17 insertions(+), 28 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index d5d0c2d45f..753e5c45c4 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -718,23 +718,6 @@ new_var(slang_assemble_ctx *A, slang_variable *var) } -/** - * Determine if the given operation is of a specific type. - */ -static GLboolean -is_operation_type(const slang_operation *oper, slang_operation_type type) -{ - if (oper->type == type) - return GL_TRUE; - else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE || - oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) && - oper->num_children == 1) - return is_operation_type(&oper->children[0], type); - else - return GL_FALSE; -} - - /** * Check if the given function is really just a wrapper for a * basic assembly instruction. @@ -2636,17 +2619,6 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) if (!slang_operation_copy(body, &oper->children[3])) return NULL; - /* - * If we detect an if/break or if/continue lets do the real loop - * and forget unrolling. - */ - if (body->children[1].type == SLANG_OPER_IF) { - if (is_operation_type(&body->children[1].children[1], SLANG_OPER_BREAK)) - return NULL; - if (is_operation_type(&body->children[1].children[1], SLANG_OPER_CONTINUE)) - return NULL; - } - /* in body, replace instances of 'varId' with literal 'iter' */ { slang_variable *oldVar; @@ -2746,6 +2718,23 @@ _slang_gen_continue(slang_assemble_ctx * A, const slang_operation *oper) } +/** + * Determine if the given operation is of a specific type. + */ +static GLboolean +is_operation_type(const slang_operation *oper, slang_operation_type type) +{ + if (oper->type == type) + return GL_TRUE; + else if ((oper->type == SLANG_OPER_BLOCK_NEW_SCOPE || + oper->type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) && + oper->num_children == 1) + return is_operation_type(&oper->children[0], type); + else + return GL_FALSE; +} + + /** * Generate IR tree for an if/then/else conditional using high-level * IR_IF instruction. -- cgit v1.2.3 From cac1ce09ac52e9bc4aa8d5ba24b6a4d131d8fc69 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 18 Mar 2009 21:42:14 +0000 Subject: slang: redo the last commit for if/break & if/continue tests as it wasn't good enough for deeply nested if's. --- src/mesa/shader/slang/slang_codegen.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 753e5c45c4..e98d9d96e3 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2642,6 +2642,9 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) /* do IR codegen for body */ n = _slang_gen_operation(A, body); + if (!n) + return NULL; + root = new_seq(root, n); slang_operation_delete(body); @@ -2783,12 +2786,16 @@ _slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper) if (is_operation_type(&oper->children[1], SLANG_OPER_BREAK) && !haveElseClause) { /* Special case: generate a conditional break */ + if (!A->CurLoop) /* probably trying to unroll */ + return NULL; ifBody = new_break_if_true(A->CurLoop, cond); return ifBody; } else if (is_operation_type(&oper->children[1], SLANG_OPER_CONTINUE) && !haveElseClause) { - /* Special case: generate a conditional break */ + /* Special case: generate a conditional continue */ + if (!A->CurLoop) /* probably trying to unroll */ + return NULL; ifBody = new_cont_if_true(A->CurLoop, cond); return ifBody; } -- cgit v1.2.3 From 989856bde47d699d7e18798df4013fbf962e1d4b Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 19 Mar 2009 10:16:28 +0000 Subject: slang: if/else/break & if/else/continue work for unrolled loops --- src/mesa/shader/slang/slang_codegen.c | 44 +++++++++++++++++++++++++++++------ src/mesa/shader/slang/slang_codegen.h | 1 + 2 files changed, 38 insertions(+), 7 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index e98d9d96e3..6c8c8c1856 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2575,6 +2575,20 @@ _slang_can_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) } +static void +_unroll_loop_inc(slang_assemble_ctx * A) +{ + A->UnrollLoop++; +} + + +static void +_unroll_loop_dec(slang_assemble_ctx * A) +{ + A->UnrollLoop--; +} + + /** * Unroll a for-loop. * First we determine the number of iterations to unroll. @@ -2591,6 +2605,9 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) slang_ir_node *n, *root = NULL; slang_atom varId; + /* Set flag so code generator knows we're unrolling loops */ + _unroll_loop_inc( A ); + if (oper->children[0].type == SLANG_OPER_BLOCK_NO_NEW_SCOPE) { /* for (int i=0; ... */ slang_variable *var; @@ -2613,11 +2630,15 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) /* make a copy of the loop body */ body = slang_operation_new(1); - if (!body) + if (!body) { + _unroll_loop_dec( A ); return NULL; + } - if (!slang_operation_copy(body, &oper->children[3])) + if (!slang_operation_copy(body, &oper->children[3])) { + _unroll_loop_dec( A ); return NULL; + } /* in body, replace instances of 'varId' with literal 'iter' */ { @@ -2628,6 +2649,7 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) if (!oldVar) { /* undeclared loop variable */ slang_operation_delete(body); + _unroll_loop_dec( A ); return NULL; } @@ -2642,14 +2664,18 @@ _slang_unroll_for_loop(slang_assemble_ctx * A, const slang_operation *oper) /* do IR codegen for body */ n = _slang_gen_operation(A, body); - if (!n) + if (!n) { + _unroll_loop_dec( A ); return NULL; + } root = new_seq(root, n); slang_operation_delete(body); } + _unroll_loop_dec( A ); + return root; } @@ -2786,7 +2812,7 @@ _slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper) if (is_operation_type(&oper->children[1], SLANG_OPER_BREAK) && !haveElseClause) { /* Special case: generate a conditional break */ - if (!A->CurLoop) /* probably trying to unroll */ + if (!A->CurLoop && A->UnrollLoop) /* trying to unroll */ return NULL; ifBody = new_break_if_true(A->CurLoop, cond); return ifBody; @@ -2794,7 +2820,7 @@ _slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper) else if (is_operation_type(&oper->children[1], SLANG_OPER_CONTINUE) && !haveElseClause) { /* Special case: generate a conditional continue */ - if (!A->CurLoop) /* probably trying to unroll */ + if (!A->CurLoop && A->UnrollLoop) /* trying to unroll */ return NULL; ifBody = new_cont_if_true(A->CurLoop, cond); return ifBody; @@ -2802,6 +2828,8 @@ _slang_gen_if(slang_assemble_ctx * A, const slang_operation *oper) else { /* general case */ ifBody = _slang_gen_operation(A, &oper->children[1]); + if (!ifBody) + return NULL; if (haveElseClause) elseBody = _slang_gen_operation(A, &oper->children[2]); else @@ -4014,13 +4042,15 @@ _slang_gen_operation(slang_assemble_ctx * A, slang_operation *oper) return _slang_gen_while(A, oper); case SLANG_OPER_BREAK: if (!A->CurLoop) { - slang_info_log_error(A->log, "'break' not in loop"); + if (!A->UnrollLoop) + slang_info_log_error(A->log, "'break' not in loop"); return NULL; } return new_break(A->CurLoop); case SLANG_OPER_CONTINUE: if (!A->CurLoop) { - slang_info_log_error(A->log, "'continue' not in loop"); + if (!A->UnrollLoop) + slang_info_log_error(A->log, "'continue' not in loop"); return NULL; } return _slang_gen_continue(A, oper); diff --git a/src/mesa/shader/slang/slang_codegen.h b/src/mesa/shader/slang/slang_codegen.h index f2daa034e4..e812c1f7ea 100644 --- a/src/mesa/shader/slang/slang_codegen.h +++ b/src/mesa/shader/slang/slang_codegen.h @@ -42,6 +42,7 @@ typedef struct slang_assemble_ctx_ struct slang_label_ *curFuncEndLabel; struct slang_ir_node_ *CurLoop; struct slang_function_ *CurFunction; + GLuint UnrollLoop; } slang_assemble_ctx; -- cgit v1.2.3 From 214132adfee555a26b64b2dd359afa6b09e845f5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Mar 2009 09:26:20 -0600 Subject: glsl: when debug pragma is on, emit comments about function calls/inlines BTW, the debug pragma syntax is "#pragma debug(on)" --- src/mesa/shader/slang/slang_codegen.c | 6 ++++++ src/mesa/shader/slang/slang_emit.c | 6 ++++++ src/mesa/shader/slang/slang_ir.h | 1 + 3 files changed, 13 insertions(+) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 6c8c8c1856..13a801c18a 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1439,6 +1439,12 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, /*_slang_label_delete(A->curFuncEndLabel);*/ A->curFuncEndLabel = prevFuncEndLabel; + if (A->pragmas->Debug) { + char s[1000]; + snprintf(s, sizeof(s), "Call/inline %s()", (char *) fun->header.a_name); + n->Comment = _slang_strdup(s); + } + return n; } diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 94d0c084aa..1b1edb4460 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2194,6 +2194,12 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) return NULL; } + if (n->Comment) { + inst = new_instruction(emitInfo, OPCODE_NOP); + inst->Comment = _mesa_strdup(n->Comment); + inst = NULL; + } + switch (n->Opcode) { case IR_SEQ: /* sequence of two sub-trees */ diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index 0ec38b10a5..e796693ed5 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -212,6 +212,7 @@ typedef struct slang_ir_node_ struct slang_ir_node_ *List; /**< For various linked lists */ struct slang_ir_node_ *Parent; /**< Pointer to logical parent (ie. loop) */ slang_label *Label; /**< Used for branches */ + const char *Comment; /**< If Opcode == IR_COMMENT */ } slang_ir_node; -- cgit v1.2.3 From 65fc2ca82a38bc00ae4223124932af6771765041 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Mar 2009 10:25:24 -0600 Subject: glsl: change GLSL #pragma initialization Initialize the shader's pragma settings before calling the compiler. Added pragma "Ignore" fields to allow overriding the #pragma directives found in shader source code. --- src/mesa/shader/shader_api.c | 9 +++++++++ src/mesa/shader/slang/slang_compile.c | 4 +++- src/mesa/shader/slang/slang_preprocess.c | 23 ++++++++++------------- 3 files changed, 22 insertions(+), 14 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 9900acc75b..61289db2d2 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -410,6 +410,12 @@ _mesa_init_shader_state(GLcontext * ctx) ctx->Shader.EmitCondCodes = GL_FALSE; ctx->Shader.EmitComments = GL_FALSE; ctx->Shader.Flags = get_shader_flags(); + + /* Default pragma settings */ + ctx->Shader.DefaultPragmas.IgnoreOptimize = GL_FALSE; + ctx->Shader.DefaultPragmas.IgnoreDebug = GL_FALSE; + ctx->Shader.DefaultPragmas.Optimize = GL_TRUE; + ctx->Shader.DefaultPragmas.Debug = GL_FALSE; } @@ -1444,6 +1450,9 @@ _mesa_compile_shader(GLcontext *ctx, GLuint shaderObj) if (!sh) return; + /* set default pragma state for shader */ + sh->Pragmas = ctx->Shader.DefaultPragmas; + /* this call will set the sh->CompileStatus field to indicate if * compilation was successful. */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 3f46bfd60d..aa08022869 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2798,7 +2798,9 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) shader->CompileStatus = success; if (success) { - _mesa_optimize_program(ctx, shader->Program); + if (shader->Pragmas.Optimize) { + _mesa_optimize_program(ctx, shader->Program); + } } if (ctx->Shader.Flags & GLSL_LOG) { diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c index 89aaa3a621..ff913ad883 100644 --- a/src/mesa/shader/slang/slang_preprocess.c +++ b/src/mesa/shader/slang/slang_preprocess.c @@ -530,14 +530,6 @@ pp_ext_set(pp_ext *self, const char *name, GLboolean enable) } -static void -pp_pragmas_init(struct gl_sl_pragmas *pragmas) -{ - pragmas->Optimize = GL_TRUE; - pragmas->Debug = GL_FALSE; -} - - /** * Called in response to #pragma. For example, "#pragma debug(on)" would * call this function as pp_pragma("debug", "on"). @@ -553,10 +545,12 @@ pp_pragma(struct gl_sl_pragmas *pragmas, const char *pragma, const char *param) if (!param) return GL_FALSE; /* missing required param */ if (_mesa_strcmp(param, "on") == 0) { - pragmas->Optimize = GL_TRUE; + if (!pragmas->IgnoreOptimize) + pragmas->Optimize = GL_TRUE; } else if (_mesa_strcmp(param, "off") == 0) { - pragmas->Optimize = GL_FALSE; + if (!pragmas->IgnoreOptimize) + pragmas->Optimize = GL_FALSE; } else { return GL_FALSE; /* invalid param */ @@ -566,10 +560,12 @@ pp_pragma(struct gl_sl_pragmas *pragmas, const char *pragma, const char *param) if (!param) return GL_FALSE; /* missing required param */ if (_mesa_strcmp(param, "on") == 0) { - pragmas->Debug = GL_TRUE; + if (!pragmas->IgnoreDebug) + pragmas->Debug = GL_TRUE; } else if (_mesa_strcmp(param, "off") == 0) { - pragmas->Debug = GL_FALSE; + if (!pragmas->IgnoreDebug) + pragmas->Debug = GL_FALSE; } else { return GL_FALSE; /* invalid param */ @@ -945,7 +941,6 @@ preprocess_source (slang_string *output, const char *source, } pp_state_init (&state, elog, extensions); - pp_pragmas_init (pragmas); /* add the predefined symbols to the symbol table */ for (i = 0; predefined[i]; i++) { @@ -1296,6 +1291,8 @@ error: * \param output the post-process results * \param input the input text * \param elog log to record warnings, errors + * \param extensions out extension settings + * \param pragmas in/out #pragma settings * \return GL_TRUE for success, GL_FALSE for error */ GLboolean -- cgit v1.2.3 From e3aedec86808490fbb5a966b1e4dc15bff046f13 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 19 Mar 2009 22:06:10 +0000 Subject: slang: support uniform arrays --- src/mesa/shader/slang/slang_codegen.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 13a801c18a..8263aae334 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -4354,13 +4354,25 @@ _slang_codegen_global_variable(slang_assemble_ctx *A, slang_variable *var, if (prog) { /* user-defined uniform */ if (datatype == GL_NONE) { - if (var->type.specifier.type == SLANG_SPEC_STRUCT) { + if ((var->type.specifier.type == SLANG_SPEC_ARRAY && + var->type.specifier._array->type == SLANG_SPEC_STRUCT) || + (var->type.specifier.type == SLANG_SPEC_STRUCT)) { /* temporary work-around */ GLenum datatype = GL_FLOAT; GLint uniformLoc = _mesa_add_uniform(prog->Parameters, varName, totalSize, datatype, NULL); store = _slang_new_ir_storage_swz(PROGRAM_UNIFORM, uniformLoc, totalSize, swizzle); + + if (arrayLen > 0) { + GLint a = arrayLen - 1; + GLint i; + for (i = 0; i < a; i++) { + GLfloat value = (GLfloat)(i + uniformLoc + 1); + (void) _mesa_add_parameter(prog->Parameters, PROGRAM_UNIFORM, + varName, 1, datatype, &value, NULL, 0x0); + } + } /* XXX what we need to do is unroll the struct into its * basic types, creating a uniform variable for each. -- cgit v1.2.3 From 114bb54324f22cb53bcd14607234d0acd74d37bd Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 19 Mar 2009 22:38:01 +0000 Subject: slang: initialize the context --- src/mesa/shader/slang/slang_compile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa/shader') diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index aa08022869..fb7128841c 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2056,6 +2056,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, /* emit code for global var decl */ if (C->global_scope) { slang_assemble_ctx A; + memset(&A, 0, sizeof(slang_assemble_ctx)); A.atoms = C->atoms; A.space.funcs = O->funs; A.space.structs = O->structs; @@ -2073,7 +2074,7 @@ parse_init_declarator(slang_parse_ctx * C, slang_output_ctx * O, if (C->global_scope) { if (var->initializer != NULL) { slang_assemble_ctx A; - + memset(&A, 0, sizeof(slang_assemble_ctx)); A.atoms = C->atoms; A.space.funcs = O->funs; A.space.structs = O->structs; @@ -2415,7 +2416,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, if (mainFunc) { /* assemble (generate code) for main() */ slang_assemble_ctx A; - + memset(&A, 0, sizeof(slang_assemble_ctx)); A.atoms = C->atoms; A.space.funcs = o.funs; A.space.structs = o.structs; -- cgit v1.2.3