mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
r600: refactor r600_shader_buffer_info_sel
Signed-off-by: Patrick Lerda <patrick9876@free.fr> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39650>
This commit is contained in:
parent
917c3dc77a
commit
d17654c1b5
3 changed files with 8 additions and 7 deletions
|
|
@ -937,8 +937,6 @@ RatInstr::emit_image_load_or_atomic(nir_intrinsic_instr *intrin, Shader& shader)
|
|||
return true;
|
||||
}
|
||||
|
||||
#define R600_SHADER_BUFFER_INFO_SEL (512 + R600_BUFFER_INFO_OFFSET / 16)
|
||||
|
||||
bool
|
||||
RatInstr::emit_image_size(nir_intrinsic_instr *intrin, Shader& shader)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ TexInstr::emit_buf_txf(nir_tex_instr *tex, Inputs& src, Shader& shader)
|
|||
|
||||
if (shader.chip_class() < ISA_CC_EVERGREEN) {
|
||||
auto tmp_w = vf.temp_register();
|
||||
int buf_sel = (512 + R600_BUFFER_INFO_OFFSET / 16) + 2 * tex->texture_index;
|
||||
int buf_sel = R600_SHADER_BUFFER_INFO_SEL + 2 * tex->texture_index;
|
||||
AluInstr *ir = nullptr;
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
auto d = i < 3 ? dst[i] : tmp_w;
|
||||
|
|
@ -658,7 +658,7 @@ TexInstr::emit_tex_txs(nir_tex_instr *tex,
|
|||
shader.emit_instruction(new QueryBufferSizeInstr(
|
||||
dest, {0, 7, 7, 7}, tex->texture_index + R600_MAX_CONST_BUFFERS));
|
||||
} else {
|
||||
int id = 2 * tex->texture_index + (512 + R600_BUFFER_INFO_OFFSET / 16) + 1;
|
||||
int id = 2 * tex->texture_index + R600_SHADER_BUFFER_INFO_SEL + 1;
|
||||
auto src = vf.uniform(id, 1, R600_BUFFER_INFO_CONST_BUFFER);
|
||||
shader.emit_instruction(new AluInstr(op1_mov, dest[0], src, AluInstr::write));
|
||||
shader.set_flag(Shader::sh_uses_tex_buffer);
|
||||
|
|
@ -684,9 +684,10 @@ TexInstr::emit_tex_txs(nir_tex_instr *tex,
|
|||
shader.emit_instruction(ir);
|
||||
|
||||
if (tex->is_array && tex->sampler_dim == GLSL_SAMPLER_DIM_CUBE) {
|
||||
auto src_loc = vf.uniform(512 + R600_BUFFER_INFO_OFFSET / 16 + (tex->texture_index >> 2),
|
||||
tex->texture_index & 3,
|
||||
R600_BUFFER_INFO_CONST_BUFFER);
|
||||
auto src_loc =
|
||||
vf.uniform(R600_SHADER_BUFFER_INFO_SEL + (tex->texture_index >> 2),
|
||||
tex->texture_index & 3,
|
||||
R600_BUFFER_INFO_CONST_BUFFER);
|
||||
|
||||
auto alu = new AluInstr(op1_mov, dest[2], src_loc, AluInstr::write);
|
||||
shader.emit_instruction(alu);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,8 @@
|
|||
#include "sfn_shader.h"
|
||||
#include "sfn_valuefactory.h"
|
||||
|
||||
#define R600_SHADER_BUFFER_INFO_SEL (512 + R600_BUFFER_INFO_OFFSET / 16)
|
||||
|
||||
namespace r600 {
|
||||
|
||||
class TexInstr : public InstrWithVectorResult {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue