summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/d3d1x
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2012-05-01 02:38:51 +0200
committerFrancisco Jerez <[email protected]>2012-05-11 12:39:39 +0200
commita5f44cc8c2ce0916809ce5da5a2490ad000ef099 (patch)
tree33ffba4161f7f3201a505ab5a23d6f70ea6cfc7f /src/gallium/state_trackers/d3d1x
parentd9d82dcd006c124e6569789c90390c43c1360c06 (diff)
gallium/tgsi: Split sampler views from shader resources.
This commit splits the current concept of resource into "sampler views" and "shader resources": "Sampler views" are textures or buffers that are bound to a given shader stage and can be read from in conjunction with a sampler object. They are analogous to OpenGL texture objects or Direct3D SRVs. "Shader resources" are textures or buffers that can be read and written from a shader. There's no support for floating point coordinates, address wrap modes or filtering, and, unlike sampler views, shader resources are global for the whole graphics pipeline. They are analogous to OpenGL image objects (as in ARB_shader_image_load_store) or Direct3D UAVs. Most hardware is likely to implement shader resources and sampler views as separate objects, so, having the distinction at the API level simplifies things slightly for the driver. This patch introduces the SVIEW register file with a declaration token and syntax analogous to the already existing RES register file. After this change, the SAMPLE_* opcodes no longer accept a resource as input, but rather a SVIEW object. To preserve the functionality of reading from a sampler view with integer coordinates, the SAMPLE_I(_MS) opcodes are introduced which are similar to LOAD(_MS) but take a SVIEW register instead of a RES register as argument.
Diffstat (limited to 'src/gallium/state_trackers/d3d1x')
-rw-r--r--src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp b/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp
index 392fd3e0921..aaa46f19e8c 100644
--- a/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp
+++ b/src/gallium/state_trackers/d3d1x/gd3d1x/sm4_to_tgsi.cpp
@@ -446,7 +446,7 @@ struct sm4_to_tgsi_converter
break;
case SM4_OPCODE_RESINFO:
// TODO: return type
- ureg_RESINFO(ureg, _dst(), _src(1), resources[_idx(SM4_FILE_RESOURCE, 2)]);
+ ureg_SVIEWINFO(ureg, _dst(), _src(1), resources[_idx(SM4_FILE_RESOURCE, 2)]);
break;
// TODO: sample index, texture offset
case SM4_OPCODE_LD: // dst, coord_int, res; mipmap level in last coord_int arg
@@ -750,11 +750,12 @@ next:;
}
if(resources.size() <= (unsigned)idx)
resources.resize(idx + 1);
- resources[idx] = ureg_DECL_resource(ureg, idx, targets[idx].first,
- res_return_type(dcl.rrt.x),
- res_return_type(dcl.rrt.y),
- res_return_type(dcl.rrt.z),
- res_return_type(dcl.rrt.w));
+ resources[idx] = ureg_DECL_sampler_view(
+ ureg, idx, targets[idx].first,
+ res_return_type(dcl.rrt.x),
+ res_return_type(dcl.rrt.y),
+ res_return_type(dcl.rrt.z),
+ res_return_type(dcl.rrt.w));
break;
case SM4_OPCODE_DCL_SAMPLER:
check(idx >= 0);