nak: Handle the num_gpr offsetting inside nak
This makes the thing in the nak_shader_info exactly the thing that gets plugged into the hardware. Makes the driver a bit simpler. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26197>
This commit is contained in:
parent
d8551cd328
commit
c074ea6215
2 changed files with 7 additions and 5 deletions
|
|
@ -31,6 +31,7 @@ use crate::nak_ir::ShaderStageInfo;
|
|||
use nak_bindings::*;
|
||||
use nak_from_nir::*;
|
||||
use nak_ir::ShaderIoInfo;
|
||||
use std::cmp::max;
|
||||
use std::env;
|
||||
use std::ffi::CStr;
|
||||
use std::os::raw::c_void;
|
||||
|
|
@ -279,7 +280,11 @@ pub extern "C" fn nak_compile_shader(
|
|||
|
||||
let info = nak_shader_info {
|
||||
stage: nir.info.stage(),
|
||||
num_gprs: s.info.num_gprs,
|
||||
num_gprs: if s.info.sm >= 75 {
|
||||
max(4, s.info.num_gprs + 2)
|
||||
} else {
|
||||
max(4, s.info.num_gprs)
|
||||
},
|
||||
num_barriers: s.info.num_barriers,
|
||||
slm_size: s.info.slm_size,
|
||||
__bindgen_anon_1: match &s.info.stage {
|
||||
|
|
|
|||
|
|
@ -402,10 +402,7 @@ nvk_compile_nir_with_nak(struct nvk_physical_device *pdev,
|
|||
|
||||
shader->stage = nir->info.stage;
|
||||
|
||||
if (pdev->info.cls_eng3d >= TURING_A)
|
||||
shader->num_gprs = MAX2(4, bin->info.num_gprs + 2);
|
||||
else
|
||||
shader->num_gprs = MAX2(4, bin->info.num_gprs);
|
||||
shader->num_gprs = bin->info.num_gprs;
|
||||
shader->num_barriers = bin->info.num_barriers;
|
||||
shader->slm_size = bin->info.slm_size;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue