Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
glslang
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
glslang
Commits
e3cc0d35
Unverified
Commit
e3cc0d35
authored
Nov 14, 2018
by
John Kessenich
Committed by
GitHub
Nov 14, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1579 from TiemoJung/handle_c_register
HLSL: implemented c register handling
parents
844e0773
31cd98c7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
hlsl.structbuffer.frag
Test/hlsl.structbuffer.frag
+1
-1
hlslParseHelper.cpp
hlsl/hlslParseHelper.cpp
+11
-2
No files found.
Test/hlsl.structbuffer.frag
View file @
e3cc0d35
...
@@ -5,7 +5,7 @@ struct sb_t
...
@@ -5,7 +5,7 @@ struct sb_t
bool
test2
;
bool
test2
;
};
// stride = 20
};
// stride = 20
StructuredBuffer
<
sb_t
>
sbuf
:
register
(
c
10
);
StructuredBuffer
<
sb_t
>
sbuf
:
register
(
t
10
);
StructuredBuffer
<
float
>
sbuf2
;
StructuredBuffer
<
float
>
sbuf2
;
float4
main
(
uint
pos
:
FOO
)
:
SV_Target0
float4
main
(
uint
pos
:
FOO
)
:
SV_Target0
...
...
hlsl/hlslParseHelper.cpp
View file @
e3cc0d35
...
@@ -6066,13 +6066,22 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi
...
@@ -6066,13 +6066,22 @@ void HlslParseContext::handleRegister(const TSourceLoc& loc, TQualifier& qualifi
}
}
}
}
// TODO: learn what all these really mean and how they interact with regNumber and subComponent
// more information about register types see
// https://docs.microsoft.com/en-us/windows/desktop/direct3dhlsl/dx-graphics-hlsl-variable-register
const
std
::
vector
<
std
::
string
>&
resourceInfo
=
intermediate
.
getResourceSetBinding
();
const
std
::
vector
<
std
::
string
>&
resourceInfo
=
intermediate
.
getResourceSetBinding
();
switch
(
std
::
tolower
(
desc
[
0
]))
{
switch
(
std
::
tolower
(
desc
[
0
]))
{
case
'c'
:
// c register is the register slot in the global const buffer
// each slot is a vector of 4 32 bit components
qualifier
.
layoutOffset
=
regNumber
*
4
*
4
;
break
;
// const buffer register slot
case
'b'
:
case
'b'
:
// textrues and structured buffers
case
't'
:
case
't'
:
case
'c'
:
// samplers
case
's'
:
case
's'
:
// uav resources
case
'u'
:
case
'u'
:
// if nothing else has set the binding, do so now
// if nothing else has set the binding, do so now
// (other mechanisms override this one)
// (other mechanisms override this one)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment