intel: disable PCB
XGL_LINK_CONST_BUFFER should be consumed by the compiler rather than blindly
pushed.
diff --git a/icd/intel/pipeline_shader.c b/icd/intel/pipeline_shader.c
index 985fd76..9215df7 100644
--- a/icd/intel/pipeline_shader.c
+++ b/icd/intel/pipeline_shader.c
@@ -256,40 +256,6 @@
return rmap;
}
-static XGL_RESULT pipeline_shader_copy_pcb(struct intel_pipeline_shader *sh,
- const XGL_LINK_CONST_BUFFER *buffers,
- XGL_UINT buffer_count)
-{
- XGL_SIZE pcb_size = 0;
- XGL_UINT i;
-
- /*
- * XXX This is not enough. We need a mapping from buffer id to pcb
- * offset, and we need to check against hardware limits.
- */
- for (i = 0; i < buffer_count; i++) {
- const XGL_LINK_CONST_BUFFER *buf = &buffers[i];
-
- pcb_size += buf->bufferSize;
- }
-
- sh->pcb = icd_alloc(pcb_size, 0, XGL_SYSTEM_ALLOC_INTERNAL);
- if (!sh->pcb)
- return XGL_ERROR_OUT_OF_MEMORY;
-
- pcb_size = 0;
- for (i = 0; i < buffer_count; i++) {
- const XGL_LINK_CONST_BUFFER *buf = &buffers[i];
-
- memcpy((char *) sh->pcb + pcb_size, buf->pBufferData, buf->bufferSize);
- pcb_size += buf->bufferSize;
- }
-
- sh->pcb_size = pcb_size;
-
- return XGL_SUCCESS;
-}
-
static XGL_RESULT pipeline_shader_copy_ir(struct intel_pipeline_shader *sh,
const struct intel_shader *ir)
{
@@ -322,19 +288,13 @@
if (ret != XGL_SUCCESS)
return ret;
- ret = pipeline_shader_copy_pcb(vs, info->vs.pLinkConstBufferInfo,
- info->vs.linkConstBufferCount);
- if (ret != XGL_SUCCESS) {
- icd_free(vs->pCode);
- return ret;
- }
+ assert(!info->vs.linkConstBufferCount);
vs->rmap = rmap_create(pipeline->dev,
&info->vs.descriptorSetMapping[0],
&info->vs.dynamicMemoryViewMapping, 0);
if (!vs->rmap) {
icd_free(vs->pCode);
- icd_free(vs->pcb);
return XGL_ERROR_OUT_OF_MEMORY;
}
@@ -353,12 +313,7 @@
if (ret != XGL_SUCCESS)
return ret;
- ret = pipeline_shader_copy_pcb(tcs, info->tcs.pLinkConstBufferInfo,
- info->tcs.linkConstBufferCount);
- if (ret != XGL_SUCCESS) {
- icd_free(tcs->pCode);
- return ret;
- }
+ assert(!info->tcs.linkConstBufferCount);
pipeline->active_shaders |= SHADER_TESS_CONTROL_FLAG;
@@ -375,12 +330,7 @@
if (ret != XGL_SUCCESS)
return ret;
- ret = pipeline_shader_copy_pcb(tes, info->tes.pLinkConstBufferInfo,
- info->tes.linkConstBufferCount);
- if (ret != XGL_SUCCESS) {
- icd_free(tes->pCode);
- return ret;
- }
+ assert(!info->tes.linkConstBufferCount);
pipeline->active_shaders |= SHADER_TESS_EVAL_FLAG;
@@ -397,12 +347,7 @@
if (ret != XGL_SUCCESS)
return ret;
- ret = pipeline_shader_copy_pcb(gs, info->gs.pLinkConstBufferInfo,
- info->gs.linkConstBufferCount);
- if (ret != XGL_SUCCESS) {
- icd_free(gs->pCode);
- return ret;
- }
+ assert(!info->tes.linkConstBufferCount);
pipeline->active_shaders |= SHADER_GEOMETRY_FLAG;
@@ -419,19 +364,13 @@
if (ret != XGL_SUCCESS)
return ret;
- ret = pipeline_shader_copy_pcb(fs, info->fs.pLinkConstBufferInfo,
- info->fs.linkConstBufferCount);
- if (ret != XGL_SUCCESS) {
- icd_free(fs->pCode);
- return ret;
- }
+ assert(!info->fs.linkConstBufferCount);
/* assuming one RT; need to parse the shader */
fs->rmap = rmap_create(pipeline->dev,
&info->fs.descriptorSetMapping[0],
&info->fs.dynamicMemoryViewMapping, 1);
if (!fs->rmap) {
- icd_free(fs->pcb);
icd_free(fs->pCode);
return XGL_ERROR_OUT_OF_MEMORY;
}
@@ -451,12 +390,7 @@
if (ret != XGL_SUCCESS)
return ret;
- ret = pipeline_shader_copy_pcb(cs, info->compute.cs.pLinkConstBufferInfo,
- info->compute.cs.linkConstBufferCount);
- if (ret != XGL_SUCCESS) {
- icd_free(cs->pCode);
- return ret;
- }
+ assert(!info->compute.cs.linkConstBufferCount);
pipeline->active_shaders |= SHADER_COMPUTE_FLAG;
@@ -488,8 +422,6 @@
static void pipeline_tear_shader(struct intel_pipeline_shader *sh)
{
icd_free(sh->pCode);
- if (sh->pcb)
- icd_free(sh->pcb);
if (sh->rmap)
rmap_destroy(sh->rmap);
}