From 52c51260f99b1a03985674cda24893d9fa98a4a2 Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Tue, 9 Dec 2014 19:08:33 -0700 Subject: 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. --- include/xgl.h | 7 ++++++- layers/draw_state.c | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/xgl.h b/include/xgl.h index 52a5f80d..f28aa22c 100644 --- a/include/xgl.h +++ b/include/xgl.h @@ -288,8 +288,13 @@ typedef enum _XGL_DESCRIPTOR_SET_SLOT_TYPE XGL_SLOT_SHADER_SAMPLER = 0x00000003, XGL_SLOT_NEXT_DESCRIPTOR_SET = 0x00000004, + // LUNARG CHANGE BEGIN - differentiate between textures and buffers + XGL_SLOT_SHADER_TEXTURE_RESOURCE = 0x00000005, + XGL_DESCRIPTOR_SET_SLOT_TYPE_BEGIN_RANGE = XGL_SLOT_UNUSED, - XGL_DESCRIPTOR_SET_SLOT_TYPE_END_RANGE = XGL_SLOT_NEXT_DESCRIPTOR_SET, + XGL_DESCRIPTOR_SET_SLOT_TYPE_END_RANGE = XGL_SLOT_SHADER_TEXTURE_RESOURCE, + // LUNARG CHANGE END + XGL_NUM_DESCRIPTOR_SET_SLOT_TYPE = (XGL_DESCRIPTOR_SET_SLOT_TYPE_END_RANGE - XGL_DESCRIPTOR_SET_SLOT_TYPE_BEGIN_RANGE + 1), XGL_MAX_ENUM(_XGL_DESCRIPTOR_SET_SLOT_TYPE) } XGL_DESCRIPTOR_SET_SLOT_TYPE; diff --git a/layers/draw_state.c b/layers/draw_state.c index 75193b89..1e8b1635 100644 --- a/layers/draw_state.c +++ b/layers/draw_state.c @@ -760,6 +760,7 @@ static XGL_BOOL verifyShaderSlotMapping(const XGL_UINT slot, const XGL_UINT slot char str[1024]; switch (shaderMapping) { + case XGL_SLOT_SHADER_TEXTURE_RESOURCE: case XGL_SLOT_SHADER_RESOURCE: if (MAPPING_MEMORY != slotBinding && MAPPING_IMAGE != slotBinding) error = XGL_TRUE; -- cgit v1.2.3