mesa: rename UniformBlockStageIndex to InterfaceBlockStageIndex
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Cc: Iago Toral <itoral@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
This commit is contained in:
@@ -178,7 +178,7 @@ set_block_binding(gl_shader_program *prog, const char *block_name, int binding)
|
|||||||
|
|
||||||
/* This is a field of a UBO. val is the binding index. */
|
/* This is a field of a UBO. val is the binding index. */
|
||||||
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (int i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
int stage_index = prog->UniformBlockStageIndex[i][block_index];
|
int stage_index = prog->InterfaceBlockStageIndex[i][block_index];
|
||||||
|
|
||||||
if (stage_index != -1) {
|
if (stage_index != -1) {
|
||||||
struct gl_shader *sh = prog->_LinkedShaders[i];
|
struct gl_shader *sh = prog->_LinkedShaders[i];
|
||||||
|
@@ -1174,10 +1174,10 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog)
|
|||||||
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
struct gl_shader *sh = prog->_LinkedShaders[i];
|
struct gl_shader *sh = prog->_LinkedShaders[i];
|
||||||
|
|
||||||
prog->UniformBlockStageIndex[i] = ralloc_array(prog, int,
|
prog->InterfaceBlockStageIndex[i] = ralloc_array(prog, int,
|
||||||
max_num_uniform_blocks);
|
max_num_uniform_blocks);
|
||||||
for (unsigned int j = 0; j < max_num_uniform_blocks; j++)
|
for (unsigned int j = 0; j < max_num_uniform_blocks; j++)
|
||||||
prog->UniformBlockStageIndex[i][j] = -1;
|
prog->InterfaceBlockStageIndex[i][j] = -1;
|
||||||
|
|
||||||
if (sh == NULL)
|
if (sh == NULL)
|
||||||
continue;
|
continue;
|
||||||
@@ -1194,7 +1194,7 @@ interstage_cross_validate_uniform_blocks(struct gl_shader_program *prog)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
prog->UniformBlockStageIndex[i][index] = j;
|
prog->InterfaceBlockStageIndex[i][index] = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2836,9 +2836,9 @@ check_resources(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
||||||
if (prog->UniformBlockStageIndex[j][i] != -1) {
|
if (prog->InterfaceBlockStageIndex[j][i] != -1) {
|
||||||
struct gl_shader *sh = prog->_LinkedShaders[j];
|
struct gl_shader *sh = prog->_LinkedShaders[j];
|
||||||
int stage_index = prog->UniformBlockStageIndex[j][i];
|
int stage_index = prog->InterfaceBlockStageIndex[j][i];
|
||||||
if (sh && sh->BufferInterfaceBlocks[stage_index].IsShaderStorage) {
|
if (sh && sh->BufferInterfaceBlocks[stage_index].IsShaderStorage) {
|
||||||
shader_blocks[j]++;
|
shader_blocks[j]++;
|
||||||
total_shader_storage_blocks++;
|
total_shader_storage_blocks++;
|
||||||
@@ -2955,7 +2955,7 @@ check_image_resources(struct gl_context *ctx, struct gl_shader_program *prog)
|
|||||||
total_image_units += sh->NumImages;
|
total_image_units += sh->NumImages;
|
||||||
|
|
||||||
for (unsigned j = 0; j < prog->NumBufferInterfaceBlocks; j++) {
|
for (unsigned j = 0; j < prog->NumBufferInterfaceBlocks; j++) {
|
||||||
int stage_index = prog->UniformBlockStageIndex[i][j];
|
int stage_index = prog->InterfaceBlockStageIndex[i][j];
|
||||||
if (stage_index != -1 && sh->BufferInterfaceBlocks[stage_index].IsShaderStorage)
|
if (stage_index != -1 && sh->BufferInterfaceBlocks[stage_index].IsShaderStorage)
|
||||||
total_shader_storage_blocks++;
|
total_shader_storage_blocks++;
|
||||||
}
|
}
|
||||||
@@ -3734,7 +3734,7 @@ build_program_resource_list(struct gl_shader_program *shProg)
|
|||||||
int block_index = shProg->UniformStorage[i].block_index;
|
int block_index = shProg->UniformStorage[i].block_index;
|
||||||
if (block_index != -1) {
|
if (block_index != -1) {
|
||||||
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
for (unsigned j = 0; j < MESA_SHADER_STAGES; j++) {
|
||||||
if (shProg->UniformBlockStageIndex[j][block_index] != -1)
|
if (shProg->InterfaceBlockStageIndex[j][block_index] != -1)
|
||||||
stageref |= (1 << j);
|
stageref |= (1 << j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -120,8 +120,8 @@ _mesa_clear_shader_program_data(struct gl_shader_program *shProg)
|
|||||||
shProg->NumShaderStorageBlocks = 0;
|
shProg->NumShaderStorageBlocks = 0;
|
||||||
|
|
||||||
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
ralloc_free(shProg->UniformBlockStageIndex[i]);
|
ralloc_free(shProg->InterfaceBlockStageIndex[i]);
|
||||||
shProg->UniformBlockStageIndex[i] = NULL;
|
shProg->InterfaceBlockStageIndex[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ralloc_free(shProg->AtomicBuffers);
|
ralloc_free(shProg->AtomicBuffers);
|
||||||
|
@@ -2716,13 +2716,14 @@ struct gl_shader_program
|
|||||||
struct gl_uniform_block **ShaderStorageBlocks;
|
struct gl_uniform_block **ShaderStorageBlocks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indices into the _LinkedShaders's UniformBlocks[] array for each stage
|
* Indices into the BufferInterfaceBlocks[] array for each stage they're
|
||||||
* they're used in, or -1.
|
* used in, or -1.
|
||||||
*
|
*
|
||||||
* This is used to maintain the Binding values of the stage's UniformBlocks[]
|
* This is used to maintain the Binding values of the stage's
|
||||||
* and to answer the GL_UNIFORM_BLOCK_REFERENCED_BY_*_SHADER queries.
|
* BufferInterfaceBlocks[] and to answer the
|
||||||
|
* GL_UNIFORM_BLOCK_REFERENCED_BY_*_SHADER queries.
|
||||||
*/
|
*/
|
||||||
int *UniformBlockStageIndex[MESA_SHADER_STAGES];
|
int *InterfaceBlockStageIndex[MESA_SHADER_STAGES];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Map of active uniform names to locations
|
* Map of active uniform names to locations
|
||||||
|
@@ -980,7 +980,7 @@ is_resource_referenced(struct gl_shader_program *shProg,
|
|||||||
return RESOURCE_ATC(res)->StageReferences[stage];
|
return RESOURCE_ATC(res)->StageReferences[stage];
|
||||||
|
|
||||||
if (res->Type == GL_UNIFORM_BLOCK || res->Type == GL_SHADER_STORAGE_BLOCK)
|
if (res->Type == GL_UNIFORM_BLOCK || res->Type == GL_SHADER_STORAGE_BLOCK)
|
||||||
return shProg->UniformBlockStageIndex[stage][index] != -1;
|
return shProg->InterfaceBlockStageIndex[stage][index] != -1;
|
||||||
|
|
||||||
return res->StageReferences & (1 << stage);
|
return res->StageReferences & (1 << stage);
|
||||||
}
|
}
|
||||||
|
@@ -294,8 +294,8 @@ _mesa_clear_shader_program_data(struct gl_shader_program *shProg)
|
|||||||
shProg->BufferInterfaceBlocks = NULL;
|
shProg->BufferInterfaceBlocks = NULL;
|
||||||
shProg->NumBufferInterfaceBlocks = 0;
|
shProg->NumBufferInterfaceBlocks = 0;
|
||||||
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
ralloc_free(shProg->UniformBlockStageIndex[i]);
|
ralloc_free(shProg->InterfaceBlockStageIndex[i]);
|
||||||
shProg->UniformBlockStageIndex[i] = NULL;
|
shProg->InterfaceBlockStageIndex[i] = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ralloc_free(shProg->AtomicBuffers);
|
ralloc_free(shProg->AtomicBuffers);
|
||||||
|
@@ -1026,7 +1026,7 @@ _mesa_UniformBlockBinding(GLuint program,
|
|||||||
shProg->BufferInterfaceBlocks[uniformBlockIndex].Binding = uniformBlockBinding;
|
shProg->BufferInterfaceBlocks[uniformBlockIndex].Binding = uniformBlockBinding;
|
||||||
|
|
||||||
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
int stage_index = shProg->UniformBlockStageIndex[i][uniformBlockIndex];
|
int stage_index = shProg->InterfaceBlockStageIndex[i][uniformBlockIndex];
|
||||||
|
|
||||||
if (stage_index != -1) {
|
if (stage_index != -1) {
|
||||||
struct gl_shader *sh = shProg->_LinkedShaders[i];
|
struct gl_shader *sh = shProg->_LinkedShaders[i];
|
||||||
@@ -1079,7 +1079,7 @@ _mesa_ShaderStorageBlockBinding(GLuint program,
|
|||||||
shProg->BufferInterfaceBlocks[shaderStorageBlockIndex].Binding = shaderStorageBlockBinding;
|
shProg->BufferInterfaceBlocks[shaderStorageBlockIndex].Binding = shaderStorageBlockBinding;
|
||||||
|
|
||||||
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
for (i = 0; i < MESA_SHADER_STAGES; i++) {
|
||||||
int stage_index = shProg->UniformBlockStageIndex[i][shaderStorageBlockIndex];
|
int stage_index = shProg->InterfaceBlockStageIndex[i][shaderStorageBlockIndex];
|
||||||
|
|
||||||
if (stage_index != -1) {
|
if (stage_index != -1) {
|
||||||
struct gl_shader *sh = shProg->_LinkedShaders[i];
|
struct gl_shader *sh = shProg->_LinkedShaders[i];
|
||||||
|
Reference in New Issue
Block a user