mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 06:20:09 +01:00
vk/HACK: Plumb real descriptor set/index into textures
This commit is contained in:
parent
aded32bf04
commit
510b5c3bed
5 changed files with 9 additions and 4 deletions
|
|
@ -321,6 +321,7 @@ nir_visitor::visit(ir_variable *ir)
|
|||
}
|
||||
|
||||
var->data.index = ir->data.index;
|
||||
var->data.descriptor_set = ir->data.set;
|
||||
var->data.binding = ir->data.binding;
|
||||
/* XXX Get rid of buffer_index */
|
||||
var->data.atomic.buffer_index = ir->data.binding;
|
||||
|
|
|
|||
|
|
@ -300,6 +300,7 @@ typedef struct {
|
|||
*
|
||||
* For array types, this represents the binding point for the first element.
|
||||
*/
|
||||
int descriptor_set;
|
||||
int binding;
|
||||
|
||||
/**
|
||||
|
|
@ -985,6 +986,9 @@ typedef struct {
|
|||
/* gather component selector */
|
||||
unsigned component : 2;
|
||||
|
||||
/* The descriptor set containing this texture */
|
||||
unsigned sampler_set;
|
||||
|
||||
/** The sampler index
|
||||
*
|
||||
* If this texture instruction has a nir_tex_src_sampler_offset source,
|
||||
|
|
|
|||
|
|
@ -1622,7 +1622,9 @@ fs_visitor::nir_emit_intrinsic(nir_intrinsic_instr *instr)
|
|||
void
|
||||
fs_visitor::nir_emit_texture(nir_tex_instr *instr)
|
||||
{
|
||||
unsigned sampler = instr->sampler_index;
|
||||
uint32_t set = instr->sampler_set;
|
||||
uint32_t index = instr->sampler_index;
|
||||
unsigned sampler = stage_prog_data->bind_map[set][index];
|
||||
fs_reg sampler_reg(sampler);
|
||||
|
||||
/* FINISHME: We're failing to recompile our programs when the sampler is
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ brw_create_nir(struct brw_context *brw,
|
|||
nir_validate_shader(nir);
|
||||
|
||||
if (shader_prog) {
|
||||
nir_lower_samplers(nir, shader_prog, stage);
|
||||
nir_lower_samplers_for_vk(nir);
|
||||
nir_validate_shader(nir);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,8 +71,6 @@ set_binding_table_layout(struct brw_stage_prog_data *prog_data,
|
|||
else
|
||||
bias = 0;
|
||||
|
||||
prog_data->binding_table.texture_start = bias;
|
||||
|
||||
count = layout->stage[stage].surface_count;
|
||||
prog_data->map_entries =
|
||||
(uint32_t *) malloc(count * sizeof(prog_data->map_entries[0]));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue