Use param name ptr for sampler_name
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Thu, 17 May 2018 12:15:26 -0400
changeset 1185 7ff14b0252a0
parent 1184 62922fc6abe9
child 1186 b5c8483ff647
Use param name ptr for sampler_name
mojoshader_effects.c
--- a/mojoshader_effects.c	Fri Oct 13 11:28:07 2017 -0400
+++ b/mojoshader_effects.c	Thu May 17 12:15:26 2018 -0400
@@ -665,7 +665,7 @@
                 object->shader.params[j] = par;
                 if (object->shader.shader->symbols[j].register_set == MOJOSHADER_SYMREGSET_SAMPLER)
                 {
-                    object->shader.samplers[curSampler].sampler_name = object->shader.shader->symbols[j].name;
+                    object->shader.samplers[curSampler].sampler_name = effect->params[par].value.name;
                     object->shader.samplers[curSampler].sampler_register = object->shader.shader->symbols[j].register_index;
                     object->shader.samplers[curSampler].sampler_state_count = effect->params[par].value.value_count;
                     object->shader.samplers[curSampler].sampler_states = effect->params[par].value.valuesSS;
@@ -787,7 +787,7 @@
                     object->shader.params[j] = par;
                     if (object->shader.shader->symbols[j].register_set == MOJOSHADER_SYMREGSET_SAMPLER)
                     {
-                        object->shader.samplers[curSampler].sampler_name = object->shader.shader->symbols[j].name;
+                        object->shader.samplers[curSampler].sampler_name = effect->params[par].value.name;
                         object->shader.samplers[curSampler].sampler_register = object->shader.shader->symbols[j].register_index;
                         object->shader.samplers[curSampler].sampler_state_count = effect->params[par].value.value_count;
                         object->shader.samplers[curSampler].sampler_states = effect->params[par].value.valuesSS;
@@ -1622,7 +1622,7 @@
             for (j = 0; j < clone->objects[i].shader.shader->symbol_count; j++)
                 if (clone->objects[i].shader.shader->symbols[j].register_set == MOJOSHADER_SYMREGSET_SAMPLER)
                 {
-                    clone->objects[i].shader.samplers[curSampler].sampler_name = clone->objects[i].shader.shader->symbols[j].name;
+                    clone->objects[i].shader.samplers[curSampler].sampler_name = clone->params[clone->objects[i].shader.params[j]].value.name;
                     clone->objects[i].shader.samplers[curSampler].sampler_register = clone->objects[i].shader.shader->symbols[j].register_index;
                     clone->objects[i].shader.samplers[curSampler].sampler_state_count = clone->params[clone->objects[i].shader.params[j]].value.value_count;
                     clone->objects[i].shader.samplers[curSampler].sampler_states = clone->params[clone->objects[i].shader.params[j]].value.valuesSS;