summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMichal Krol <[email protected]>2010-01-22 09:40:33 +0100
committerMichal Krol <[email protected]>2010-01-28 14:07:48 +0100
commit44ac4c4e2c7890236ee7e9cd0cf82b58710d57ef (patch)
treec24d00e640849b6cf0a4ab9b645b9028dc0cdf92 /src/gallium/state_trackers
parent4771e536e16699a0488b68e153de3478dfbc55d0 (diff)
regress: Add fragment shader test for one-dimensional constant buffers.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-cb-1d.sh13
-rw-r--r--src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py11
2 files changed, 19 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-cb-1d.sh b/src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-cb-1d.sh
new file mode 100644
index 00000000000..85fb9ea4e7f
--- /dev/null
+++ b/src/gallium/state_trackers/python/tests/regress/fragment-shader/frag-cb-1d.sh
@@ -0,0 +1,13 @@
+FRAG
+
+DCL IN[0], COLOR, LINEAR
+DCL OUT[0], COLOR
+DCL CONST[1]
+DCL CONST[3]
+DCL TEMP[0..1]
+
+ADD TEMP[0], IN[0], CONST[1]
+RCP TEMP[1], CONST[3].xxxx
+MUL OUT[0], TEMP[0], TEMP[1]
+
+END
diff --git a/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py b/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py
index 6a0c1f824bb..9e668d2ac69 100644
--- a/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py
+++ b/src/gallium/state_trackers/python/tests/regress/fragment-shader/fragment-shader.py
@@ -147,17 +147,17 @@ def test(dev, name):
fs = Shader(file('frag-' + name + '.sh', 'rt').read())
ctx.set_fragment_shader(fs)
- constbuf0 = dev.buffer_create(16,
+ constbuf0 = dev.buffer_create(64,
(PIPE_BUFFER_USAGE_CONSTANT |
PIPE_BUFFER_USAGE_GPU_READ |
PIPE_BUFFER_USAGE_CPU_WRITE),
4 * 4 * 4)
cbdata = ''
- cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
- cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
- cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
- cbdata += struct.pack('4f', 0.5, 0.5, 0.5, 0.5)
+ cbdata += struct.pack('4f', 0.4, 0.0, 0.0, 1.0)
+ cbdata += struct.pack('4f', 1.0, 1.0, 1.0, 1.0)
+ cbdata += struct.pack('4f', 2.0, 2.0, 2.0, 2.0)
+ cbdata += struct.pack('4f', 4.0, 8.0, 16.0, 32.0)
constbuf0.write(cbdata, 0)
@@ -221,6 +221,7 @@ def main():
tests = [
'abs',
'add',
+ 'cb-1d',
'cb-2d',
'dp3',
'dp4',