xgl: Add new resource type for textures
This change modifies xgl.h to include a new descriptor set
slot type for textures, distinct from resources:
XGL_SLOT_SHADER_TEXTURE_RESOURCE
Buffers continue to use:
XGL_SLOT_SHADER_RESOURCE
The ordering of their inclusion in binding tables entries is
important: textures must come before buffers. This is how
the compiler expects them to be laid out.
diff --git a/icd/intel/pipeline_shader.c b/icd/intel/pipeline_shader.c
index 329bdba..b66c00f 100644
--- a/icd/intel/pipeline_shader.c
+++ b/icd/intel/pipeline_shader.c
@@ -33,7 +33,10 @@
XGL_DESCRIPTOR_SET_SLOT_TYPE type,
XGL_UINT index)
{
- const XGL_UINT resource_offset = rmap->rt_count;
+ // The ordering of below offsets is important. Textures need to come before
+ // buffers with the current compiler conventions.
+ const XGL_UINT texture_resource_offset = rmap->rt_count;
+ const XGL_UINT resource_offset = texture_resource_offset + rmap->texture_resource_count;
const XGL_UINT uav_offset = resource_offset + rmap->resource_count;
const XGL_UINT sampler_offset = uav_offset + rmap->uav_count;
struct intel_pipeline_rmap_slot *slot;
@@ -42,6 +45,9 @@
case XGL_SLOT_UNUSED:
slot = NULL;
break;
+ case XGL_SLOT_SHADER_TEXTURE_RESOURCE:
+ slot = &rmap->slots[texture_resource_offset + index];
+ break;
case XGL_SLOT_SHADER_RESOURCE:
slot = &rmap->slots[resource_offset + index];
break;
@@ -138,6 +144,10 @@
switch (type) {
case XGL_SLOT_UNUSED:
break;
+ case XGL_SLOT_SHADER_TEXTURE_RESOURCE:
+ if (rmap->texture_resource_count < index + 1)
+ rmap->texture_resource_count = index + 1;
+ break;
case XGL_SLOT_SHADER_RESOURCE:
if (rmap->resource_count < index + 1)
rmap->resource_count = index + 1;
@@ -225,7 +235,7 @@
rmap_update_count(rmap, dyn->slotObjectType, dyn->shaderEntityIndex);
rmap->rt_count = rt_count;
- rmap->slot_count = rmap->rt_count + rmap->resource_count +
+ rmap->slot_count = rmap->rt_count + rmap->texture_resource_count + rmap->resource_count +
rmap->uav_count + rmap->sampler_count;
rmap->slots = icd_alloc(sizeof(rmap->slots[0]) * rmap->slot_count,