intel/fs: Add support for bindless texture ops
We add two new texture sources for bindless surface and sampler handles. Bindless surface handles are expected to be pre-shifted so that the 20-bit surface state table index is in the top 20 bits of the 32-bit handle. This lets us avoid any extra shifts in the shader. Bindless sampler handles are 32-byte aligned byte offsets from general state base address. We use 32-byte aligned instead of 16-byte aligned to avoid having to use more indirect messages than needed. It means we can't tightly pack samplers but that's probably not a big deal. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:

committed by
Jason Ekstrand

parent
2edf29b933
commit
843286d324
@@ -35,7 +35,8 @@ using namespace brw;
|
||||
/* Sample from the MCS surface attached to this multisample texture. */
|
||||
fs_reg
|
||||
fs_visitor::emit_mcs_fetch(const fs_reg &coordinate, unsigned components,
|
||||
const fs_reg &texture)
|
||||
const fs_reg &texture,
|
||||
const fs_reg &texture_handle)
|
||||
{
|
||||
const fs_reg dest = vgrf(glsl_type::uvec4_type);
|
||||
|
||||
@@ -43,6 +44,7 @@ fs_visitor::emit_mcs_fetch(const fs_reg &coordinate, unsigned components,
|
||||
srcs[TEX_LOGICAL_SRC_COORDINATE] = coordinate;
|
||||
srcs[TEX_LOGICAL_SRC_SURFACE] = texture;
|
||||
srcs[TEX_LOGICAL_SRC_SAMPLER] = brw_imm_ud(0);
|
||||
srcs[TEX_LOGICAL_SRC_SURFACE_HANDLE] = texture_handle;
|
||||
srcs[TEX_LOGICAL_SRC_COORD_COMPONENTS] = brw_imm_d(components);
|
||||
srcs[TEX_LOGICAL_SRC_GRAD_COMPONENTS] = brw_imm_d(0);
|
||||
|
||||
|
Reference in New Issue
Block a user